Hi everyone,
I changed a file's icon using gnome (properties) and wondered how you would do that in a terminal or shell script.
Can't find anything on it...
Can anyone help?
Thanks..
Hi everyone,
I changed a file's icon using gnome (properties) and wondered how you would do that in a terminal or shell script.
Can't find anything on it...
Can anyone help?
Thanks..
Last edited by mdpalow; November 26th, 2007 at 07:09 PM.
anyone?
bump.
System76 Gazelle Professional (GazP6)
Intel Core i7 2820QM, 8GB DDR3, nvidia GTX 460m, OCZ Vertex 3
System76 Starling (star4) Netbook.
Get Dropbox!
thanks for the detailed answer.
The problem is that I want to change the icon of a sh script that is sitting on my Dektop and I don't want to change the icon for all text files, but just this one.
I realize it can be done by going to properties, but I need to do this in a script or from the terminal.
Do you know how to do that as well by any chance?
Thanks in advance...
AFAIK, the icon is picked up from the value of the Icon= entry in the <application_name>.desktop file in the Desktop directory.
Changing this via your script to an icon name (if the icon is part of the system icons) or a path to an icon file should change the icon displayed appropriately.
Please mark threads as SOLVED ( if solved ) so other people can find solutions faster.
Hi Paul,
After reading your reply, I think I might have poorly stated what I want to do in my title.
I have a script sitting on my desktop. It has a folder in my /home/$USER directory where I have some help files. I have a script that uncompresses these files and puts everything where it should be. I'd like to add to this install script a little snippet that would also change the icon of the main script.
I know I can go into properties and change it there, but I need to know how to change it in a script, so when someone runs the installer, it puts everything in place and then changes the icon based on an icon file that is on the system already.
Do you know how this is done...?
Thanks and sorry for the confusion..
Obviously, a script can't contain an icon, so there's metadata involved. Nautilus creates metadata xml-files for each directory in ~/.nautilus/metafiles. You'll find the one for the desktop as(Having / characters in filenames is possible, but complicates things, so %2F is used instead)Code:file:%2F%2F%2Fhome%2Fusername%2FDesktop.xml
In that xml-file you should find an entry for your script like:I would recommend you use launcher instead as it's easier to manipulate with a shell-script.Code:<file name="test.sh" timestamp="1196172522" icon_position="220,22" custom_icon="file:///usr/share/pixmaps/baobab.xpm"/>
Hi geirha,
Thanks for the post. I didn't get a message you had replied or I would have responded sooner.
This is what I was looking for. However, you've got me thinking now about Launchers since you say they are easier to work with. Today, I was actually looking for the Launcher info on one I made, but no luck. Can you tell me - if I make a launcher, where is the file located that get updated with the new launcher info?
Thanks very much for your prior post, I'm gonna work with that until I hear something back from you or someone else about the launcher stuff..
Good night
Edit: I see why it's harder to work with in the .xml file as it is given a timestamp, which isn't a huge problem, but if/when you move the file (.sh), it loses its icon. I'd like to see what you/anyone says about Launchers. Finally, I feel like I'm getting closer to resolving this. thanks...
Last edited by mdpalow; November 28th, 2007 at 06:08 AM.
Well, let's say the script is saved as ~/test.sh, rightclick the desktop and choose create launcher,
Type: Application
Name: test
Command: ~/test.sh
Change the icon to something
now, if you look in ~/Desktop, there should be a file test.desktop that looks something like:
Code:[Desktop Entry] Version=1.0 Encoding=UTF-8 Name=test Type=Application Terminal=false Exec=~/test.sh Icon=/usr/share/pixmaps/nohost.png
geirha
Thank you very much for this. Great answer. This is EXACTLY what I was looking for to do what I want.
Bookmarks