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 Sun 19 Nov 2017, 18:01
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Add A JWM Bookmarks Menu or Submenu/Messing Around With JWM
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 3 of 14 [201 Posts]   Goto page: Previous 1, 2, 3, 4, 5, ..., 12, 13, 14 Next
Author Message
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Mon 19 May 2014, 03:41    Post subject:  

Hi, MochiMoppel.

I think the problem is the mounting does not happen and if there is no already created mount point directory in /mnt it will error but I might be wrong.
It is too complicated for me to make it simpler but like this it should work in any case.
Code:
<Program label="MyMusicStick">
MYUUID="8346-747C"
DRIVE=$(echo `blkid -o device -t UUID="$MYUUID"` | sed /"$MYUUID"/'s/:.*$//;s/dev/mnt/')
mkdir $DRIVE
mount UUID="8346-747C" $DRIVE
rox $DRIVE
</Program>


Edit. Typo error in blkid line corrected.

_________________
Farewell, Nooby, you will be missed...

Last edited by saintless on Mon 19 May 2014, 05:58; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger 
greengeek


Joined: 20 Jul 2010
Posts: 4716
Location: Republic of Novo Zelande

PostPosted: Mon 19 May 2014, 04:50    Post subject:  

saintless wrote:

Code:
<Program label="MyMusicStick">
MYUUID="45B6-2F7F"
DRIVE=$(echo `blkid -l -o device -t UUID="$MYUUID"` | sed /"$MYUUID"/'s/:.*$//;s/dev/mnt/')
mkdir $DRIVE
mount UUID="45B6-2F7F" $DRIVE
rox $DRIVE
</Program>
This seems to open my root directory rather than the stick referred to by UUID. Should I have created a mnt point first or something? I will try a couple of other variations...

EDIT :What mount point would this be looking for? /mnt/music? or /mnt/sdx something?

Last edited by greengeek on Mon 19 May 2014, 05:21; edited 1 time in total
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 4716
Location: Republic of Novo Zelande

PostPosted: Mon 19 May 2014, 05:15    Post subject:  

As long as I create the /mnt/music directory first then this works:
Code:
<Program label="Music on Flash" icon="music24.png">
   mount UUID=45B6-2F7F /mnt/music
   rox /mnt/music
</Program>


I'm pretty happy with that, I think I could now set up a Places or Bookmarks entry in the menu and link straight to my external usb sticks in a more organised fashion. Thanks!
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1390
Location: Japan

PostPosted: Mon 19 May 2014, 05:32    Post subject:  

Saintless' code doesn't work for me either. No mounting Crying or Very sad

I have a better idea (keep fingers crossed!). Let's search for the device name (e.g. sdb1) of a given UUID and then run the same script as the desktop drive icons would run. If you click a drive icon of an unmouted device, the device gets mounted and ROX will run. Let's do the same:
Code:
<Program label="MyMusicStick">
UUID="F620E"
DRIVE=$(echo "`blkid`" | sed -n /"$UUID"/'s/:.*$//p' | sed 's|/dev/||')
/root/.pup_event/drive_$DRIVE/AppRun
</Program>

The drive icons also pass parameters (usbdrv vfat), which should be added to the last line if known, but things seem to be fine without them.

EDIT: @greengeek: Seeing you happy makes me happy Laughing By all means go for a simple solution and forget my cryptic stuff.

Last edited by MochiMoppel on Mon 19 May 2014, 05:44; edited 1 time in total
Back to top
View user's profile Send private message 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Mon 19 May 2014, 05:34    Post subject:  

Sorry, guys Sad Typo error while copying blkid line:

Code:
       <Program label="Music on Flash"   icon="usb16.xpm">
MYUUID="45B6-2F7F"
DRIVE=$(echo `blkid -o device -t UUID="$MYUUID"` | sed /"$MYUUID"/'s/:.*$//;s/dev/mnt/')
mkdir $DRIVE
mount UUID="45B6-2F7F" $DRIVE
rox $DRIVE
      </Program>

