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 Mon 15 Oct 2018, 19:50
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How to make sfs with app icon on desktop? (Solved)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [24 Posts]   Goto page: 1, 2 Next
Author Message
neerajkolte


Joined: 10 Feb 2014
Posts: 517
Location: Pune, India.

PostPosted: Sun 28 Dec 2014, 07:32    Post subject:  How to make sfs with app icon on desktop? (Solved)
Subject description: The sfs should place icon on desktop when loaded and remove it while unloading.
 

I made an opera-stable_26.0.1656.60_amd64.sfs for Fatdog.
It works ok.
Gives menu entry which I can drag and drop on desktop or quick launch.

I wanted to know is there any way I can make the sfs when loaded place an Icon on desktop or quick launch?

I looked at pinboard file but can't guess how to make sfs append to it.
May be some other way?
Thanks.

- Neeraj.

_________________
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson

“We tend to overestimate the effect of a technology in the short run and underestimate the effect in the long run.”
- Amara’s Law.

Last edited by neerajkolte on Wed 31 Dec 2014, 03:49; edited 2 times in total
Back to top
View user's profile Send private message 
solo


Joined: 14 Nov 2013
Posts: 390

PostPosted: Mon 29 Dec 2014, 10:34    Post subject:  

If I'm not mistaken, it's possible to execute a script when the sfs is being loaded, so yes, the script needs to append a line to PuppyPin.

I'm running Precise Puppy myself, so I could be wrong, but in my setup, the PuppyPin that needs to be changed is located in the /root/Choices/ROX-Filer/ folder.
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 12792
Location: Gatineau (Qc), Canada

PostPosted: Mon 29 Dec 2014, 10:35    Post subject:  

Hi, Neeraj.

You can't do it directly. I would suggest that you provide the user with a separate
script to do that once your sfs is loaded.

You must take the existing file at /root/Choices/ROX-Filer/PuppyPin and process it a
little with a script.

Something like this:

Prepare your opera icon and description in PuppyPin line syntax (see example in
before-last line in the attached pic)

You take the last line off PuppyPin (you store it in a temp file somewhere as well as
the edited PuppyPin)

You concatenate your opera line and then the final line to your temporary PuppyPin
into the new PuppyPin, and display it

