Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 27 Nov 2014, 04:17
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How to set an Icon for a Script using Bash?
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: 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

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send_private_message 
stu90


Joined: 25 Feb 2010
Posts: 1401
Location: England. Dell Inspiron 1501. Dpup

PostPosted: 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
View user's profile Send_private_message 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: 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! Very Happy

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. Very Happy

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send_private_message 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: 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
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

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.0536s ][ Queries: 12 (0.0069s) ][ GZIP on ]