Add A JWM Bookmarks Menu or Submenu/Messing Around With JWM

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#21 Post by Puppus Dogfellow »

saintless wrote:
Puppus Dogfellow wrote:if so, that's really cool (and i'm pretty sure Mochi knows how to make those as well...)
It will save you some time and questions just to download the example gnome lookalike jwmrc file from my previous post but it is your choice of course.
saintless wrote:Just for example:

Create directory /mnt/docs.

Create executable script /usr/bin/docs-on-flash

Code: Select all

#!/bin/bash

mount UUID=74B1-AB6F /mnt/docs
rox /mnt/docs
and add this line in .jwmrc

Code: Select all

<Program label="Docs on Flash" icon="docs.png">docs-on-flash</Program>
Docs on Flash menu entry will mount and open this flashdrive with UUID=74B1-AB6F if it is plugged in. It can be sdb1, sdc2, sde3 but it always will be mounted in /mnt/docs
If it is not plugged in Rox opens empty /mnt/docs

And one jwmrc example that might be interested for this thread - Gnome lookalike JWM:
http://murga-linux.com/puppy/viewtopic. ... d4f2427f5c

Toni
Thanks for that, Toni. it looks really cool and i think i get what i'm looking at (there's no need for a separate jwmrc-tray file your way?). thing is, until i saw musher's pic i wasn't really interested in the file--i may not have seen it at all as i figured you were addressing greengeek's issue, which is somewhat beyond me.

where in puppy is the best place to put those additional root menus?

thanks again.

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#22 Post by saintless »

Puppus Dogfellow wrote:(there's no need for a separate jwmrc-tray file your way?)
The original file is made from kerry_s for old Ubuntu version with JWM on low RAM machine. This way jwmrc includes all in one file. It is not easy to be found in google so I posted the file in this forum few years ago. His post is here:
http://ubuntuforums.org/showthread.php? ... ost6913820
I think it will be best and safe just to separate the file for use with Puppy, otherwise refresh-menus will not work. Or to use only the part with Places, System and Applications with your current theme and settings.
Always run jwm -p to check for errors after the changes.
I will check out this thread if I can help with some answers.

Toni

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#23 Post by Puppus Dogfellow »

saintless wrote:
Puppus Dogfellow wrote:(there's no need for a separate jwmrc-tray file your way?)
The original file is made from kerry_s for old Ubuntu version with JWM on low RAM machine. This way jwmrc includes all in one file. It is not easy to be found in google so I posted the file in this forum few years ago. His post is here:
http://ubuntuforums.org/showthread.php? ... ost6913820
I think it will be best and safe just to separate the file for use with Puppy, otherwise refresh-menus will not work. Or to use only the part with Places, System and Applications with your current theme and settings.
Always run jwm -p to check for errors after the changes.
I will check out this thread if I can help with some answers.

Toni
Awesome. Thanks and welcome to the thread.
:D

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#24 Post by musher0 »

Puppus Dogfellow wrote:
musher0 wrote:..
Zorin_OS_gnome_desktop(part).jpg
Description Here's a partial screen capture for those of you who wouldn't know what the gnome desktop looks like. The "Places" sub-menu is typical -- and super handy.
Filesize 11.3 KB
Viewed 9 Time(s)

Zorin_OS_gnome_desktop(part).jpg

applications, places, and system are three popup bookmark menus?

if so, that's really cool (and i'm pretty sure Mochi knows how to make those as well...).
Hi, Puppus_D.

They are roll-down menus, but not all "bookmarks" menu. The "applications" menu
does the same thing as ours -from the graphics sub-menu down to the fun section.
Except it's glued to the gnome panel.

The "places" menu opens pcman file manager or equivalent program in various
important folders such as top, root, my-documents. This one could qualify as a
"bookmarks" menu as you understand it.

The "systems" menu is reserved for system applications -- similar to the first part of
our jwm menu in Puppy: utilities, parameters and the like.

I hope this helps.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#25 Post by greengeek »

MochiMoppel wrote:

Code: Select all

		<Program label="MyMusicStick">
			UUID="8346-747C"
			DRIVE=$(echo `blkid` | sed /"$UUID"/'s/:.*$//;s/dev/mnt/')
			rox $DRIVE
		</Program>
Hi Mochi - I was not able to get this to work - I applied the correct UUID but it returns the following error for me:

Code: Select all

File doesn't exist, or I can't access it: /mnt/loop1
(using upup Raring 3.9.9.2). Any thoughts?

@Puppus... I hope my questions are not detracting from your original concept - I'm heading back to the point of using your bookmark method shortly - I just wanted to find a way to incorporate a link to a usb stick that I know is plugged into the machine but without knowing which sdx number it is. Sometimes I may have 7 or 8 partitions showing on the desktop and no idea which one is the music stick - so I am aiming at using your bookmark method, combined with the UUID identifier of the music partition to ensure I can go straight to my music without having any idea which stick is which (ie: I know longer have to care about sdb1, sdb2, sdb3, sdc1, scd2, sdd1, sdd2, sde1 - the numbers become irrelevant to me finding my way around the machine).

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#26 Post by musher0 »

Hi, everyone.

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

Code: Select all

<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: Select all

fixmenus
jwm -restart
You may have to find some equivalent icons. I mean: if you don't have them on your system somewhere, the icons above won't show. You'll have to find equivalents.

Also, I've changed the default jwm menu template. So my jwm menu won't look like your traditional Puppy menu. This is bad, I know, but it should cure itself! ;)

