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 Wed 21 Nov 2018, 04:04
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How To Make A Lazy Puppy Style Menu?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [7 Posts]  
Author Message
FUD

Joined: 01 Jul 2017
Posts: 10

PostPosted: Sat 06 Jan 2018, 05:15    Post subject:  How To Make A Lazy Puppy Style Menu?  

Hi,

I'm trying to add the finishing touches to my puppy by setting up a 'Lazy Puppy' style menu to access SFS files from the DVD. (32 bit tahrpup-6.0.5-PAE on a 32 bit Dell)

Now that my all my SFS's are done and I'm putting all the pieces back together on the DVD and I'm unable to get the menu/script to work properly.

Thought I already had this issue resolved previously on a different puppy. Not so, my (human) memory isn't what it used to be I guess.

This involves using 'simple-run-script-d.sh' to set up a Lazy Puppy style menu that does it all: when menu item is clicked it mounts the DVD, loads the program, and unloads when closed.

One program loads fine, the other doesn't. Below is a video that shows the problem better than I could explain it.

https://www.screencast.com/t/qCZMTgQPFH

Not sure what I'm missing? Something not in *.menu? Name changes done on the script? Or needs a script mod?

* All SFS programs now reside on the DVD in a folder in this format:
* /mnt/sr0/SFS/name_of_program.sfs
* Scripts are in /usr/local/bin/
* Fixmenus works properly.

If it's a relatively easy fix I would go ahead and finish it up. If not I wouldn't bother with it and will just access the programs manually from the DVD.

It wouldn't have the Lazy flair to it but it'll do.

Any suggestion I could try? Thanks.

If not then I'll finish this puppy up by using everyone's tips and sit back in my rocking chair and play with my puppy. It's that time. Very Happy

Last edited by FUD on Sat 06 Jan 2018, 21:11; edited 1 time in total
Back to top
View user's profile Send private message 
Sailor Enceladus

Joined: 22 Feb 2016
Posts: 1547

PostPosted: Sat 06 Jan 2018, 14:00    Post subject:  