_________________
Farewell, Nooby, you will be missed...
Back to top
View user's profile Send private message MSN Messenger 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Mon 19 May 2014, 05:41    Post subject:  

greengeek wrote:
As long as I create the /mnt/music directory first then this works:
Code:
<Program label="Music on Flash" icon="music24.png">
   mount UUID=45B6-2F7F /mnt/music
   rox /mnt/music
</Program>


I'm pretty happy with that, I think I could now set up a Places or Bookmarks entry in the menu and link straight to my external usb sticks in a more organised fashion. Thanks!


Yes, Greengeek. I also will prefer the simple and 100% working solution as this one. The corrected code in my previous post (blkid line changed) should work well but I can't be sure it will in all cases.

_________________
Farewell, Nooby, you will be missed...
Back to top
View user's profile Send private message MSN Messenger 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Mon 19 May 2014, 05:45    Post subject:  

MochiMoppel wrote:
I have a better idea (keep fingers crossed!). Let's search for the device name (e.g. sdb1) of a given UUID and then run the same script as the desktop drive icons would run. If you click a drive icon of an unmouted device, the device gets mounted and ROX will run. Let's do the same:
Code:
<Program label="MyMusicStick">
UUID="F620E"
DRIVE=$(echo "`blkid`" | sed -n /"$UUID"/'s/:.*$//p' | sed 's|/dev/||')
/root/.pup_event/drive_$DRIVE/AppRun
</Program>

The drive icons also pass parameters (usbdrv vfat), which should be added to the last line if known, but things seem to be fine without them.

I'm far away down from the level of your codding skills, MochiMoppel. All I can do is to edit some scripts after reading help pages and create very simple scripts my self. I can test and try to find fixes but this is all I can do to help.

Edit: As it is the quoted script mounts pmount with all flashdrives for me to choose which one to mount.
But it also makes simpler version of what is working for me.
Greengeek, if you like to test try this last one from MochiMoppel. The mount point is not fixed and you do not need to create it. It changes depending what other flash drives are connected and should be (I hope) auto-created and auto-mounted from MyMusicStick-3 menu:
Code:
      <Program label="MyMusicStick-3">
UUID="45B6-2F7F"
DRIVE=$(echo "`blkid`" | sed -n /"$UUID"/'s/:.*$//p' | sed 's|/dev/||')
mkdir $DRIVE
mount UUID="45B6-2F7F" $DRIVE
rox $DRIVE
</Program>

_________________
Farewell, Nooby, you will be missed...
Back to top
View user's profile Send private message MSN Messenger 
musher0


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

PostPosted: Mon 19 May 2014, 08:38    Post subject:  

Hello, people !

The following little script will open the Puppy's "home", meaning: the folder in
/mnt/home where the main Puppy sfs is located. This partition is automatically
mounted at boot time, so it does not need to be mounted again.

Code:
#!/bin/sh
# /root/my-applications/bin/PUPSFSHOME.sh
# Purpose: To show any Puppy's "home" directory on /mnt/home/[something].
# (Not the user's "home", which is /root or ~.)
####
rox /mnt/home/`awk -F"/" '$1 ~ /PUPSFS/ { print $2 }' /etc/rc.d/PUPSTATE`


Then you can add it to the jwm "Places" submenu, like so:
Code:

<Menu label=" Places" icon="/root/my-documents/clipart/oxywhite-folder-open.png" height="16">
 <Program label="Top (/)" icon="mini-filemgr.xpm">exec rox /</Program>
 <Program label="root (~)" icon="/root/home.png">exec rox /root</Program>
 <Program label="My Documents" icon="/root/my-documents/clipart/Dossiers.png">exec rox /root/my-documents</Program>
 <Program label="My Applications" icon="mini-filemgr.xpm">exec rox /root/my-applications</Program>
 <Program label="usr/share" icon="mini-filemgr.xpm">exec rox /usr/share</Program>
 <Program label="Puppy's Home" icon="mini-filemgr.xpm">exec /root/my-applications/bin/PUPSFSHOME.sh</Program>
 </Menu>

