SFStray

Miscellaneous tools
Message
Author
seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

SFStray

#1 Post by seaside »

Lately, I've been starting all my SFS programs on the fly from a hidden top tray in JWM utilizing SFS-exec.

SFStray provides a Gui to pick any of your sfs files from a screen on the left, click "Add" which places your pick over to the right screen.The right screen contains the items for the hidden top of the screen tray menu, click Apply and SFStray will automatically find the icon and exec, make a new config file and restart JWM. Now, the hidden top tray will contain icons and names of the programs. When clicked, the SFS file will be unioned and the program immediately started. When the program is closed, the SFS file will be automatically unmounted.

As usual, the SFS file must have a single /usr/share/applications/*.desktop file and contain an icon somewhere under the /usr directory. If SFStray can't find an icon, a blue X will appear in the tray, the program name will be there, and the program can still be started.

The SFStray icon on the left is to edit the /root/.jwmrc-tray-sfs config file, in case any changes are necessary by hand.

When SFStray is started, it looks for .sfs files on all mounted partitions, resulting in a time lag and many sfs files already in use.
EDIT[: Changed to only look in /root and /mnt
directories if no specific SFS directory is given

Best to start the program with where your .sfs files are located - SFStray /my/sfs-files/dir or you can change the /usr/share/applications/SFStray.desktop file by editing the "Exec=SFStray" entry to "Exec=SFStray /my/sfs-files/dir"

Here's a pic and pet.
(You don't need SFS-exec, as a modified version is included - should work on most puppys with JWM)

EDIT: July 24, 2011 - changed to add error check

Cheers,
s
Attachments
SFStray.pet
(4.37 KiB) Downloaded 777 times
SFStray.png
SFStray GUI
(29.25 KiB) Downloaded 1800 times
Last edited by seaside on Sun 24 Jul 2011, 15:42, edited 3 times in total.

User avatar
maxerro
Posts: 53
Joined: Sun 10 Oct 2010, 16:11

#2 Post by maxerro »

I really don't want to sound ungrateful - especially in this field of program experimentation, because I think that perfecting the On-The-Fly loading/unloading of SFS files is what Puppy needs to break trough as the best Linux distro (regardless of what anyone says about root privileges).

What I would like to have is actually a combo of the speed of mounting/unmounting that your SFSExec has, and a simple-that-couldnt-be-simpler interface one click or one command-line away that SFS-Load-on-the-fly has.

What would be my ideal SFSLoading app is actually a program that has to be started from the command line with an obligatory user specified directory (no searching whatsoever), just displaying a dialog that's got unmounted SFSs listed on the left and mounted SFSs listed on the right. It can reside in tray, but has to respond to commands from the terminal, and at the moment of "loading" an SFS - a separate option has to be included to do a menu refresh or any type of further execution, by default it would just mount/unmount the SFS.

Does this make any sense?

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: SFStray

#3 Post by L18L »

seaside wrote:...
- should work on most puppys with JWM)
Sorry, not working on my wary512 :(

Code: Select all

# ls -l /mnt/home
lrwxrwxrwx 1 root root 20 2011-06-22 22:01 /mnt/home -> /initrd/mnt/dev_save
Attachments
SFStray.png
(29.38 KiB) Downloaded 1766 times

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#4 Post by seaside »

maxerro wrote:
What would be my ideal SFSLoading app is actually a program that has to be started from the command line with an obligatory user specified directory (no searching whatsoever), just displaying a dialog that's got unmounted SFSs listed on the left and mounted SFSs listed on the right. It can reside in tray, but has to respond to commands from the terminal, and at the moment of "loading" an SFS - a separate option has to be included to do a menu refresh or any type of further execution, by default it would just mount/unmount the SFS.

Does this make any sense?
maxerro,

SFStray /your/sfs/dir from the command-line shows you the SFS files available for placing in a top JWM tray and then executing the programs "on the fly" in the tray.

I'm not sure what other commands from the terminal you might be interested in performing then, and what other action to be taken.

Cheers,
s

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

Re: SFStray

#5 Post by seaside »

L18L wrote:
seaside wrote:...
- should work on most puppys with JWM)
Sorry, not working on my wary512 :(

Code: Select all

# ls -l /mnt/home
lrwxrwxrwx 1 root root 20 2011-06-22 22:01 /mnt/home -> /initrd/mnt/dev_save
L18L,

Unfortunately, without a specific directory at startup, it looks everywhere and finds too many .sfs files .

Best to start with SFStray /some/dir/with/your/sfs/files and limit what it finds.

Cheers,
s

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#6 Post by nooby »

you suggests
/some/dir/with/your/sfs/files
But what is the most likely thing to write there?
Can you give example how it looks on your side?

I tested a lot of things there and non work for me.

I am Quirky now and that is rather close to puppy431
I use Google Search on Puppy Forum
not an ideal solution though

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: SFStray

#7 Post by L18L »

seaside wrote:Best to start with SFStray /some/dir/with/your/sfs/files and limit what it finds.
I have made a directory sfs containing symlinks to some sfs files and startet from command line.

Code: Select all

SFStray $HOME/sfs
Yes that is the way to use it.

# chmod 755 /usr/bin/SFStray
and inserting
[ "`whoami`" != "root" ] && exec sudo -A ${0} ${@}
near top of /usr/bin/SFStray
made it usable for unprivileged user fido :idea:

Thank you.

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#8 Post by seaside »

nooby wrote:you suggests
/some/dir/with/your/sfs/files
But what is the most likely thing to write there?
Can you give example how it looks on your side?

I tested a lot of things there and non work for me.

I am Quirky now and that is rather close to puppy431
nooby,

I have most of my sfs files on this partition "/mnt/sdb6".
So I just use the command "SFStray /mnt/sdb6".

Also as L18L does, I put any others as a link to /mnt/sdb6 so that it's included.

Regards,
s

Jasper

#9 Post by Jasper »

Hi seaside et al,

I'm using SFS-Exec with my frugal installation of Lucid Puppy 5.2.5 on my hard drive.

My SFS folder is available on my desktop (which includes SFS absolute links from another partition) and has as an icon as does SFS-Unloader.

I only use JWM and loading/unloading SFS files is really fast so I never bother to update my JWM menu for SFS items.

I can even upgrade Firefox and Thunderbird "SFS files" (and rename them with current version numbers) though that does seem to use a lot of save-file space (and perhaps the updates would not be conducive to absolute links since it seems extra non-SFS files are made).

SFS files are also a superb addition to MultiPup (from puppyluvr and CatDude).

I am delighted with SFS-Exec even without this latest addition of SFStray which I don't personally need.

My regards

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#10 Post by seaside »

Jasper wrote:Hi seaside et al,


I am delighted with SFS-Exec even without this latest addition of SFStray which I don't personally need.

My regards
Thanks jasper,

Actually, I'm using both. For SFS files that I use regularly, I put them in SFStray and for those others not used as often, SFS-Exec. The advantage of SFStray is that the SFS file is automatically unmounted when the program is closed.

Regards,
s

User avatar
maxerro
Posts: 53
Joined: Sun 10 Oct 2010, 16:11

my sfsexe version

#11 Post by maxerro »

OK, I'm gonna list several options and program responses, because if I put it on paper maybe I'll find out that it makes no sense...
This would be my theoretical "sfsexe" program:

Code: Select all

#sfsexe
sfsexe v0.0 NOT loaded
Usage: sfsexe [OPTIONS] [DIR] [SFS]

Options:
  -a, --add=DIR          Add a new directory to the list of available SFSs
  -r, --remove=DIR     Remove directory from the list of available SFSs
  -l, --load=SFS          Load a specified SFS 
  -u, --unload=SFS      Unload a specified SFS
  -w, --window            Opens a loading/unloading dialog window
  -m, --menu-refresh   This is self-explanatory
  -e, --execute=FILE   Executes a specified .desktop file from the SFS, or if started without parameters - checks if there's only one .desktop file in the SFS and executes it

Code: Select all

#sfsexe -a /mydir
sfsexe v0.0 LOADED
List of available directories:
/mydir
No SFS files loaded
This would just mount the sfs without the menu refresh or any execution:

Code: Select all

#sfsexe -l mysfs
sfsexe v0.0 LOADED
List of available directories:
/mydir
List of loaded SFS files:
mysfs
This would mount it, put it in the menu and try to execute a myprog.desktop in the SFS:

Code: Select all

#sfsexe -l -m mysfs -e myprog

Code: Select all

#sfsexe -w
...would bring a window (which could also be started by clicking on a tray icon) that would now show a list of SFSs from the /mydir in the left pane and a loaded mysfs in the right pane.

Now if I'd say:

Code: Select all

#sfsexe -a /mydir2
sfsexe v0.0 LOADED
List of available directories:
/mydir
/mydir2
List of loaded SFS files:
mysfs

#sfsexe -l mysfsfromdir2
sfsexe v0.0 LOADED
List of available directories:
/mydir
/mydir2
List of loaded SFS files:
mysfs
mysfsfromdir2

#sfsexe -u mysfs
sfsexe v0.0 LOADED
List of available directories:
/mydir
/mydir2
List of loaded SFS files:
mysfsfromdir2

#sfsexe -w 
...would open a window (or refresh the one already opened) that would have a list of merged files from /mydir and /mydir2 in the left pane and a loaded mysfsfromdir2 in the right pane.

...and so on... well, it doesn't look too stupid... I don't have time for this, so thanks guys for listening - I was just talking to myself... :x

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#12 Post by nooby »

I do love SFS-Exec very much and even talk about it when I have the chance to spread the good news that there is something faster and easier to use than the other SFS loaders .

But this tray thing was a core to understand on my very low level of doing computer.

I have finally make it works now so edited this super long file and see the final result below this entry
Last edited by nooby on Fri 24 Jun 2011, 15:33, edited 1 time in total.
I use Google Search on Puppy Forum
not an ideal solution though

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#13 Post by nooby »

I am finally there. Phew that was difficult and I have no idea how I managed to do it but I did a lot of trial and error experiments and suddenly it almost works. All of these programs that I wanted to have loads and unloads and works too and I have the icons now so looks good.


Here is how the .jwmrc-tray-sfs file looks like now

Code: Select all

<JWM>
 <Tray autohide="true" insert="right" valign="top" halign="center" height="36" >
  <TrayButton popup="Edit tray" icon="tedit.png">exec:geany /root/.jwmrc-tray-sfs</TrayButton>
   <TrayButton popup="Opera" icon="/usr/share/pixmaps/opera-browser.png">exec:sfs-launchTray /initrd/mnt/dev_save/sfsfiles/opera-11.10-2081.i386opt.sfs</TrayButton>
  <TrayButton popup="Chromium" icon="/usr/share/pixmaps/chromium.png">exec:sfs-launchTray /initrd/mnt/dev_save/sfsfiles/chromium12.0.703.0-77939w5.sfs</TrayButton>
  <TrayButton popup="Google_Earth" icon="googleearth.png">exec:sfs-launchTray /initrd/mnt/dev_save/sfsfiles/Google_Earth-5.1.sfs</TrayButton>
  <TrayButton popup="LMMS" icon="/usr/share/pixmaps/lmms.png">exec:sfs-launchTray /initrd/mnt/dev_save/sfsfiles/lmms_0.4.8-1.sfs</TrayButton>
  <TrayButton popup="VirtualBox" icon="VBox.png">exec:sfs-launchTray /initrd/mnt/dev_save/sfsfiles/VirtualBox-4.0.2-L1.sfs</TrayButton>
  
  <TrayButton popup="" icon="nil.png">exec:</TrayButton>
  </Tray>
</JWM>
Edit correction to the above.

Opera had them here
/opt/opera/share/icons/hicolor/48x48/apps/opera-browser.png

But that is gone when you reboot so I took that one and moved it to
/usr/share/pixmaps/opera-browser.png So I did get get opera going and find it in opera and then borrow that one.


the sfstray_list looks like this
Opera
Chromium
Google_Earth
LMMS
VirtualBox
I dearly hope that it helps others that fail to follow the first instructions.

I am on Lupu513 but in reality it is Snow puppy 5 but I trust it works on Lupu 525 too. If it does not do tell me and I try to figure out that one too.
Last edited by nooby on Sat 25 Jun 2011, 06:58, edited 3 times in total.
I use Google Search on Puppy Forum
not an ideal solution though

User avatar
maxerro
Posts: 53
Joined: Sun 10 Oct 2010, 16:11

#14 Post by maxerro »

... and now I have to apologize for triggering all sorts of unwanted behavior ...

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#15 Post by nooby »

maxerro wrote:... and now I have to apologize for triggering all sorts of unwanted behavior ...
I have to apolgize for not getting what seaside described in the first posts but what I did above at least show a possible way for us who are computer challenged.

My workaround do work with imported icons from internet for 4 of the 5 progs. I placed them here

/usr/share/pixmaps/

so in the it looks like this

<TrayButton popup="Chromium" icon="/usr/share/pixmaps/chromium.png">exec:sfs-launchTray /initrd/mnt/dev_save/sfsfiles/chromium12.0.703.0-77939w5.sfs</TrayButton>
<TrayButton popup="LMMS" icon="/usr/share/pixmaps/lmms.png">exec:sfs-launchTray /initrd/mnt/dev_save/sfsfiles/lmms_0.4.8-1.sfs</TrayButton>
<TrayButton popup="VirtualBox" icon="VBox.png">exec:sfs-launchTray /initrd/mnt/dev_save/sfsfiles/VirtualBox-4.0.2-L1.sfs</TrayButton>
VBox already existed on the computer so I linked to that one where it already existed.

To each their own way. I did it my way :)
I use Google Search on Puppy Forum
not an ideal solution though

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

Re: my sfsexe version

#16 Post by seaside »

maxerro wrote:OK, I'm gonna list several options and program responses, because if I put it on paper maybe I'll find out that it makes no sense...
This would be my theoretical "sfsexe" program:

Code: Select all

#sfsexe
sfsexe v0.0 NOT loaded
Usage: sfsexe [OPTIONS] [DIR] [SFS]

Options:
  -a, --add=DIR          Add a new directory to the list of available SFSs
  -r, --remove=DIR     Remove directory from the list of available SFSs
  -l, --load=SFS          Load a specified SFS 
  -u, --unload=SFS      Unload a specified SFS
  -w, --window            Opens a loading/unloading dialog window
  -m, --menu-refresh   This is self-explanatory
  -e, --execute=FILE   Executes a specified .desktop file from the SFS, or if started without parameters - checks if there's only one .desktop file in the SFS and executes it
maxerro,

Thanks for that further explanation. I think you're looking for a kind of SFS file manager. Most of these functions can be handled by rox or other filemangers.

For examples;

Add or remove files or directories. (rox)
Mount an SFS (rox left-click)
List of sfs files in a directory (SFS-exec-dir)
Unmount an SFS (rox left-click)
Union and execute an SFS (SFS-Exec on rox-right-click)
ununion (SFS-exec-unloader).

This idea is interesting....
"Executes a specified .desktop file from the SFS, or if started without parameters - checks if there's only one .desktop file in the SFS and executes it"

My view of SFS files is that they contain only one large program that you'd prefer not to install. Perhaps an SFS file composed of several programs might be useful with some sort of interface to select one. Let me think about that.

Cheers,
s
(Good ideas can also be placed on electronic forum paper :) )

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#17 Post by seaside »

nooby wrote:
My workaround do work with imported icons from internet for 4 of the 5 progs. I placed them here

/usr/share/pixmaps/
nooby,

Glad you got it working and yes SFStray tries to find the icon in the SFS file, but doesn't always have success due to either a missing icon or an unusual location. So sometimes you'll need to find an icon yourself, modify the tray config file (as you did) and then copy the file to /usr/share/pixmaps so that JWM can find the icon.

You mentioned that 4 out of the 5 programs were missing icons and you had to get them from the internet - was that because the icons were not in the SFS files?

Regards,
s

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#18 Post by nooby »

I did not know or knew enough how to find them. I will edit my description above.

Opera had them here
/opt/opera/share/icons/hicolor/48x48/apps/opera-browser.png

But that is gone when you reboot so I took that one and moved it to
/usr/share/pixmaps/opera-browser.png

so now it looks like icon="/usr/share/pixmaps/opera-browser.png">
in the code. The icons may be there in all of them and me was not aware of how to find them. Still are not. :) Linux to me is like a very difficult CrossWord, one guess and guess and only hit the right solution after years of frustration.
I use Google Search on Puppy Forum
not an ideal solution though

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#19 Post by seaside »

nooby,

I took a look at the opera sfs file and found it had 6 icon choices in 6 different directories.

This confused SFStray and when that happens she gives up.

The code could be modified to take the first found icon like this - around line 54 of SFStray change the following:

Code: Select all

 
PROGICON=`find /mnt/"$P"/ -iname $PROGICON`
to this line

Code: Select all

 
PROGICON=`find /mnt/"$P"/ -iname $PROGICON -print -quit`
Let me know if that improves it for other sfs files as well.

(Of course, you may not like the icon size it finds and end up editing the config tray file anyway :)

Regards,
s

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#20 Post by nooby »

Thanks the most needed improvement maybe would be to figure out what one are supposed to tell it so it does not find all the lupu525.sfs and wary511.sfs and puppy-431.sfs and many many others and the most confusing thing was to see just dev_save and mnt and nothing else in the left field.

Not a single sfs file anyware.

One need to be rather savvy to figure out what to change after seeing that text for to to get it to work.

I spent hours on it and have no idea how I finally got progress and finally a kind of low level success to have a working system.

Not your fault it does work on your set up but totally failed on mine.

But I love that you tried though.
I use Google Search on Puppy Forum
not an ideal solution though

Post Reply