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 Tue 21 Oct 2014, 14:57
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Demo: icons appear automatically when sfs file is mounted
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
pakt


Joined: 04 Jun 2005
Posts: 1089
Location: Sweden

PostPosted: Mon 26 Mar 2007, 14:08    Post_subject:  Demo: icons appear automatically when sfs file is mounted  

Here is a simple idea for automatically adding desktop icons when mounting an app_xxx.sfs file. This is just a rough example of how it would work.

First I created a minimal test_202.sfs containing:

- OpenOffice icons in /usr/local/lib/X11/pixmaps/
- 'globicons-OOo' and 'PuppyPin-OOo' in /root/Choices/ROX-Filer/ containing the modified desktop files.

Then I modified rc.local0 with one line to run a new script I called rc.desktop which I added to /etc/rc.d/

rc.desktop contains:
Code:
#!/bin/sh

#add icons from application sfs file to Puppy desktop by using the PuppyPin &
#globicons files from the sfs file.
#PuppyPin-OOo & globicons-OOo are located in test_202.sfs
#(executed from rc.local0)

#create master files so original desktop icons can be restored
if [ ! -f /root/Choices/ROX-Filer/PuppyPin0 ];then
  cp -f /root/Choices/ROX-Filer/PuppyPin /root/Choices/ROX-Filer/PuppyPin0
fi 
if [ ! -f /root/Choices/ROX-Filer/globicons0 ];then
  cp -f /root/Choices/ROX-Filer/globicons /root/Choices/ROX-Filer/globicons0
fi 

if [ -d /usr/local/OOo-dir ];then #add icons from mounted sfs application
  cp -f /root/Choices/ROX-Filer/PuppyPin-OOo /root/Choices/ROX-Filer/PuppyPin
  cp -f /root/Choices/ROX-Filer/globicons-OOo /root/Choices/ROX-Filer/globicons
else #restore original desktop icons
  cp -f /root/Choices/ROX-Filer/PuppyPin0 /root/Choices/ROX-Filer/PuppyPin
  cp -f /root/Choices/ROX-Filer/globicons0 /root/Choices/ROX-Filer/globicons
fi


Now when I add 'test_202.sfs' to the same location as pup_202.3fs and reboot, the icons appear automatically on the desktop.

Paul
desktop.jpg
 Description   
 Filesize   43 KB
 Viewed   729 Time(s)

desktop.jpg


_________________
Testing Puppy since v0.9.2 - my desktop OS since v1.0.7
Running SlaxerPup-4.12 - Puppy with a Slackware 12.2 heart Cool
Back to top
View user's profile Send_private_message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Mon 26 Mar 2007, 21:18    Post_subject:  

Okay, I've added desktop icon updating to Puppy, and made it generic
to work for any SFS files. See News Blog:
http://www.puppyos.net/blog/comments.php?y=07&m=03&entry=entry070326-080421
Back to top
View user's profile Send_private_message Visit_website 
Nathan F


Joined: 08 Jun 2005
Posts: 1760
Location: Wadsworth, OH (occasionally home)

PostPosted: Mon 26 Mar 2007, 21:43    Post_subject:  

Cool, I'm just wondering about one or two small details now. One is basically whether or not there is any provision for making sure the icons don't overlap each other. Otherwise I can see things getting very messy. The other issue might be if a user decides they want to remove them. I'm hoping this doesn't just put them back every time the squashfile is mounted?

Nathan

_________________
Bring on the locusts ...
Back to top
View user's profile Send_private_message AIM YIM MSNM 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Mon 26 Mar 2007, 22:53    Post_subject:  

Doesn't that just copy a pre-set file over the current one? So any changes to the original would be lost until the sfs is removed? And it wouldn't work with multiple sfs files at once either.

Maybe there should be something like XDG, but for the desktop. Where it just loads any files in a certain place. Positioning would be the tricky part. It could be that the positioning data is optional. If you don't add any, it will place it wherever it's convenient.

Also, that would slightly complicate things if the user edits a "sfs" icon, creating a copy in the save-file. Unless there was a "temporary" tag inside it. Then it could do a if [ -e <whatever> ]; then <show icon>; fi where <whatever> is the app it's supposed to run.

Actually, that could apply to all of them, like how IceWM only shows entries for apps that are installed.

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send_private_message Visit_website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Tue 27 Mar 2007, 11:19    Post_subject:  

The code I posted merges the 'PuppyPin' and 'globicons' files. Duplicate lines in the merged PuppyPin are removed. It does not fix overlapping icons. For a 'openoffice.sfs', just create a PuppyPin and globicons with the OO icons only and make sure they are located on the desktop away from the others.

My code only regenerates PuppyPin and globicons files if the unionfs layers change. So, a user can customise the desktop, but if they change the layers, their customisation gets wiped. I currently don't know an elegant fix for this.
Back to top
View user's profile Send_private_message Visit_website 
e_mattis


Joined: 20 Dec 2012
Posts: 114
Location: Williamston, SC

PostPosted: Tue 29 Apr 2014, 16:29    Post_subject:  

Barry,

it's old hack, but I find i need this info again. the blog link above doesn't work. it that blog/page still around anywhere?
Back to top
View user's profile Send_private_message Visit_website 
e_mattis


Joined: 20 Dec 2012
Posts: 114
Location: Williamston, SC

PostPosted: Tue 29 Apr 2014, 16:31    Post_subject:  

Post sent twice - Sorry!
Back to top
View user's profile Send_private_message Visit_website 
666philb


Joined: 07 Feb 2010
Posts: 1771
Location: wales

PostPosted: Wed 30 Apr 2014, 10:31    Post_subject:  

hi e_mattis

