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 Sat 18 Nov 2017, 09:59
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 2 of 14 [201 Posts]   Goto page: Previous 1, 2, 3, 4, ..., 12, 13, 14 Next
Author Message
greengeek


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

PostPosted: Sun 18 May 2014, 06:09    Post subject:  

OK, I got your suggestion working thanks saintless - tried it with my usb music stick instead of docs: Easier than I thought. Now to try the other mods..
music-on-flash.jpg
 Description   
 Filesize   162.77 KB
 Viewed   603 Time(s)

music-on-flash.jpg

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


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

PostPosted: Sun 18 May 2014, 09:16    Post subject:  

MochiMoppel wrote:
Girls, I'm lost! What is the topic? First JWM Bookmarks Menu, then keyboard shortcuts, then "Places" sub-menu and now it's about mounting devices to fixed address based on a list?

The latter seems tricky and close to impossible, but the idea to do it the other way round, to create a menu item that calls a specific USB stick (identified by its UUID), no matter if Puppy calls it sdd1 or sdt1, should be no problem. The real problem: JWM menus are pretty static. Unlike the drive icons, which appear and disappear depending on what's hooked to the machine, a menu would not change. This means you would have a menu entry for "MyMusicStick" even when the stick is not plugged in. Sure, it's possible to recreate and reload the menu, but this requires an external script and is not a nice solution. Using a dynamic menu built with Gtkdialog or some other tools would be much easier, but this wouldn't be a JWM menu...

If you still want to use JWM, try following menu code (I sorted it after dinner Wink ):
Code:
      <Program label="MyMusicStick">
         UUID="8346-747C"
         DRIVE=$(echo `blkid` | sed /"$UUID"/'s/:.*$//;s/dev/mnt/')
         rox $DRIVE
      </Program>

Adjust the UUID to your needs. The code runs the blkid command to find the UUIDs of all devices and feeds the result to sed. sed searches for the specified UUID and puts the result (/mnt/sd...) into variable DRIVE. Finally ROX runs DRIVE.
This is quite slow, blkid needs some time. I'm sure this can be improved, but it should suffice to give you an idea.
What is important here: JWM menus have the teriffic ability to process bash commands. No external scripts needed.
Another example? This calls Puppy's boot partition:
Code:
      <Program label="BOOTPARTITION"   icon="usb16.xpm">
         . /etc/rc.d/PUPSTATE
         rox /mnt/$PDEV1
      </Program>


Right on the ball, MochiMoppel ! Smile Important breakthrough, too ! Smile I, for one, didn't
know that "JWM menus have the teriffic ability to process bash commands."

I need to study your first example a little more, but your second one "speaks" by
itself. Brilliant !

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 
musher0


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

PostPosted: Sun 18 May 2014, 09:59    Post subject:  

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.
Zorin_OS_gnome_desktop(part).jpg
 Description   
 Filesize   11.3 KB
 Viewed   548 Time(s)

Zorin_OS_gnome_desktop(part).jpg


_________________
musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)

Last edited by musher0 on Sun 18 May 2014, 14:42; edited 1 time in total
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1496
Location: nyc

PostPosted: Sun 18 May 2014, 10:30    Post subject:  

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...).
Back to top
View user's profile Send private message 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Sun 18 May 2014, 10:38    Post subject:  

MochiMoppel wrote:
... JWM menus have the teriffic ability to process bash commands. No external scripts needed.
Another example? This calls Puppy's boot partition:
Code:
      <Program label="BOOTPARTITION"   icon="usb16.xpm">
         . /etc/rc.d/PUPSTATE
         rox /mnt/$PDEV1
      </Program>

Thanks, I also did not know this.
I think rox /mnt/$PDEV1 will not work because the boot partition is mounted as /mnt/home after you create save file but it is not /mnt/home in /etc/rc.d/PUPSTATE. It is sdX and this mount point is missing in /mnt

Edit: If I do not mistake the boot partition is /initrd/mnt/dev_save with link to /mnt/home if there is save file in use and /initrd/mnt/dev_ro2 if there is no save file in use. I do not see information about this mount points in PUPSTATE in DPup at least.

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.

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

Last edited by saintless on Sun 18 May 2014, 11:58; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1496
Location: nyc

PostPosted: Sun 18 May 2014, 10:54    Post subject:  

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:
#!/bin/bash

mount UUID=74B1-AB6F /mnt/docs
rox /mnt/docs


and add this line in .jwmrc
Code:
<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.php?mode=attach&id=56388&sid=9ef6a4b5c62ed345c6397dd4f2427f5c

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.
Back to top
View user's profile Send private message 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Sun 18 May 2014, 11:42    Post subject:  

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?t=1097536&p=6913820#post6913820
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

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


Joined: 07 Jan 2013
Posts: 1496
Location: nyc

PostPosted: Sun 18 May 2014, 13:26    Post subject:  

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?t=1097536&p=6913820#post6913820
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.
Very Happy
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Sun 18 May 2014, 13:56    Post subject:  

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
~~~~~~~~~~
"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 
greengeek


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

PostPosted: Sun 18 May 2014, 14:21    Post subject:  

MochiMoppel wrote:
Code:
      <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:
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).
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Sun 18 May 2014, 14:40    Post subject:  

Hi, everyone.

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


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

BFN.

musher0
jwm-places.jpg
 Description   
 Filesize   19.28 KB
 Viewed   473 Time(s)

jwm-places.jpg


_________________
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 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1496
Location: nyc

PostPosted: Sun 18 May 2014, 15:58    Post subject:  

greengeek wrote:
MochiMoppel wrote:
Code:
      <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:
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 Evil


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

Cool

...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, 17:34; edited 1 time in total
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1496
Location: nyc

PostPosted: Sun 18 May 2014, 16:10    Post subject:  

musher0 wrote:
Hi, everyone.

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


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

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.
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1496
Location: nyc

PostPosted: Sun 18 May 2014, 20:35    Post subject:  

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

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

<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 Sun 18 May 2014, 22:43; edited 1 time in total
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1390
Location: Japan

PostPosted: Sun 18 May 2014, 22:00    Post subject:  

greengeek wrote:
Hi Mochi - I was not able to get this to work
Me too Laughing 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:
      <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, 04:15; edited 3 times in total
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 14 [201 Posts]   Goto page: Previous 1, 2, 3, 4, ..., 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.0821s ][ Queries: 12 (0.0049s) ][ GZIP on ]