It saves a few clicks if you need to go there.

BFN.

musher0

_________________
musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1390
Location: Japan

PostPosted: Mon 19 May 2014, 10:22    Post subject:  

musher0 wrote:
The following little script will open the Puppy's "home", meaning: the folder in
/mnt/home where the main Puppy sfs is located.
Hi musher0, why don't you put your script directly into the menu? This one-liner is not much longer than the path to your script Laughing

I propose:
Code:
<Program label="Puppy's Home" icon="mini-filemgr.xpm">. /etc/rc.d/PUPSTATE ; rox "/mnt/$PDEV1$PSUBDIR"</Program>


If Puppy booted from USB stick, then this opens /mnt/sdb1/[something] , NOT /mnt/home/[something]. You cannot count on /mnt/home. This is just a symlink to /mnt/sdb1, and this symlink is not created when Puppy starts in PUPMODE 5 (pfix=ram), while /mnt/sdb1 is the "real" thing.

P.S: You can't even count on sdb1. It is NOT mounted in PUPMODE 5 and maybe some other modes (booting from Live CD?). So to be absolutely certain that your menu works, you first would have to check if the partition is mounted.

This is how my /mnt looks after a fresh boot:
Screenshot.png
 Description   
 Filesize   36.68 KB
 Viewed   254 Time(s)

Screenshot.png


Last edited by MochiMoppel on Mon 19 May 2014, 20:34; edited 1 time in total
Back to top
View user's profile Send private message 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Mon 19 May 2014, 11:54    Post subject:  

Thanks, Musher0 and MochiMoppel.

This thread start to include code examples not easy to be found in google. I couldn't find anything related to automount drive by UUID from menu entry. The only examples are for lines in /etc/fstab that do not work the same way.

Toni

.
Back to top
View user's profile Send private message MSN Messenger 
greengeek


Joined: 20 Jul 2010
Posts: 4716
Location: Republic of Novo Zelande

PostPosted: Mon 19 May 2014, 15:55    Post subject:  

musher0 wrote:
This is my take on the procedure that Puppus' explained in his first post.

Code:
<Menu label=" Places" icon="/root/my-documents/clipart/oxywhite-folder-open.png" height="16">
<Program label="Top (/)" icon="mini-filemgr.xpm">exec rox /</Program>
<Program label="root (~)" icon="/root/home.png">exec rox /root</Program>
<Program label="My Documents" icon="/root/my-documents/clipart/Dossiers.png">exec rox /root/my-documents</Program>
<Program label="My Applications" icon="mini-filemgr.xpm">exec rox /root/my-applications</Program>
<Program label="usr/share" icon="mini-filemgr.xpm">exec rox /usr/share</Program>
</Menu>


It goes in file /etc/xdg/templates/_root_.jwmrc, between the fun menu and the help program. Save, then open a console and type

Code:
fixmenus
jwm -restart



I need to do a bit of catching up here...

I know you said your menu is different, and this code (or other contents of "places" menu) can sit between fun menu and help - but my templates file does not contain any reference to any of the usual <program></program> submenus at all. eg:
Code:
<RootMenu label="Menu" labeled="false" height="18" onroot="3">

PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-desktop.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-system.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-setup.menu

<Separator/>

PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-utility.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-filesystem.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-graphic.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-document.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-calculate.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-personal.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-network.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-internet.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-multimedia.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-fun.menu

<Separator/>

<Program label="Help" icon="help24.png">exec defaulthtmlviewer file:///usr/share/doc/index.html</Program>

<Program label="pRun" icon="/usr/local/prun/icons/prun48.png">exec /usr/local/bin/prun</Program>