what do you need this for?

_________________
Tahrpup, built with trusty tahr packages http://murga-linux.com/puppy/viewtopic.php?t=93998
Quickpet_Precise, install popular apps quickly http://www.murga-linux.com/puppy/viewtopic.php?t=83642
Back to top
View user's profile Send_private_message 
e_mattis


Joined: 20 Dec 2012
Posts: 114
Location: Williamston, SC

PostPosted: Wed 30 Apr 2014, 19:21    Post_subject:  

hey 666philb,

i'm putting together a "suite" of programs and I need the icon to appear when the .sfs is installed so you don't have to go searching files to run it the first time. Any ideas? Thanks!

E
Back to top
View user's profile Send_private_message Visit_website 
666philb


Joined: 07 Feb 2010
Posts: 1771
Location: wales

PostPosted: Fri 02 May 2014, 07:59    Post_subject:  

hi e_mattis,

the problem is that .sfs files don't run pinstall.sh scripts ..... if you where using a pet instead of an sfs it would be more straight forward.

one idea though is to use a .pet to install the sfs .... so you'ld install the pet and it would download the sfs .... load it ... and add a desktop icon/s .


a rough example of the pinstall.sh ...
Code:
#!/bin/sh
cd /root
rxvt -e wget http://dl.dropbox.com/u/148498739/google_earth-7_sfs4.sfs
`xmessage -name 'sfsload' -center -bg white -fg blue "please chose the move option from the sfs_loader"`
sfs_load /root/google_earth-7_sfs4.sfs

rox --RPC << EOF
<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
 <env:Body xmlns="http://rox.sourceforge.net/SOAP/ROX-Filer">
 <PinboardAdd>
   <Path>/usr/share/applications/google-earth.desktop</Path>
    <X>32</X>
    <Y>512</Y>
   <Label>googleearth</Label>
   </PinboardAdd>
</env:Body>
</env:Envelope>
EOF
test.pet
Description  an example to try
pet

 Download 
Filename  test.pet 
Filesize  658 Bytes 
Downloaded  70 Time(s) 

_________________
Tahrpup, built with trusty tahr packages http://murga-linux.com/puppy/viewtopic.php?t=93998
Quickpet_Precise, install popular apps quickly http://www.murga-linux.com/puppy/viewtopic.php?t=83642
Back to top
View user's profile Send_private_message 
e_mattis


Joined: 20 Dec 2012
Posts: 114
Location: Williamston, SC

PostPosted: Fri 02 May 2014, 21:24    Post_subject:  

hey 666philb,

tried the test.pet on a live-cd run of precise 5.7.1 but had no luck - got the desktop alert icon and name, copied into PuppyPin, but other than that, nope, no google earth. no modification to /root/.config/rox.sourceforge.net/ROX-Filer/globicons or /usr/bin. Maybe due to live cd - will try on frugal later.

This may be the route i'm looking for though, if I can figure out how to correctly assemble the pet and write the pinstall.sh script - working on that now.

Thanks !

E

UPDATE 050314:
@ 666philb,
i've still had no luck getting your script to run on my system (precise 5.7.1).

@ all
I've been searching and reading, and reading, and read...etc...to try and find out how to write a pinstall script that would add an entry to PuppyPin. I've found a lot of information, but none seems to pan out - simple as
Code:

#!/bin/bash
echo '<icon x="32" y="500" label="newLine">/directory/directory</icon>'

to some more sophisticated and involved than I really want to get. I di find something close done by rhadon back in 2013 for the swapicons project here:http://murga-linux.com/puppy/viewtopic.php?t=83829 but just haven't been able to wrap my head around how to add a single line in.

help?!?
Back to top
View user's profile Send_private_message Visit_website 
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Sun 04 May 2014, 03:36    Post_subject: Add a single line in PuppyPin
Sub_title: sed
 

e_mattis wrote:
@ all
I've been searching and reading, and reading, and read...etc...to try and find out how to write a pinstall script that would add an entry to PuppyPin. I've found a lot of information, but none seems to pan out - simple as
Code:

#!/bin/bash
echo '<icon x="32" y="500" label="newLine">/directory/directory</icon>'

to some more sophisticated and involved than I really want to get. I di find something close done by rhadon back in 2013 for the swapicons project here:http://murga-linux.com/puppy/viewtopic.php?t=83829 but just haven't been able to wrap my head around how to add a single line in.

help?!?


Seen in function desktop_icon of script set_LANGUAGE_and_lauch_app in Multiligual simultan :
Code:
  sed -i "s#</backdrop>#</backdrop>\n  <icon x=\"$SCREENx\" y=\"$SCREENy\" label=\"${LABEL}\">/usr/local/apps/setLanguage</icon>#" ${PUPPYPIN}
Hope that helps.
Back to top
View user's profile Send_private_message 
e_mattis


Joined: 20 Dec 2012
Posts: 114
Location: Williamston, SC

PostPosted: Sun 04 May 2014, 05:08    Post_subject:  

hey L18l!
Very Happy now you tell me Laughing

yea, it does help. I found this snippet on another post (don't remember which one) and was in mid-figure when I came back and saw your post.
Code:

#!/bin/sh
# LazY Puppy Run-Scripts Icon Setter
# set icon to a run-script # --> thanks to stu90
#------------------------------------------------------------------------------
FILE=$1
ICON=$2

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/globicons

# End


It helped me understand things better and how sed works. thanks to you and 666philb for the responses and assistance. I think I actually got a working .pet this time! But it's late here now, so I will test it tomorrow.

Thanks again! Smile

E
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Cutting edge
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.0881s ][ Queries: 12 (0.0041s) ][ GZIP on ]