BFN.

musher0
Attachments
jwm-places.jpg
(19.28 KiB) Downloaded 601 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#27 Post by Puppus Dogfellow »

greengeek wrote:
MochiMoppel wrote:

Code: Select all

		<Program label="MyMusicStick">
			UUID="8346-747C"
			DRIVE=$(echo `blkid` | sed /"$UUID"/'s/:.*$//;s/dev/mnt/')
			rox $DRIVE
		</Program>
Hi Mochi - I was not able to get this to work - I applied the correct UUID but it returns the following error for me:

Code: Select all

File doesn't exist, or I can't access it: /mnt/loop1
(using upup Raring 3.9.9.2). Any thoughts?

@Puppus... I hope my questions are not detracting from your original concept - I'm heading back to the point of using your bookmark method shortly - I just wanted to find a way to incorporate a link to a usb stick that I know is plugged into the machine but without knowing which sdx number it is. Sometimes I may have 7 or 8 partitions showing on the desktop and no idea which one is the music stick - so I am aiming at using your bookmark method, combined with the UUID identifier of the music partition to ensure I can go straight to my music without having any idea which stick is which (ie: I know longer have to care about sdb1, sdb2, sdb3, sdc1, scd2, sdd1, sdd2, sde1 - the numbers become irrelevant to me finding my way around the machine).
you're just expanding on what i had in mind in the first place--get the main menu and button system (some call it a "windows manager") to do as much as we can get it to do as quickly and smoothly as possible. no need to apologize--i think it's great. now that the competent and skilled have taken an interest, this thread could really be something (i wanted it to be helpful to others, but it was in part just a cheat sheet for (if i ever get around to) moving to a new puppy--copy and paste the menu bits, download some stuff from the repo--a back up of some of my system files in an easily accessible form...). JWM seems as flexible as it is fast and How To Completely Bend JWM To Your Whims is a nice goal for the next thread title adjustment.

as far as i'm concerned, the more stuff we can get the menus, buttons, and keys to do the better.

:twisted:


...i'd like the various rox right click menus to be parts of at least some of the jwm menus...

8)

...it would also be nice to have a list of all the open windows at a click or key press...as a menu or a popup, perhaps each with its own menu (such as the stock jwm windows menu) at right click, activated/moved to with left...
Last edited by Puppus Dogfellow on Sun 18 May 2014, 21:34, edited 1 time in total.

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#28 Post by Puppus Dogfellow »

musher0 wrote:Hi, everyone.

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

Code: Select all

<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: Select all

fixmenus
jwm -restart
You may have to find some equivalent icons. I mean: if you don't have them on your system somewhere, the icons above won't show. You'll have to find equivalents.

Also, I've changed the default jwm menu template. So my jwm menu won't look like your traditional Puppy menu. This is bad, I know, but it should cure itself! ;)