<Menu label="Shutdown" icon="shutdown24.png" height="16">
<!-- <Exit confirm="false" label="Exit to prompt" icon="prompt16.xpm" /> -->
<Program label="Exit to prompt" icon="prompt16.xpm">exec wmexit</Program>
<Program label="Reboot computer" icon="mini-turn.xpm">exec wmreboot</Program>
<Program label="Power-off computer" icon="mini-stop.xpm">exec wmpoweroff</Program>
<Program label="Restart X server" icon="mini-x.xpm">restartwm</Program>
<Restart label="Restart JWM" icon="mini-windows.xpm"/>


I guess I can bang my own version of places or bookmarks menu in there above help, but why do I not show any contents of the actual programmes that should be available in each submenu? Does this file only define the MAJOR structure, and some other file defines the MINOR structure containing the details of each individual programme? (I recall some thread from Mobeus about xdg menus so maybe I should hunt that down...)

I also learnt that running fixmenus deletes all the changes I make directly to /root/.jwmrc
Lesson learnt.
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 4716
Location: Republic of Novo Zelande

PostPosted: Mon 19 May 2014, 16:13    Post subject:  

MochiMoppel wrote:
I have a better idea (keep fingers crossed!). Let's search for the device name (e.g. sdb1) of a given UUID
Code:
<Program label="MyMusicStick4">
UUID="F620E"
DRIVE=$(echo "`blkid`" | sed -n /"$UUID"/'s/:.*$//p' | sed 's|/dev/||')
/root/.pup_event/drive_$DRIVE/AppRun
</Program>

Yes, this one works

saintless wrote:
The mount point is not fixed and you do not need to create it. It changes depending what other flash drives are connected and should be (I hope) auto-created and auto-mounted from MyMusicStick-3 menu:
Code:
      <Program label="MyMusicStick-3">
UUID="45B6-2F7F"
DRIVE=$(echo "`blkid`" | sed -n /"$UUID"/'s/:.*$//p' | sed 's|/dev/||')
mkdir $DRIVE
mount UUID="45B6-2F7F" $DRIVE
rox $DRIVE
</Program>


Yes, both of these work. They do seem very slow due to the blkid but there may be other advantages. These options give me plenty to work with. Thank you all very much!
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1496
Location: nyc

PostPosted: Mon 19 May 2014, 18:55    Post subject:  

greengeek wrote:
musher0 wrote:
This is my take on the procedure that Puppus' explained in his first post.

Code:
<Menu label=" Places" icon="/root/my-documents/clipart/oxywhite-folder-open.png" height="16">
<Program label="Top (/)" icon="mini-filemgr.xpm">exec rox /</Program>
<Program label="root (~)" icon="/root/home.png">exec rox /root</Program>
<Program label="My Documents" icon="/root/my-documents/clipart/Dossiers.png">exec rox /root/my-documents</Program>
<Program label="My Applications" icon="mini-filemgr.xpm">exec rox /root/my-applications</Program>
<Program label="usr/share" icon="mini-filemgr.xpm">exec rox /usr/share</Program>
</Menu>


It goes in file /etc/xdg/templates/_root_.jwmrc, between the fun menu and the help program. Save, then open a console and type

Code:
fixmenus
jwm -restart



I need to do a bit of catching up here...

I know you said your menu is different, and this code (or other contents of "places" menu) can sit between fun menu and help - but my templates file does not contain any reference to any of the usual <program></program> submenus at all. eg:
Code:
<RootMenu label="Menu" labeled="false" height="18" onroot="3">

PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-desktop.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-system.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-setup.menu

<Separator/>

PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-utility.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-filesystem.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-graphic.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-document.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-calculate.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-personal.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-network.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-internet.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-multimedia.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-fun.menu

<Separator/>

<Program label="Help" icon="help24.png">exec defaulthtmlviewer file:///usr/share/doc/index.html</Program>

