The time now is Wed 19 Jun 2013, 07:39
All times are UTC - 4 |
| Author |
Message |
RSH

Joined: 05 Sep 2011 Posts: 1564 Location: Germany
|
Posted: Wed 25 Apr 2012, 21:38 Post_subject:
How to set an Icon for a Script using Bash? |
|
Hi,
usually i do a right-click on a script (desktop button also) and choose "change symbol" (or sim.)(Symbol ändern i.G.) to set a new symbol. I want to do this using a bash script.
How can i do this?
Thanks
RSH
_________________ Useful Software for Puppy!
LazY Puppy - a Paradise Puppy! - DE & EN ISO 2.0.2-0.0.5 available
|
|
Back to top
|
|
 |
stu90

Joined: 25 Feb 2010 Posts: 1401 Location: England. Dell Inspiron 1501. Dpup
|
Posted: Wed 25 Apr 2012, 23:41 Post_subject:
|
|
Hi RSH
Looks like /root/.config/rox.sourceforge.net/ROX-Filer/globicons is responsible for icon control for individual files.
| Code: | #!/bin/sh
FILE="/root/somefile"
ICON="/usr/local/lib/X11/pixmaps/pupnews48.png"
head -n -1 /root/.config/rox.sourceforge.net/ROX-Filer/globicons > /tmp/globicons
cat >> /tmp/globicons << EOF
<rule match="$FILE">
<icon>$ICON</icon>
</rule>
</special-files>
EOF
rm -f /root/.config/rox.sourceforge.net/ROX-Filer/globicons
cp -f /tmp/globicons /root/.config/rox.sourceforge.net/ROX-Filer/
|
|
|
Back to top
|
|
 |
RSH

Joined: 05 Sep 2011 Posts: 1564 Location: Germany
|
Posted: Thu 26 Apr 2012, 01:08 Post_subject:
|
|
| stu90 wrote: | Hi RSH
Looks like /root/.config/rox.sourceforge.net/ROX-Filer/globicons is responsible for icon control for individual files.
| Code: | #!/bin/sh
FILE="/root/somefile"
ICON="/usr/local/lib/X11/pixmaps/pupnews48.png"
head -n -1 /root/.config/rox.sourceforge.net/ROX-Filer/globicons > /tmp/globicons
cat >> /tmp/globicons << EOF
<rule match="$FILE">
<icon>$ICON</icon>
</rule>
</special-files>
EOF
rm -f /root/.config/rox.sourceforge.net/ROX-Filer/globicons
cp -f /tmp/globicons /root/.config/rox.sourceforge.net/ROX-Filer/
|
|
I did test it using the following edition of your script:
| Code: | #!/bin/sh
FILE="/root/SFS-RunScripts/LP2_AudioStudio.sfs.Scripts/LP2_AudioStudio.sfs.audacity.run.sh"
ICON="/root/SFS-RunScripts/LP2_AudioStudio.sfs.Scripts/audacity.png"
head -n -1 /root/.config/rox.sourceforge.net/ROX-Filer/globicons > /tmp/globicons
cat >> /tmp/globicons << EOF
<rule match="$FILE">
<icon>$ICON</icon>
</rule>
</special-files>
EOF
rm -f /root/.config/rox.sourceforge.net/ROX-Filer/globicons
cp -f /tmp/globicons /root/.config/rox.sourceforge.net/ROX-Filer/ |
and it does work without any complain!
Thank you very much, stu90. This will help a lot, to make my actual work usable in a very comfortable way. Short Story: i did wrote an application, that creates run-scripts from programs inside sfs-files. If i do click a run-script, it runs the program - if the sfs is not loaded, it loads the sfs. If the sfs needs another sfs, it loads all needed sfs-files. If all needed sfs-files are loaded, it runs the program. Now i can set an icon automatically to the run-script and if i move it on the desktop, it shows me the related icon.
Wonderful, great, thank you very much again.
_________________ Useful Software for Puppy!
LazY Puppy - a Paradise Puppy! - DE & EN ISO 2.0.2-0.0.5 available
|
|
Back to top
|
|
 |
seaside
Joined: 11 Apr 2007 Posts: 841
|
Posted: Thu 26 Apr 2012, 10:33 Post_subject:
|
|
RSH,
You might find this useful-
| Code: | sed -i ' s|</special-files>||' /root/.config/rox.sourceforge.net/ROX-Filer/globicons
echo ' <rule match="/my/application/name">
<icon>/usr/local/lib/X11/pixmaps/icon-name.png</icon>
</rule>
</special-files>' >>/root/.config/rox.sourceforge.net/ROX-Filer/globicons |
Cheers,
s
|
|
Back to top
|
|
 |
|
|
|
Rules_post_cannot Rules_reply_cannot Rules_edit_cannot Rules_delete_cannot Rules_vote_cannot You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|
[ Time: 0.0544s ][ Queries: 12 (0.0140s) ][ GZIP on ] |