Something like: (the following is stil rough, I know;
you'll have to do your own fine tuning!) Smile
Code:

#!/bin/sh
# /root/my-applications/bin/Add-icon-line-to-PuppyPin.sh
####
## variables
ROXF="/root/Choices/ROX-Filer"
cd $ROXF
Opera="  <icon x="640" y="1008" label="opera">opera</icon>"
# The above line probably needs to be checked to have the escape character
# inserted at the right places.
a="`wc -l /root/Choices/ROX-Filer/PuppyPin`"
# How many lines in PuppyPin. head (below) will need this number.

## Process
cp /root/Choices/ROX-Filer/PuppyPi
tail -n 1  /root/Choices/ROX-Filer/PuppyPin > /tmp/closing
b="`expr $a - 1 `"
head -n $b /root/Choices/ROX-Filer/PuppyPin > /tmp/main
echo "$Opera" >> /tmp/main
cat /tmp/closing >> /tmp/main

# Now I leave the last lines as remarks because you should make sure, in your
# editor, that your /tmp/main file has the proper PuppyPin syntax. ROX is pretty
# fussy about it. # Un-remark them when you're sure.

# cp -f /tmp/main $ROXF/PuppyPin

## display the new PuppyPin (refresh)

# rox -p=$ROXF/PuppyPin

# Even if you're already in /root/Choices/ROX-Filer folder (see first line), you still
# have to indcate the full path. By default, ROX would normally pick its PuppyPin
# up simply in /root. This is a Puppy set-up, remember?! :-)


I think that's it! Good luck!

BFN.

musher0
current-PuppyPin(1).jpg
 Description   
 Filesize   63.96 KB
 Viewed   503 Time(s)

current-PuppyPin(1).jpg


_________________
musher0
~~~~~~~~~~
Fidèle elle commença, ainsi elle restera. (Prov. canadien) /
Faithful she began, so will she stay. (Canadian prov.)
Back to top
View user's profile Send private message 
neerajkolte


Joined: 10 Feb 2014
Posts: 517
Location: Pune, India.

PostPosted: Mon 29 Dec 2014, 21:27    Post subject:  

Thank you both for replies.
@solo I will have to take a look at sfs loader script for that, which probably I won't understand, but I will try.

@musher thanks for the suggestion. I was thinking about the same thing, I will try.
But as the use has to do something himself. I was thinking about giving him desktop file direct so he could drag and place it anywhere.
Better yet, I also made an directory which I believe can be called an rox app.
It when clicked gives user opera browser window, on subsequent clicks adds tabs to existing window.
But on right click, it gives 2 options "New window" and "New Private window".
It also has opera Icon.
So I think I will supply user that and let him place it any where.

But first I will play with your suggestion.
Thanks again.

- Neeraj.

_________________
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson

“We tend to overestimate the effect of a technology in the short run and underestimate the effect in the long run.”
- Amara’s Law.
Back to top
View user's profile Send private message 
LazY Puppy


Joined: 21 Nov 2014
Posts: 2007
Location: Germany

PostPosted: Tue 30 Dec 2014, 06:07    Post subject:  

Hi.

Rox Filer has two built in commands to add desktop icons to the PuppyPin and/or to remove desktop icons from PuppyPin. It's easy to use.

Remove Desktop Icon:
Code:
<PinboardRemove>
<Path>/usr/local/RoxApp_Builder/Application_Starter/Multimedia</Path>
<Label>Multimedia</Label>
</PinboardRemove>


Add Desktop Icon:
Code:
<PinboardAdd>
<Path>/usr/local/RoxApp_Builder/roxapp_builder</Path>
<X>432</X>
<Y>538</Y>
<Label>RoxApp Builder</Label>
<Args></Args>
<Locked>true</Locked>
<Shortcut></Shortcut>
</PinboardAdd>

Just wrap the above examples -edited to fit to your needs- with this code:
Code:
#!/bin/bash
echo "<?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\">
... ... ...
</env:Body>
</env:Envelope>"  | rox -R

and create a executable script out of it.

Put the Script into the /root/Startup folder of your SFS and sfs_load should execute it after loading the SFS.

It's just that easy!

_________________
RSH

"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) Laughing

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! Wink
Back to top
View user's profile Send private message 
neerajkolte


Joined: 10 Feb 2014
Posts: 517
Location: Pune, India.

PostPosted: Tue 30 Dec 2014, 07:13    Post subject:  

Wow my friend,
I will try this as soon as I get near my machine and report back.
Thanks.

- Neeraj.

_________________
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson

“We tend to overestimate the effect of a technology in the short run and underestimate the effect in the long run.”
- Amara’s Law.
Back to top
View user's profile Send private message 
solo


Joined: 14 Nov 2013
Posts: 390

PostPosted: Tue 30 Dec 2014, 08:12    Post subject:  

Bookmarked!!! Smile
Back to top
View user's profile Send private message 
neerajkolte


Joined: 10 Feb 2014
Posts: 517
Location: Pune, India.

PostPosted: Tue 30 Dec 2014, 08:40    Post subject:  

Hi LazY Puppy,
I made the script to place Icon for my opera roxapp on desktop like
Code:
#!/bin/sh
echo "<?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/opera_rox_app/Opera</Path>
<X>432</X>
<Y>538</Y>
<Label>Opera</Label>
<Args></Args>
<Locked>true</Locked>
<Shortcut></Shortcut>
</PinboardAdd>
</env:Body>
</env:Envelope>"  | rox -R
in /root/Startup of my sfs.
When sfs is loaded it doesn't autorun..
When I click on the script while sfs is loaded, it does it's job beautifully.
I don't know why It doesn't autorun while loading.

I also made the script to remove Icon like
Code:
#!/bin/sh
echo "<?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\">
<PinboardRemove>
<Path>/usr/share/opera_rox_app/Opera</Path>
<Label>Opera</Label>
</PinboardRemove>
</env:Body>
</env:Envelope>"  | rox -R
It also works nicely.
But I am not sure how to incorporate it in the sfs and how to make it run before sfs get's unloaded.
Any suggestions I can try?
Thanks.

- Neeraj.

_________________
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson

“We tend to overestimate the effect of a technology in the short run and underestimate the effect in the long run.”
- Amara’s Law.
Back to top
View user's profile Send private message 
rufwoof

Joined: 24 Feb 2014
Posts: 2595

PostPosted: Tue 30 Dec 2014, 09:32    Post subject:  

OK so I created a new file and put "Be Happy" text into that file

Next I set the icon for that file to -> happy.xbm

ThenI created a script to

Add that program to the desktop
Sleep for a while
Remove that program from the desktop

Which after being made executable and when run the icon appears and I can click on it and it opens my leafpad text editor - and shows the "Be Happy" content - but I have to be quick otherwise the icon disappears.

Makes you wonder about all sorts of uses - instead of yafsplash etc. !!!

Thanks Lazy Puppy
Code:

#!/bin/bash
echo "<?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>/root/smile</Path>
<X>432</X>
<Y>538</Y>
<Label>Don't Worry</Label>
<Args></Args>
<Locked>true</Locked>
<Shortcut></Shortcut>
</PinboardAdd>
</env:Body>
</env:Envelope>"  | rox -R

sleep 5

echo "<?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\">
<PinboardRemove>
<Path>/root/smile</Path>
<Label>Don't Worry</Label>
</PinboardRemove>
</env:Body>
</env:Envelope>"  | rox -R
img.png
 Description   
 Filesize   74.14 KB
 Viewed   417 Time(s)

img.png

Back to top
View user's profile Send private message 
neerajkolte


Joined: 10 Feb 2014
Posts: 517
Location: Pune, India.

PostPosted: Tue 30 Dec 2014, 09:42    Post subject:  

ok the problem might be with fatdog's sfs loader script. I will post on fatdog's thread.
I tested the sfs in tahr64 it does give the icon. Opera doesn't work though, but that's for another day.

I am yet to find how to use the remove icon script.
Thanks

- Neeraj.

_________________
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson

“We tend to overestimate the effect of a technology in the short run and underestimate the effect in the long run.”
- Amara’s Law.
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1664

PostPosted: Tue 30 Dec 2014, 09:43    Post subject:  

FatDog has its own script for loading SFS files, it's /sbin/load_sfs.sh.
But it also has an autostart mechanism:
load_sfs.sh wrote:
# In addition to standard structure, Fatdog64 SFS stores some metadata in
# /tmp/sfs. This metadata isn't normally visible as /tmp is usually
# over-mounted and hidden by tmpfs.
# The metadata is:
# a) /tmp/sfs/autorun.sh - this is the load/unload script.
# This script will be run when the SFS is loaded/unloaded, with these:
# $1-event (load/unload/systemload/systemunload), $2-sfs aufs path.
# Autorun can be disabled, see DISABLE_AUTORUN below.
# b) /tmp/sfs/msg - this is the message that will be displayed when the SFS
# is loaded.

So, an examplary autostart script could look like this:
Code:
#!/bin/sh

case "$1" in
  load|systemload)
    # put your stuff here
  ;;
  unload|systemunload)
    # put your stuff here
  ;;