BFN.

musher0
yup, that's pretty much exactly what i had in mind.

as to the icons, people don't really need to worry about it too much. random selections copied from other menu entries work, as does just leaving it blank--that can be fiddled with at a later time if the mismatch or empty space starts to get to you.

you can also just change or repurpose some of what's already there--who really ever uses that help entry? (i think i made it a webpage before it ended up buried five menus deep somewhere). also, unless i'm mistaken, any jpg or svg or png file works as an icon--i never resize them, or at best only half of mine are anywhere near real icon size, and it never seems to have mattered--they display regardless so long as the path is entered correctly.

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#29 Post by Puppus Dogfellow »

here's a template for getting six shortcuts from the spacebar:

Code: Select all

<Key mask="A" key="space">exec:rox /mnt</Key>
<Key mask="C" key="space">root:3</Key>
<Key mask="S" key="space">window</Key>
<Key mask="CA" key="space">exec:urxvt</Key>
<Key mask="CS" key="space">exec:geany</Key>
<Key mask="AS" key="space">exec:partview</Key>

the above reflects what i think of as generally helpful choices. one of them was a failed attempt at getting a secondary root menu going. i had a root menu on 6 placed in jwmrc-personal, but when i clicked it, it just cycled weirdly through the entries(at an enormous size, i might add; maybe what i wrote earlier about icon choice size not mattering actually depends on the particular set up...)

anyway, i've never run jwm -p and am kind of fearful of it telling me it finds my setup unacceptably fkd up...

***

here's a template for getting another six from the escape button:

Code: Select all

<Key mask="A" key="Escape">exec:rox /usr/share/applications</Key>
<Key mask="C" key="Escape">minimize</Key>
<Key mask="S" key="Escape">maximize</Key>
<Key mask="CA" key="Escape">move</Key>
<Key mask="CS" key="Escape">resize</Key>
<Key mask="AS" key="Escape">exec:/root/.Pup-Shots/.PupShots</Key>
Last edited by Puppus Dogfellow on Mon 19 May 2014, 02:43, edited 1 time in total.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#30 Post by MochiMoppel »

greengeek wrote:Hi Mochi - I was not able to get this to work
Me too :lol: Worked here , but I remember some funny leftover characters after pasting the code .... I'll fix it when I have time.

This works for me:

Code: Select all

      <Program label="MyMusicStick"> 
          UUID="84F8-9DFA"
          DRIVE=$(echo "`blkid`" | sed -n /"$UUID"/'s/:.*$//p' | sed 's/dev/mnt/') 
          rox $DRIVE 
       </Program>
Last edited by MochiMoppel on Mon 19 May 2014, 08:15, edited 3 times in total.

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#31 Post by saintless »

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: Select all

<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.
Last edited by saintless on Mon 19 May 2014, 09:58, edited 1 time in total.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#32 Post by greengeek »

saintless wrote:

Code: Select all

<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, 09:21, edited 1 time in total.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#33 Post by greengeek »

As long as I create the /mnt/music directory first then this works:

Code: Select all

<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!

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#34 Post by MochiMoppel »

Saintless' code doesn't work for me either. No mounting :cry:

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: Select all

<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 :lol: By all means go for a simple solution and forget my cryptic stuff.
Last edited by MochiMoppel on Mon 19 May 2014, 09:44, edited 1 time in total.

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#35 Post by saintless »

Sorry, guys :( Typo error while copying blkid line:

Code: Select all

       <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>

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#36 Post by saintless »

greengeek wrote:As long as I create the /mnt/music directory first then this works:

Code: Select all

<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.

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#37 Post by saintless »

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: Select all

<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: Select all

      <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>

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#38 Post by musher0 »

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: Select all

#!/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: Select all

<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
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#39 Post by MochiMoppel »

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 :lol:

I propose:

Code: Select all

<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:
Attachments
Screenshot.png
(36.68 KiB) Downloaded 380 times
Last edited by MochiMoppel on Tue 20 May 2014, 00:34, edited 1 time in total.

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#40 Post by saintless »

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

.

Post Reply