LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Question on Linux file formats: A file is not a file. (https://www.linuxquestions.org/questions/linux-general-1/question-on-linux-file-formats-a-file-is-not-a-file-869431/)

theKbStockpiler 03-18-2011 11:25 AM

Question on Linux file formats: A file is not a file.
 
If we navigate to /usr/share/application ;or where icons appear to be, the properties seem to be a bash command to launch the program symbolized by the icon. If you copy and past the symbol to gedit the Location is copied and pasted but if you drag it to gedit you get an extrapolated version of this summery.


This:
/usr/share/applications/gnome-sol.desktop (Copy and pasted)





Or this: (Draged)

Desktop Entry]
Name=AisleRiot Solitaire
Name[af]=AisleRiot-patience
Name[ar]=صولتار آيسل رايوت
Name[as]=Aisleriot সলিটেয়াৰ
Name[ast]=Solitariu AisleRiot
Name[az]=AisleRiot Solitaire
Name[bg]=Пасианси
Name[bn]=AisleRiot সলিটেয়ার
Comment[th]=เล่นเกมถอดไพ่สารพัดแบบ
Comment[tr]=Farkli iskambil falı oyunlarını oynayın
Comment[uk]=Дозволяє грати у багато різних пасьянсів
Comment[vi]=Chơi nhiều tṛ chơi solitaire khác nhau
Comment[xh]=Dlala imidlalo emininzi eyahlukeneyo ye-solitaire
Comment[zh_CN]=玩各种纸牌游戏
Comment[zh_HK]=玩不同類型的接龍遊戲
Comment[zh_TW]=玩不同類型的接龍遊戲
Exec=sol
Icon=gnome-aisleriot
Terminal=false
Type=Application
Categories=GNOME;GTK;Game;CardGame;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-games
X-GNOME-Bugzilla-Component=BugBuddyBugs
X-GNOME-Bugzilla-Version=2.30.1
StartupNotify=true
X-HildonDesk-ShowInToolbar=true
X-Osso-Service=org.gnome.Games.AisleRiot
X-Osso-Type=application/x-executable
X-Desktop-File-Install-Version=0.16


Any thoughts or Search terms that can partially explain this?

Thanks in advance!

colucix 03-18-2011 11:44 AM

When you copy an object, be it a regular file, an application or a folder, the URI of that object is stored in the clipboard. If you paste from a file manager (e.g. Nautilus) the object is copied, if you paste from a text editor, the URI is copied as plain text. On the other hand, when you drag and drop an object inside an application window, the object is managed by that application. Since gedit is a text editor, the object is considered a text file and gedit tries to open it as such.

theKbStockpiler 03-18-2011 12:34 PM

Thanks for the Reply!
 
So should I assume that I need more than one application to view ALL of the data in the file separately? There is more data in the file obviously. If I used Emacs would it list everyting in binary? How do I display the code for the image of the Desktop icon in this file. Should I have bash open it with gimp? Nautilus does not open it as file and it behaves as a menu icon to open the app. Could the Archive Manager open it? I'm currently trying to educate myself in how init lauches interactive processes like gedit or example. Sorry for the rambling but this is core topic at the moment for me.

It just occurred to me that the images are part of a nautilus file and not /usr/shar/application at all. Could this be right?

Thanks for the great explanation by the way.That would have taken forever if I could figure it out myself.

reed9 03-18-2011 01:42 PM

The image nautilus is displaying is determined by this line in the file.
Code:

Icon=gnome-aisleriot
It's going to look in your icon theme for an icon named gnome-aisleriot to use.

.desktop files are a little special, and desktop environment's that adhere to freedesktop.org specs treat them as such.

Note also because they are treated differently, there is potential risk with them as well.

colucix 03-18-2011 02:06 PM

Not sure about your requirement, but a launcher is an object which is managed by Gnome and the File Manager to display the specified icon and to trigger some process if clicked. Take a look at http://library.gnome.org/users/user-...nchers.html.en for some insight.

From a lower point of view it is simply a text file containing a list of key/value pairs. The file manager interprets these values and displays it accordingly. In other words a launcher is simply what you see if you open it with a text editor or if you print its content using cat in a terminal. A text file. The actual icon, whose name or path is specified by the Icon key is an image file placed in some default path. The program executed is an executable placed somewhere in your path. Each object is independent from the launcher: it just contains a reference to that object.

A complete description of the launcher properties is given here: http://library.gnome.org/devel/desktop-entry-spec/. Hope this is what you're looking for. Otherwise, please correct me.


All times are GMT -5. The time now is 12:06 PM.