<Program label="pRun" icon="/usr/local/prun/icons/prun48.png">exec /usr/local/bin/prun</Program>

<Menu label="Shutdown" icon="shutdown24.png" height="16">
<!-- <Exit confirm="false" label="Exit to prompt" icon="prompt16.xpm" /> -->
<Program label="Exit to prompt" icon="prompt16.xpm">exec wmexit</Program>
<Program label="Reboot computer" icon="mini-turn.xpm">exec wmreboot</Program>
<Program label="Power-off computer" icon="mini-stop.xpm">exec wmpoweroff</Program>
<Program label="Restart X server" icon="mini-x.xpm">restartwm</Program>
<Restart label="Restart JWM" icon="mini-windows.xpm"/>


I guess I can bang my own version of places or bookmarks menu in there above help, but why do I not show any contents of the actual programmes that should be available in each submenu? Does this file only define the MAJOR structure, and some other file defines the MINOR structure containing the details of each individual programme? (I recall some thread from Mobeus about xdg menus so maybe I should hunt that down...)

I also learnt that running fixmenus deletes all the changes I make directly to /root/.jwmrc
Lesson learnt.


if you want your menus permanent and can deal with the existing menu structure, just place whatever shortcuts you have (menu or program) where you want them in /etc/xdg/templates/_root_.jwmrc, which at least gives you a clue as to the relative position of your placement(s).

there are files to mess around with in /etc/xdg/menus, i guess, but i haven't chanced it yet. looks like it may be the place to look, though. anyway, i like my menu the way it is, with the entire original menu compressed into one line. my workaround for fixmenus is to right click copy .jwmrc (add something to the file before the period and press enter) after every major change or restructuring. then, if i have to run fixmenus or install/uninstall something, i do that as normal, then go back to the renamed .jwmrc file, remove what i added to the file name, resave, and restart jwm. everything is saved and updated. it's not ideal, but it works.

i've been saving all my keyboard shortcuts in jwmrc-personal, which is in .jwm along with jwmrc-personal2, jwmrc-theme, jwmrc-personal, jwmrc-personal-bak, and the jwm themes folder. i'm guessing you could add menu items there as well, but...i haven't tried to yet. i think that's also where you might put the info for custom/additional root menus, something i haven't yet been able to successfully implement (i think they may need to be bound to a menu button or something more substantial than a shortcut key--my menu just flashed hugely before my eyes at a pace that made it a bit scary, a bit amusing, and not at all useful.) anyway, that would be another solution: your own menu to pop up when you want it.

so until the more knowledgeable chime in, that's the way to keep your custom menu. accept the structure and go the /etc/xdg/templates/_root_.jwmrc route, or get full customization and have to do the copy/rename trick with root/.jwmrc.

hth.
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Mon 19 May 2014, 21:48    Post subject:  

@greengekk

Copy my "Places" submenu just above the "help" program line, and save.
Works for me!

Best regards.

musher0

_________________
musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1390
Location: Japan

PostPosted: Mon 19 May 2014, 22:04    Post subject:  

Puppus Dogfellow wrote:
... the entire original menu compressed into one line. my workaround for fixmenus is to right click copy .jwmrc (add something to the file before the period and press enter) after every major change or restructuring. then, if i have to run fixmenus or install/uninstall something, i do that as normal, then go back to the renamed .jwmrc file, remove what i added to the file name, resave, and restart jwm. everything is saved and updated. it's not ideal, but it works.
Again I'm completely lost. With all this jumping around and the lengthy full quotes this thread is hard to follow and I have no idea what you have or want to achieve. "compressed into one line"? And what is this rename business? Surely unnecessary, but without knowing your current main menu it's hard to propose alternatives.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 3 of 14 [201 Posts]   Goto page: Previous 1, 2, 3, 4, 5, ..., 12, 13, 14 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
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.1242s ][ Queries: 12 (0.0089s) ][ GZIP on ]