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
How to set an Icon for a Script using Bash?
How to set an Icon for a Script using Bash?
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
Hi RSH
Looks like /root/.config/rox.sourceforge.net/ROX-Filer/globicons is responsible for icon control for individual files.
Looks like /root/.config/rox.sourceforge.net/ROX-Filer/globicons is responsible for icon control for individual files.
Code: Select all
#!/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:stu90 wrote:Hi RSH
Looks like /root/.config/rox.sourceforge.net/ROX-Filer/globicons is responsible for icon control for individual files.
Code: Select all
#!/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/
Code: Select all
#!/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/
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.
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
RSH,
You might find this useful-
Cheers,
s
You might find this useful-
Code: Select all
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
s