So simple screen option works but Filezilla doesn't? Hard to know the problem without being able to see what Filezilla entry in /usr/share/applications opens and what is happening inside the script in it's Exec= line (if it's a script like simple-run-script-d.sh).
Back to top
View user's profile Send private message 
FUD

Joined: 01 Jul 2017
Posts: 10

PostPosted: Sat 06 Jan 2018, 20:48    Post subject:  

Hi Sailor, thanks for your response.

Contents of /usr/share/applications/FileZilla.desktop

[Desktop Entry]
Encoding=UTF-8
Name=FileZilla
Icon=/usr/share/pixmaps/frisbee.png
Comment=FileZilla
Exec=/usr/local/bin/simple-run-script-f.sh
Terminal=false
Type=Application
Categories=Onthefly
GenericName=FileZilla

............

Contents of simple-run-script-f.sh (this is a simple-run-script-d.sh renamed because I couldn't add both to /usr/local/bin)

# Define Names of SFS File and Program to load and to run
NameOfProg="FileZilla"
NameOfSFS="/mnt/sr0/SFS/FileZilla_3906_6.0.5.sfs"
#NameOfSFS="FileZilla_3906_6.0.5.sfs"

# Not here ! ! !
BNameOfSFS="`basename $NameOfSFS`"

.............

* Click SFS file on sr0 works
* Click on filezilla.desktop and it mounts sr0 but program does not load.
* Click on script in /usr/local/bin/ mounts sr0 but does not load.

Thanks for your help.
Back to top
View user's profile Send private message 
FUD

Joined: 01 Jul 2017
Posts: 10

PostPosted: Sat 06 Jan 2018, 21:01    Post subject:  

Full code:

#!/bin/bash -a
#------------------------------------------------------------------------------
# Basic RunScript, first step of the LazY Puppy SFS P.L.U.S. RunScripts
# Edition No. 4 for the murga forum users to use this on cd/dvd/hd/usb
# 2012-12-07 RSH for (LazY) Puppy Linux
#------------------------------------------------------------------------------
# Note: adding the path to the sfs name increases the speed of loading a sfs
#------------------------------------------------------------------------------

# Define Names of SFS File and Program to load and to run
NameOfProg="FileZilla"
NameOfSFS="/mnt/sr0/SFS/FileZilla_3906_6.0.5.sfs"
#NameOfSFS="FileZilla_3906_6.0.5.sfs"

# Not here ! ! !
BNameOfSFS="`basename $NameOfSFS`"

#------------------------------------------------------------------------------
# Create AutoUnload Script Function
# Do not change anything in this here section ! ! !
# But you can modify 'sleep 2' to what's your like
#------------------------------------------------------------------------------
# Create AutoUnload Script
function CreateAutoUnloadScript(){
# Check if Program runs
ProgRuns=echo $(`pidof "$NameOfProg"`)
if [ "$ProgRuns" != "" ]; then
echo '#!/bin/bash
AutoUnload="true"
#ProgRuns=echo $(`pidof "'$NameOfProg'"`)
while [ "$AutoUnload" = "true" ];
do
#ProgRuns=echo $(`pidof "'$NameOfProg'"`)
if [ "`pidof "'$NameOfProg'"`" != "" ]; then
echo "'$NameOfProg' is still running"
sleep 2
else
sfs_load --unload --cli --skip-fixmenus --quiet "'$NameOfSFS'"
AutoUnload="false"
fi
done
echo "SFS unloaded and AutoUnload exited"
exit 0'> /tmp/$BNameOfSFS.AutoUnload.sh
chmod 755 /tmp/$BNameOfSFS.AutoUnload.sh
fi # if [ "$ProgRuns" != "" ]; then
}
#------------------------------------------------------------------------------
# End of create AutoUnload Script Function
#------------------------------------------------------------------------------

# '$NameOfProg' might need the path if not in /usr/bin or /usr/sbin
# If Program exits then go
if [ "$(which $NameOfProg)" ]; then
# Execute Program
exec "$NameOfProg" &
else # Program doesn't exist ---> do load the SFS first
# Load the SFS
sfs_load --cli --skip-fixmenus --quiet "$NameOfSFS"
# Execute Program
exec "$NameOfProg" &
CreateAutoUnloadScript
# Execute AutoUnload Script ---> runs in background
/tmp/$BNameOfSFS.AutoUnload.sh
# Remove AutoUnload Script
rm /tmp/$BNameOfSFS.AutoUnload.sh
fi # if [ "$(which $NameOfProg)" ]; then

exit 0

#------------------------------------------------------------------------------
# End of simple-run-script-c ---> This is so cool, isn't it?
#------------------------------------------------------------------------------
Back to top
View user's profile Send private message 
CatDude


Joined: 03 Jan 2007
Posts: 1571
Location: UK

PostPosted: Sun 07 Jan 2018, 07:43    Post subject:  

Hi

@ FUD

Try changing this:
Code:
NameOfProg="FileZilla"


to this:
Code:
NameOfProg="filezilla"


CatDude
.

_________________

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

Joined: 01 Jul 2017
Posts: 10

PostPosted: Sun 07 Jan 2018, 22:25    Post subject:  

CatDude,

Thanks for your eyes! Your suggestion did work and FileZilla now loads properly.

Just to clarify, should anyone need it, the thread title was meant to be a question not a statement. The missing ? was an oversight on my part and "all my SFS's" = the ones I needed from archive and the few that I made for myself.

Gotta start somewhere. If my experimenting, trial, and error causes me to murder some file names in the process I'll have to live with myself. If I wanted to see an original file name I would only need to look below at Simple Scan.

Thanks for everyones time on this, I appreciate it.
Back to top
View user's profile Send private message 
FUD

Joined: 01 Jul 2017
Posts: 10

PostPosted: Thu 11 Jan 2018, 11:08    Post subject:  

Here is a working example of this script.

https://www.screencast.com/t/GjmaAvmqYgT

Key Points
* From the SFS files on the archive, some work straight away others will/may not end up working.
* For your own files you will need the LP2_ prefix as part of your file name.
* It may be easier to take a .pet file and run it through 'pets2sfsgui'.
* Trimming off the excess from a file name sometimes helps.
* Example: LibreOffice-4.4.1_en-GB_xz.pet becomes LP2_LibreOffice-4.4.1_ (pets2sfsgui adds your version number here).sfs

Are there other/better ways to do it? There always are but this does all I need it to. It auto unloads the SFS about 99% of the time and works fine. But you can rest assured that at least one of the programs you use every day will be the one that decides not to auto-unload. Surprised
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [7 Posts]  
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.0646s ][ Queries: 14 (0.0285s) ][ GZIP on ]