esac


The 'systemload' & 'systemunload' events are passed when load_sfs.sh is started with start or stop parameter, what takes place at boot.

But for you case only 'load' and 'unload' params are necessary, as you don't want to add the icon every time system boots and remove it every time system shuts down.
Btw, it woulnd't make sense anyway, because when load_sfs.sh gets executed at boot, there's no X and ROX running yet (if I'm correct), so 'rox -R' won't work.

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
trio


Joined: 21 Dec 2008
Posts: 2083
Location: अनुमोदना

PostPosted: Tue 30 Dec 2014, 09:47    Post subject:  

Quote:
The default is to load any suitable SFS files that are found at /mnt/home (same place as the 'pup_save' file). The BootManager, found in the System menu, enables you to change to whatever you want to load.
'openoffice-2.2.0.sfs' has /root/Choices/ROX-Filer/PuppyPin and globicons, also /etc/profile.d/openoffice.sh and these are enhancements that Puppy now recognises. The first two files specify desktop icons, and you should see these appear on the desktop when the SFS file loads, and if you choose not to load it then the icons should disappear.

_________________
My apps
Back to top
View user's profile Send private message 
LazY Puppy


Joined: 21 Nov 2014
Posts: 2007
Location: Germany

PostPosted: Tue 30 Dec 2014, 11:03    Post subject:  

Quote:
Btw, it woulnd't make sense anyway, because when load_sfs.sh gets executed at boot, there's no X and ROX running yet (if I'm correct), so 'rox -R' won't work.

You just could make the script (the one that adds the desktop icon) wait until X has appeared on the screen.

Something like:
Code:
while [ "`pidof X`" = "" ]; do
 sleep 1
done

or probably
Code:
while [ ! "$DISPLAY" ]; do
 sleep 1
done

Quote:
But I am not sure how to incorporate it in the sfs and how to make it run before sfs get's unloaded.
Any suggestions I can try?

You could also extend the script that adds the desktop icon. Add some code to echo out a second script that runs in background within a loop. Inside of the loop just check if the SFS is still loaded and let it sleep a few seconds if it is still loaded and before to check again for the SFS loaded.

If it is not loaded anymore, execute the script that removes the desktop icon.

Here you can find a example, how I did created this to unload a SFS automatically after the application is exited.

_________________
RSH

"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) Laughing

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! Wink
Back to top
View user's profile Send private message 
rufwoof

Joined: 24 Feb 2014
Posts: 2595

PostPosted: Tue 30 Dec 2014, 12:58    Post subject:  

LazY Puppy wrote:
You could also extend the script that adds the desktop icon. Add some code to echo out a second script that runs in background within a loop. Inside of the loop just check if the SFS is still loaded and let it sleep a few seconds if it is still loaded and before to check again for the SFS loaded.

If it is not loaded anymore, execute the script that removes the desktop icon.

Here you can find a example, how I did created this to unload a SFS automatically after the application is exited.

I like your load sfs/run app/unload sfs script Lazy Puppy.

Up to now, as I run with no savefile, I've opted to wrap sfs's within RoxApps, so that any changes to the sfs are preserved i.e. if you change mplayer options and when mplayer is in a sfs. But I've had it all as a one way street, where the sfs is loaded, but no unloading occurs (just remains resident and is quicker to start if restarted a 2nd or 3rd time).

i.e. menu or rox-app directory (file) clicked, rox app AppRun runs and deletes the puppy root/.config program configuration file and symbolic links the programs config file to a copy in the RoxApp directory, loads the sfs, runs the program.

There is a finite boundary at how many sfs's can be loaded, something like 255 I believe, so unloading when a program finishes is less likely to hit such limits. It also frees up memory for lower memory systems. Personally I get no where near that limit however as I've merged a number of sfs's into single sfs's (such as my multi-media sfs holding audacity, blender, openshot, x-vidcap ...etc).

My basic/core puppy is around 75MB and is just leafpad, gcalculator, CD/DVD tools and the basic Puppy desktop stuff (jwm config, remaster etc.). All the rest I load via sfs's (except for Firefox which I run as a portable app). Providing you don't store data inside puppy space but on HDD instead then there's little need for a savefile - just remaster whenever a infrequent change to the core puppy is desired. I've set remasterpup2 to use no compression so remastering is very quick. I then merge puppy sfs into initrd and compress that (i.e. only vmlinuz and initrd.gz needed to boot).

Here's a example for ooo4kids, a light version of Libre Office
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 11170

PostPosted: Tue 30 Dec 2014, 13:49    Post subject:  

Your uncompressed and all in one initrd will use all ram so I assume you have plenty rufwoof....how big do these initrd get?
I never merge sfs...all apps get their own ..some are just a few hundred k.... thing is I never get past say 40 loaded so not a worry of running out of loop devices assuming the full quota is enabled (it varies from pup to pup kernel) which is the real limit.
More likely you would fill up free tmpfs space loading the sfs to ram before then after which they will be running from source media...(assuming yer sfs loader is working properly...the one in lighthouse was not Very Happy )

Only time I do need to unload is when testing... (and I wish ROX would let go of the dam things in puppy Very Happy )

Seemed like one of those free for all threads so thought I'd join in since I use this geshinga Wink

mike
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [24 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1798s ][ Queries: 12 (0.0413s) ][ GZIP on ]