How to Start a Program from a Menu Entry when...
-
- Posts: 159
- Joined: Sun 01 Mar 2020, 16:17
How to Start a Program from a Menu Entry when...
Hi.
The title says it all - I think
I like to run programs without to install these programs, So, there's programs from .sfs files, RoxApps, AppImages etc.pp. But it's a bit uncomfortable to open external directories first to run a RoxApp or an AppImage. Smarter way is to run them just by a menu entry as it would work if these programs would be installed as usual. A .desktop file placed on the desktop would do it also.
Symbolic links will work fine unless the order of drives/partitions are changing when booting from different sources, like USB flash drives. In such cases the boot directory is not sda1 (as usual) and other partitions on the flash drive won't appear anymore as sda2, sda3 etc.pp.
So, in my LazY Puppies I've established some additional environment variables. It's content may change from time to time depending on where to boot the Puppy from (e.g. internal HD or USB flash drive)
E.g.: one environment variable is $MYPORTABLEAPPS.
In my 32bit LazY Puppy this would be e.g.:
- /mnt/sda1/PortableApplications
or in my 64bit LazY Puppy this would be:
- /mnt/sda1/PortableApplications64
Another environment variable is $MYROXAPPS.
Which currently is equal in my 32bit and 64bit LazY Puppy:
- /mnt/sda2/RoxApps
But when booting from USB flash drive this could be also:
- /mnt/sdc1/PortableApplications64
or even
/mnt/sdc2/RoxApps
for the RoxApps to run.
So, no matter what's the content of $MYPORTABLEAPPS I can run OpenShot-v2.5.1-x86_64.AppImage by a menu entry if the Exec= line looks like this:
Exec=sh -c "$MYPORTABLEAPPS/PortableLinux/Video/OpenShot-v2.5.1-x86_64.AppImage"
Or even for the RoxApp version:
Exec=sh -c "$MYROXAPPS/Video/OpenShot-v2.5.1-x86_64.AppImage"
Global environment variables can be defined e.g. in /etc/profile or /etc/profile.local. They need to be exported.
E.g.: export MY_GLOBAL_EV_VAR=PathToTheProgamOrDirectory
The title says it all - I think
I like to run programs without to install these programs, So, there's programs from .sfs files, RoxApps, AppImages etc.pp. But it's a bit uncomfortable to open external directories first to run a RoxApp or an AppImage. Smarter way is to run them just by a menu entry as it would work if these programs would be installed as usual. A .desktop file placed on the desktop would do it also.
Symbolic links will work fine unless the order of drives/partitions are changing when booting from different sources, like USB flash drives. In such cases the boot directory is not sda1 (as usual) and other partitions on the flash drive won't appear anymore as sda2, sda3 etc.pp.
So, in my LazY Puppies I've established some additional environment variables. It's content may change from time to time depending on where to boot the Puppy from (e.g. internal HD or USB flash drive)
E.g.: one environment variable is $MYPORTABLEAPPS.
In my 32bit LazY Puppy this would be e.g.:
- /mnt/sda1/PortableApplications
or in my 64bit LazY Puppy this would be:
- /mnt/sda1/PortableApplications64
Another environment variable is $MYROXAPPS.
Which currently is equal in my 32bit and 64bit LazY Puppy:
- /mnt/sda2/RoxApps
But when booting from USB flash drive this could be also:
- /mnt/sdc1/PortableApplications64
or even
/mnt/sdc2/RoxApps
for the RoxApps to run.
So, no matter what's the content of $MYPORTABLEAPPS I can run OpenShot-v2.5.1-x86_64.AppImage by a menu entry if the Exec= line looks like this:
Exec=sh -c "$MYPORTABLEAPPS/PortableLinux/Video/OpenShot-v2.5.1-x86_64.AppImage"
Or even for the RoxApp version:
Exec=sh -c "$MYROXAPPS/Video/OpenShot-v2.5.1-x86_64.AppImage"
Global environment variables can be defined e.g. in /etc/profile or /etc/profile.local. They need to be exported.
E.g.: export MY_GLOBAL_EV_VAR=PathToTheProgamOrDirectory
Hi O.F.I.N.S.I.S.,
I suspect you've stumbled into a variation of the problem I sought advice about here, http://www.murga-linux.com/puppy/viewto ... 70#1049970. I didn't follow up employing pedido's advice, so don't know if it would actually work.
You might pm jrb. I think he worked on a similar problem recently.
I suspect you've stumbled into a variation of the problem I sought advice about here, http://www.murga-linux.com/puppy/viewto ... 70#1049970. I didn't follow up employing pedido's advice, so don't know if it would actually work.
You might pm jrb. I think he worked on a similar problem recently.
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
@ O.F.I.N.S.I.S (or RSH, or LazYPuppY....take your pick! Gordon Bennett, Dieter, why do you keep changing your Forum "handle"? It gets bloody confusing for the rest of us, y'know.... )
I digress.... A-hem!
I had a similar problem myself some time ago. I found jafadmin's 'Udev-rules-wizard' fixed the problem for me, but from the other end; rather than assigning variables, it "stabilizes" your external mount-points so they effectively become 'absolute', rather than 'relative'. Hence, you can easily set up standard MenuEntries, although I like to make 'em call a launch script in /root/my-applications/bin rather than calling them direct; allows for a bit more 'flexibility' if you want to change things, without needing to reset with a 'fixmenus' every time.
http://murga-linux.com/puppy/viewtopic. ... 1d862f88d0
I don't use it anymore, for the simple reason that the Seagate external desktop drive I was using (on a USB 3.0 connection) got "cannabilized" (removed the plastic outer casing and the USB to SATA 'bridge card'), and it's now doing duty as a secondary internal drive in this new HP tower via its standard SATA3 connector instead. But it's damned effective, and very simple to use & to set-up.
Just a thought, you understand. You've already come up with one solution; perhaps this might be worth a look, too.
Mike.
I digress.... A-hem!
I had a similar problem myself some time ago. I found jafadmin's 'Udev-rules-wizard' fixed the problem for me, but from the other end; rather than assigning variables, it "stabilizes" your external mount-points so they effectively become 'absolute', rather than 'relative'. Hence, you can easily set up standard MenuEntries, although I like to make 'em call a launch script in /root/my-applications/bin rather than calling them direct; allows for a bit more 'flexibility' if you want to change things, without needing to reset with a 'fixmenus' every time.
http://murga-linux.com/puppy/viewtopic. ... 1d862f88d0
I don't use it anymore, for the simple reason that the Seagate external desktop drive I was using (on a USB 3.0 connection) got "cannabilized" (removed the plastic outer casing and the USB to SATA 'bridge card'), and it's now doing duty as a secondary internal drive in this new HP tower via its standard SATA3 connector instead. But it's damned effective, and very simple to use & to set-up.
Just a thought, you understand. You've already come up with one solution; perhaps this might be worth a look, too.
Mike.
-
- Posts: 159
- Joined: Sun 01 Mar 2020, 16:17
Uh, this is going to be a very long post.
Hi Mike Walsh.
First when I entered the forum and being RSH for a long time, I made a mistake when changing my password. I couldn't reproduce it and the forum function to receive the password (and/or to activate an account) didn't work on my mail address. So I couldn't log in anymore being RSH.
I just can't recall what happened to my LazY Puppy account and why I couldn't login anymore.
To join the forum being ITSMERSH was possible only, because of rockedge created an email address for me after I got in contact to smokey01 by mail telling about the impossibilities to create a new account by the use of several german email providers. Never received the activation mail.
After I was banned being ITSMERSH, sequentially I visited the forum from time to time and found the problem still exists, keeps new members from joining the forum. So, I gave hotmail.com (someone mentioned hotmail.com in a post) a try to find out and this did work immediately. Meanwhile all user names I'd tried were not longer usable. So I created O.F.I.N.S.I.S. (Our Future Is Not Set In Stone).
The story of "leaving the forum" when I was ITSMERSH by asking Flash for being banned should be known by forum members. So, no need to dig into this again.
No need to write O.F.I.N.S.I.S. all the time - just call me RSH or Rainer.
***
Yes, I know about the UDEV thingy by jafadmin. That's pretty good if one wants to have a static mount point for a specific USB flash drive and/or USB hard drive.
At my home computers my LazY Puppies are installed onto the internal hard drive - usually to sda1. But on my computers e.g. at my girlfriends home or in my rehearsal room I'm booting from USB drives. So, on these computers my boot drive changes to /mnt/sdc1 or /mnt/sde1.
The UDEV thingy is not usable then.
***
All my drives that is used to boot from generally do have three primary partitions plus one swap partition. At the beginning my boot partition was formatted to FAT32. Though, FAT32 can't store RoxApps. So, RoxApps won't work by clicking the directory. That's why I started to give a 2nd partition to my boot drive formatted to ext. Later I added the 3rd partition also formatted to ext.
I think it was sc0ttman one day who came up with the menu pipes in openbox. These menu pipes gave possibilities to have external scripts, files, RoxApps and some more within the openbox menu. So, I could start my RoxApps and scripts just by the menu.
I examined the code and created scripts to create menu pipes for JWM, as I was tired each time switching to openbox wm and editing all the files of openbox to have a menu equal like in JWM by default.
***
Since I'm using my LazY Puppies without save files or save directories in general from the beginning, I searched for a solution to have my 3 partitions known by the system, similar like /mnt/home when using a save file or directory.
So, I created a script which is examining /etc/rc.d/PUPSTATE and builds a file where some information is stored like the boot partition. Since my drives where to boot from do have 3 partitions I named them:
Boot Partition
Parallel Partition 1
Parallel Partition 2
Which nowadays is sym-linked at boot to /mnt/home, /mnt/home2 and /mnt/home3.
In the early stages I used the created file containing that information to have easy access to directories on these 2 parallel partitions. Later I made them environment variables, so when I'm entering echo $MYBOOTPRT into a terminal it returns e.g.: /mnt/sda1 or even /mnt/sde1 etc - depending on where to boot from.
Entering echo $MYBOOTDIR into a terminal returns e.g. /mnt/sda1/ArtStudio64 for my own build of BionicPup64.
During the years of development I expanded the use of environment variables.
Here's the terminal output when I'm entering $MY into the terminal and then hit TAB two times.
After this I invented the LazY Puppy Scripting Library. So, I'm also using FUNCTIONS as environment variables.
Here's the terminal output when I'm entering psl into the terminal and then hit TAB two times.
Example: psl_getdrivefrompath /mnt/sdc3/Images/Testimage.png returns the following:
All scripts from this LazY Puppy Scripting Library are stored at $MYROXAPPS/RSH or even $MYRSHROXAPPS. They are loaded at bootup from automated generated code echoed into /etc/profile.local.user (which is called after /etc/profile.local).
So, my all LazY Puppies know their working environment which gives me easy and immediate access to all my external files, programs and scripts.
JUST BY CLICKING A MENU ENTRY!
Either by the default (but extended JWM) menu or by the menu pipes.
To store settings of programs like e.g. Geany I'm doing a right-click onto /root/.config/geany, choosing Store to S.I.N. and it stores the directory /root/.config/geany within my N.E.M.E.S.I.S. directory, which is a sub-directory at $MYBOOTDIR. Then it sym-links it back to /root/.config/geany. S.I.N. is a short form of Store In NEMESIS.
The Store to S.I.N. function is a RoxApp created automatically at boot.
Haha, even though this is just a short description and short listing of what I can do by running my LazY Puppies without save files/folders, I'm just hoping this wasn't too much confusing.
Environment variables are very, very useful!
EDIT:
Hi Mike Walsh.
First when I entered the forum and being RSH for a long time, I made a mistake when changing my password. I couldn't reproduce it and the forum function to receive the password (and/or to activate an account) didn't work on my mail address. So I couldn't log in anymore being RSH.
I just can't recall what happened to my LazY Puppy account and why I couldn't login anymore.
To join the forum being ITSMERSH was possible only, because of rockedge created an email address for me after I got in contact to smokey01 by mail telling about the impossibilities to create a new account by the use of several german email providers. Never received the activation mail.
After I was banned being ITSMERSH, sequentially I visited the forum from time to time and found the problem still exists, keeps new members from joining the forum. So, I gave hotmail.com (someone mentioned hotmail.com in a post) a try to find out and this did work immediately. Meanwhile all user names I'd tried were not longer usable. So I created O.F.I.N.S.I.S. (Our Future Is Not Set In Stone).
The story of "leaving the forum" when I was ITSMERSH by asking Flash for being banned should be known by forum members. So, no need to dig into this again.
No need to write O.F.I.N.S.I.S. all the time - just call me RSH or Rainer.
***
Yes, I know about the UDEV thingy by jafadmin. That's pretty good if one wants to have a static mount point for a specific USB flash drive and/or USB hard drive.
At my home computers my LazY Puppies are installed onto the internal hard drive - usually to sda1. But on my computers e.g. at my girlfriends home or in my rehearsal room I'm booting from USB drives. So, on these computers my boot drive changes to /mnt/sdc1 or /mnt/sde1.
The UDEV thingy is not usable then.
***
All my drives that is used to boot from generally do have three primary partitions plus one swap partition. At the beginning my boot partition was formatted to FAT32. Though, FAT32 can't store RoxApps. So, RoxApps won't work by clicking the directory. That's why I started to give a 2nd partition to my boot drive formatted to ext. Later I added the 3rd partition also formatted to ext.
I think it was sc0ttman one day who came up with the menu pipes in openbox. These menu pipes gave possibilities to have external scripts, files, RoxApps and some more within the openbox menu. So, I could start my RoxApps and scripts just by the menu.
I examined the code and created scripts to create menu pipes for JWM, as I was tired each time switching to openbox wm and editing all the files of openbox to have a menu equal like in JWM by default.
***
Since I'm using my LazY Puppies without save files or save directories in general from the beginning, I searched for a solution to have my 3 partitions known by the system, similar like /mnt/home when using a save file or directory.
So, I created a script which is examining /etc/rc.d/PUPSTATE and builds a file where some information is stored like the boot partition. Since my drives where to boot from do have 3 partitions I named them:
Boot Partition
Parallel Partition 1
Parallel Partition 2
Which nowadays is sym-linked at boot to /mnt/home, /mnt/home2 and /mnt/home3.
In the early stages I used the created file containing that information to have easy access to directories on these 2 parallel partitions. Later I made them environment variables, so when I'm entering echo $MYBOOTPRT into a terminal it returns e.g.: /mnt/sda1 or even /mnt/sde1 etc - depending on where to boot from.
Entering echo $MYBOOTDIR into a terminal returns e.g. /mnt/sda1/ArtStudio64 for my own build of BionicPup64.
During the years of development I expanded the use of environment variables.
Here's the terminal output when I'm entering $MY into the terminal and then hit TAB two times.
Code: Select all
root# $MY
$MYARDOURUNLIMITEDRAM $MYBOOTPRT $MYMNTHOMELINKS $MYRSHSCRIPTBOX
$MYARUNCLIPIT $MYCLIPBOARDDIR $MYMODULES $MYSARASCRIPTBOX
$MYARUNDESKREFRESH $MYCOPYFILESINTOOS $MYMOUSEACCEL $MYSAVEONEXITGUI
$MYARUNDESKUPDATE4VARIOMENU $MYCURSORTHEME $MYMOUSETHRESHOLD $MYSCREENSAVERDELAY
$MYARUNDESKWINMANAGER $MYDESKTOPICONS $MYNEMAUTOSTARTLIST $MYSCREENSAVERFLAG
$MYARUNDOCKBARX $MYDRIVEICONS $MYNEMDIR $MYSCRIPTS
$MYARUNDUNST $MYFILES $MYNEMRAPPDIR $MYSLEEPTIME
$MYARUNFIREWALLSTATUS $MYGLOBALFONTSIZE $MYNUMLOCKOPT $MYSTARTUPVMGROUP
$MYARUNFLSYNCLIENT $MYGLOBSETSDIR $MYPAR1PRT $MYSYMLINKSINLIST
$MYARUNFREEMEMAPPLET $MYICONPARTITIONS $MYPAR2PRT $MYSYMLINKSOUTLIST
$MYARUNLAZYTOM $MYICONPLACEEDGEGAP $MYPCONFIG $MYTIMEZONE
$MYARUNLIBTOPMENU $MYICONPLACEORIENTATION $MYPERSONALSETTINGSPOPUP $MYTOPLESSAPPKIOSK
$MYARUNNETMONWCE $MYICONPLACESPACING $MYPORTABLEAPPS $MYTRASHDIR
$MYARUNNETWORKTRAY $MYICONPLACESTARTGAP $MYPSLDIR $MYTTFREEMEMPARTITIONS
$MYARUNOBDPAGER $MYICONTHEME $MYPSLIB $MYVMGROUPWALLPAPERS
$MYARUNPARCELLITE $MYINTMODULES $MYPSLIBDIR $MYWALLPAPER
$MYARUNPMCPUTEMP $MYJWMAUTOHIDETRAY $MYRFPICONSIZE $MYWELCOMEFIRSTBOOT
$MYARUNPOWERAPPLET $MYJWMONTOPTRAY $MYROXAPPS $MYWINDOWMANAGER
$MYARUNRETROVOL $MYLABELPARTITIONS $MYRSHINTROXAPPS $MYWINEAPPS
$MYARUNWATCHPROCESSES $MYLINUXAPPS $MYRSHROXAPPS $MYWPDIR
$MYAUTOMATEDLINKS $MYLOCALTIME $MYRSHROXAPPS2 $MYXFETRASHDIR
$MYAUTOSTARTAPPS $MYLOOPDEVICES $MYRSHROXAPPS3
$MYAUTOSTARTFROMLIST $MYLPED $MYRSHROXAPPS4
$MYBOOTDIR $MYLPEDCONFIG $MYRSHROXAPPS5
root# $MY
Here's the terminal output when I'm entering psl into the terminal and then hit TAB two times.
Code: Select all
root# psl
Display all 111 possibilities? (y or n)
psl_1stucase psl_getappcategory psl_getwp psl_noext psl_setwinpos
psl_all1stucase psl_getappcomment pslib psl_noextbn psl_setwinsize
psl_all1stucasers psl_getappexec psl_icon2script psl_okmsg psl_setwp
psl_backupinitrd psl_getappgenname psl_imageviewer psl_okmsg1 psl_slideshow
psl_bin2morse psl_getappicon psl_info psl_okmsg2 psl_soft_wallpapers
psl_cleaninitrd psl_getappicon4gtk psl_initwingeo psl_opendir psl_sortlist
psl_cleansfsbackup psl_getappname psl_jwmpiperefresh psl_qr psl_sound
psl_cleantemp psl_getcfgfile psl_launcher psl_quickpoweroff psl_soundrec
psl_cleantmp psl_getcfgfileprefix psl_legend psl_quickreboot psl_spacereplace
psl_cleantopless psl_getdrivefrompath psl_lp2prefix psl_recordx2avi psl_stoprec
psl_combobox psl_getdriveonly psl_makerunscript psl_replace psl_strlcase
psl_date psl_getfirstchar psl_mdselect psl_savewinsize psl_strlen
psl_date4filename psl_getfreedrivemem psl_mfselect psl_screenframe psl_strucase
psl_deskrefresh psl_getinputsource psl_midiconnect psl_screenh psl_text2bin
psl_dev psl_getlineswitch psl_mkgettext psl_screenshot psl_time
psl_development psl_getlp2prefix psl_mkmenu psl_screenw psl_tree
psl_dirdir psl_getmntpath psl_mkmenutreewidget psl_setdesktop psl_wincenter
psl_drivelist psl_getpuprodir psl_mkprj2menu psl_setinputsource psl_xdte
psl_edit psl_getvar psl_mkprjmenu psl_setlineswitch psl_yesno
psl_errmsg psl_getvolume psl_mksvgbutton psl_setmcvolume
psl_extonly psl_getwingeo psl_mksvgguihead psl_setvmgroup
psl_fixmenus psl_getwinpos psl_mylang psl_setvolume
psl_funcs psl_getwinsize psl_mypup psl_setwingeo
root# psl
Code: Select all
root# psl_getdrivefrompath /mnt/sdc3/Images/Testimage.png
sdc3
root#
So, my all LazY Puppies know their working environment which gives me easy and immediate access to all my external files, programs and scripts.
JUST BY CLICKING A MENU ENTRY!
Either by the default (but extended JWM) menu or by the menu pipes.
To store settings of programs like e.g. Geany I'm doing a right-click onto /root/.config/geany, choosing Store to S.I.N. and it stores the directory /root/.config/geany within my N.E.M.E.S.I.S. directory, which is a sub-directory at $MYBOOTDIR. Then it sym-links it back to /root/.config/geany. S.I.N. is a short form of Store In NEMESIS.
The Store to S.I.N. function is a RoxApp created automatically at boot.
Haha, even though this is just a short description and short listing of what I can do by running my LazY Puppies without save files/folders, I'm just hoping this wasn't too much confusing.
Environment variables are very, very useful!
EDIT:
Done.You might pm jrb. I think he worked on a similar problem recently.
Our Future Is Not Set In Stone
[url]https://www.youtube.com/channel/UCyfyaxCNMduwyXlQFRQKhhQ[/url]
[url]https://soundcloud.com/user-633698367[/url]
[b]My own build of Bionic64[/b]
[url]https://www.youtube.com/channel/UCyfyaxCNMduwyXlQFRQKhhQ[/url]
[url]https://soundcloud.com/user-633698367[/url]
[b]My own build of Bionic64[/b]
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
Morning, Rainer. (Sorry; I couldn't quite remember your name....I thought it was 'Dieter'. )
Yes, I remember most of the 'saga' now you mention it. As you say, no need to go into it all again. And I definitely remember all that business with rockedge providing you with a 'custom' email addy.
We thought we'd lost you for a while! But, as it turns out, we hadn't....
I agree, variables are useful, though I'm still slowly getting the hang of them myself. A case of "Softly, softly, catchee monkee...", methinks. I'll get my head round 'em eventually....
Mike.
Yes, I remember most of the 'saga' now you mention it. As you say, no need to go into it all again. And I definitely remember all that business with rockedge providing you with a 'custom' email addy.
We thought we'd lost you for a while! But, as it turns out, we hadn't....
I agree, variables are useful, though I'm still slowly getting the hang of them myself. A case of "Softly, softly, catchee monkee...", methinks. I'll get my head round 'em eventually....
Mike.
Paraphrasing, "A rosebush by any other name will still have thorns".
As a result of naming conventions used by different ethnic groups, languages used for record keeping in what had been the Russian Empire, spelling conventions and how different groups vocalize them, immigration to the US and my mother's preference, over the course of his life my dad was known by six names having, at a minimum, different vocalizations. When asked what his name was, he would often respond: "I don't care what you call me as long as it isn't late for dinner."
At any rate, glad you're back under any name.
As a result of naming conventions used by different ethnic groups, languages used for record keeping in what had been the Russian Empire, spelling conventions and how different groups vocalize them, immigration to the US and my mother's preference, over the course of his life my dad was known by six names having, at a minimum, different vocalizations. When asked what his name was, he would often respond: "I don't care what you call me as long as it isn't late for dinner."
At any rate, glad you're back under any name.
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
^^^ +1.mikeslr wrote:Paraphrasing, "A rosebush by any other name will still have thorns".
As a result of naming conventions used by different ethnic groups, languages used for record keeping in what had been the Russian Empire, spelling conventions and how different groups vocalize them, immigration to the US and my mother's preference, over the course of his life my dad was known by six names having, at a minimum, different vocalizations. When asked what his name was, he would often respond: "I don't care what you call me as long as it isn't late for dinner."
At any rate, glad you're back under any name.
T'other Mike.
Re: How to Start a Program from a Menu Entry when...
Hi Rainer, I don't know whether you've solved this problem or not but I thought I would mention how I have dealt with it. In my Portabrowsers, which I no longer pursue owing to Mike Walsh's excellent and prolific Portable pursuits, I used the UUID of the disk or partition to identify where the application is installed and launch it using that information.O.F.I.N.S.I.S. wrote:/mnt/sda2/RoxApps
But when booting from USB flash drive this could be also:
- /mnt/sdc1/PortableApplications64
or even
/mnt/sdc2/RoxApps
for the RoxApps to run.
I'll use Palemoon-27.9.4SSE portable installer as my example as it is the simplest of my creations only giving a choice of one browser.
I use an install script, /usr/local/bin/PalemoonSSEinstall, (abbreviated here):
Code: Select all
#choose drive
echo "What drive would you like to install PalemoonPortable on? eg: sda3"
read DRVNM
#mount drive
mkdir /mnt/$DRVNM > /dev/null 2>&1
mount /dev/$DRVNM /mnt/$DRVNM > /dev/null 2>&1
#switch to drive
cd /mnt/$DRVNM
#identify Palemoon drive placement by uuid in case of flashdrive installs
rm /usr/local/bin/pmUUID > /dev/null 2>&1
echo /bin/bash > /usr/local/bin/pmUUID
sed -i 's|/bin/bash|#!/bin/bash|g' /usr/local/bin/pmUUID
chmod +x /usr/local/bin/pmUUID
UUIDPM2=`blkid /dev/$DRVNM | cut -d " " -f 2`
echo $UUIDPM2 >> /usr/local/bin/pmUUID
sed -i 's/"//g' /usr/local/bin/pmUUID
sed -i 's/UUID/UUIDPM/g' /usr/local/bin/pmUUID
Then I have a Launch file, /usr/local/bin/pmportable_launch in this case.
Code: Select all
#!/bin/sh
if [ -e /usr/local/bin/pmUUID ]; then
. /usr/local/bin/pmUUID
DRVNM=`blkid | grep -e $UUIDPM | cut -d "/" -f 3- | cut -d ":" -f -1`
echo $DRVNM
mount /dev/${DRVNM} /mnt/${DRVNM} > /dev/null 2>&1
if [ -e /mnt/$DRVNM/$PMDIR/palemoon ]; then
cd /mnt/$DRVNM/$PMDIR
/mnt/$DRVNM/$PMDIR/pm.sh "$@"
else
/usr/local/bin/PalemoonSSEinstall
fi
else
/usr/local/bin/PalemoonSSEinstall
fi
I hope this is of some use to you or anyone else interested.
Cheers, J
PS, If you want to look at the full scripts download palemoon_portainstall-27.9.4SSE-0.4.pet and have a look.
-
- Posts: 159
- Joined: Sun 01 Mar 2020, 16:17
Yes, that's funny!"I don't care what you call me as long as it isn't late for dinner."
@ The Mike's
Thank you for liking my return.
@jrb
Yes, I solved everything by the use of environment variables. Makes my Puppy-Live and Development much easier.
Thanks for those examples about the UUID thingy. May have a look at this later.
Our Future Is Not Set In Stone
[url]https://www.youtube.com/channel/UCyfyaxCNMduwyXlQFRQKhhQ[/url]
[url]https://soundcloud.com/user-633698367[/url]
[b]My own build of Bionic64[/b]
[url]https://www.youtube.com/channel/UCyfyaxCNMduwyXlQFRQKhhQ[/url]
[url]https://soundcloud.com/user-633698367[/url]
[b]My own build of Bionic64[/b]
-
- Posts: 159
- Joined: Sun 01 Mar 2020, 16:17
No, it doesn't. I tested it on my xWallpaper-GUI-3 which is a RoxApp in /mnt/sda2/RoxApps/RSH. It also doesn't work from within its directory trying to execute the scripts AppRun or xWallpaper-GUI-3.musher0 wrote:Hello O.F.I.N.S.I.S.
...
You open a console in the directory,
you type the name of the app, and
you hit the Enter key.
Works every time.
...
It only seems to work every time on programs that being installed and can be found in $PATH:
Code: Select all
root# echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/root/my-applications/bin:/usr/games
root#
Also: my intention was to run these external programs easily without to first browse their directories.
Sorry, to proof you wrong!
- Attachments
-
- Screenshot(3).png
- (16.73 KiB) Downloaded 14 times
-
- Screenshot(2).png
- (17.13 KiB) Downloaded 17 times
-
- Screenshot.png
- (12.89 KiB) Downloaded 15 times
Our Future Is Not Set In Stone
[url]https://www.youtube.com/channel/UCyfyaxCNMduwyXlQFRQKhhQ[/url]
[url]https://soundcloud.com/user-633698367[/url]
[b]My own build of Bionic64[/b]
[url]https://www.youtube.com/channel/UCyfyaxCNMduwyXlQFRQKhhQ[/url]
[url]https://soundcloud.com/user-633698367[/url]
[b]My own build of Bionic64[/b]
In console typeO.F.I.N.S.I.S. wrote:No, it doesn't. I tested it on my xWallpaper-GUI-3 which is a RoxApp in /mnt/sda2/RoxApps/RSH. It also doesn't work from within its directory trying to execute the scripts AppRun or xWallpaper-GUI-3.musher0 wrote:Hello O.F.I.N.S.I.S.
...
You open a console in the directory,
you type the name of the app, and
you hit the Enter key.
Works every time.
...
It only seems to work every time on programs that being installed and can be found in $PATH:Look at the attached images.Code: Select all
root# echo $PATH /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/root/my-applications/bin:/usr/games root#
Also: my intention was to run these external programs easily without to first browse their directories.
Sorry, to proof you wrong!
Code: Select all
./program
your external disc to the PATH in the /etc/profile file
E.g.
Code: Select all
PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/opt/local/bin:/root/my-applications/bin:/usr/games:/mnt/sda1/blabla/bin"
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
-
- Posts: 159
- Joined: Sun 01 Mar 2020, 16:17
@musher0
Yes,
works for my example above.
But that's just too many terminals opened. When I want to run a program I don't want to run a program plus a terminal to start it.
And: it's still too far from my intention to run external programs easily without to browse directories first. My solution using environment variables is working very well and makes my Puppy life and development much easier - without having multiple terminals opened.
Also: avoiding the terminal to start a program will avoid killing the program when accidentally closing the wrong terminal.
***
Adding the external disc to /etc/profile doesn't make any sense as this drive could be sda2 and next time on another computer sdc2 or even sde2. Looks like you didn't read my posts completely.
Yes,
Code: Select all
./AppRun
But that's just too many terminals opened. When I want to run a program I don't want to run a program plus a terminal to start it.
And: it's still too far from my intention to run external programs easily without to browse directories first. My solution using environment variables is working very well and makes my Puppy life and development much easier - without having multiple terminals opened.
Also: avoiding the terminal to start a program will avoid killing the program when accidentally closing the wrong terminal.
***
Adding the external disc to /etc/profile doesn't make any sense as this drive could be sda2 and next time on another computer sdc2 or even sde2. Looks like you didn't read my posts completely.
Our Future Is Not Set In Stone
[url]https://www.youtube.com/channel/UCyfyaxCNMduwyXlQFRQKhhQ[/url]
[url]https://soundcloud.com/user-633698367[/url]
[b]My own build of Bionic64[/b]
[url]https://www.youtube.com/channel/UCyfyaxCNMduwyXlQFRQKhhQ[/url]
[url]https://soundcloud.com/user-633698367[/url]
[b]My own build of Bionic64[/b]
Sincere condoleances on the death of your terminal.O.F.I.N.S.I.S. wrote:@musher0
Yes,works for my example above.Code: Select all
./AppRun
But that's just too many terminals opened. When I want to run a program I don't want to run a program plus a terminal to start it.
And: it's still too far from my intention to run external programs easily without to browse directories first. My solution using environment variables is working very well and makes my Puppy life and development much easier - without having multiple terminals opened.
Also: avoiding the terminal to start a program will avoid killing the program when accidentally closing the wrong terminal.
How many years do you get in Germany for "accidentally" killing a terminal?
But seriously:
you work things your way, and that's fine.
I'm not wrong for working things another way.
BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
-
- Posts: 159
- Joined: Sun 01 Mar 2020, 16:17
Yes, I understand this, I can accept this and I don't want to convert anyone doing things my way.I'm not wrong for working things another way.
So, did I wrote or made some statements similar to this?
When?
Where?
I can't recall such statement of mine. Just presented an example of one way on how to run external programs via the .desktop file either from menu or desktop button/icon - which is far more quick than browsing directories and opening a terminal first.
I can move to Gudensberg directly, which is 26Km from my home or even the other direction around the planet which is 26Km plus some 40.000Km.
Jrb is using the UUID thingy to have a static identification of external drives, which seems to be also a direct move to Gudensberg.
By the way: there wasn't a death of the terminal. The program's being killed when closing the wrong terminal by accident. It's different...
Our Future Is Not Set In Stone
[url]https://www.youtube.com/channel/UCyfyaxCNMduwyXlQFRQKhhQ[/url]
[url]https://soundcloud.com/user-633698367[/url]
[b]My own build of Bionic64[/b]
[url]https://www.youtube.com/channel/UCyfyaxCNMduwyXlQFRQKhhQ[/url]
[url]https://soundcloud.com/user-633698367[/url]
[b]My own build of Bionic64[/b]