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 23 Sep 2018, 12:17
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 5 of 14 [202 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, ..., 12, 13, 14 Next
Author Message
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1564
Location: nyc

PostPosted: Wed 21 May 2014, 14:29    Post subject:  

MochiMoppel wrote:

[...] you could put the whole "original menu" into a separate file. Name the file e.g. mymenu and save it wherever you like, even outside of Puppy. This separate file should look like this:
<?xml version="1.0"?>
<JWM>

<Menu label="original menu" icon="" height="16">
[the entire original menu with many of my own menus buried within the extant categories, plus what ever menus and submenus i added outside it, under it, within it, etc]
</Menu>
</JWM>

In your _root_.jwmrc replace the whole <Menu label="original menu" icon="" height="16"> ...</menu> section with
<Include>path/to/mymenu</Include>

You'll never have to touch _root_.jwmrc again. From now on you can make all your changes in mymenu, refresh this menu with a simple jwm -reload command and never have to worry about _root_.jwmrc destroying your custom menu in .jwmrc.


Mochi, what would it take to set that "mymenu" file up as a separate menu with its own button and click activation? can i have a task bar button inserted into .jwmrc-tray from this file in the same way? how about setting up which mouse click/click combo activates it? if that is all possible through the new file, can you show me how to set it up? thanks in advance.

...i suppose making my custom menu root:3 and the original menu something else would achieve what i'm doing in a better way...
Back to top
View user's profile Send private message 
greengeek


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

PostPosted: Wed 21 May 2014, 15:27    Post subject:  

Puppus Dogfellow wrote:
perhaps there was some other mistake i made when i tried to compress the original menu--doing it in _root_.jwmrc gave me the orange and red warning borders; the same wasn't true for the mod done in .jwmrc.
What were the orange and red warning borders? Sounds a bit like what happened to me a couple of times - and I'm still not sure why. I lost my tray at the bottom of the screen and had orange window borders. Had to manually load a backup .jwmrc but really didn't know what I had done to cause the problem.
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Wed 21 May 2014, 15:28    Post subject:  

Jasper wrote:
PupMenu 3.5 (from radky) is designed for Menu access using a shortcut - or:
JWM, IceWM, Openbox, Fluxbox, LXDE and LXPanel
(...)
So there is a superb ready-made Bookmarks screen already available via JWM, but it's great to learn a lot more from MochiMoppel.
(...)

Hi, Jasper.

Do you have a URL handy for those little jewels? Smile Thanks in advance.

musher0

_________________
musher0
~~~~~~~~~~
Siempre será canción nueva... (V. Jara, Manifiesto)
Back to top
View user's profile Send private message 
greengeek


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

PostPosted: Wed 21 May 2014, 15:51    Post subject:  

MochiMoppel wrote:
The code runs the blkid command to find the UUIDs of all devices... This is quite slow, blkid needs some time.

While I was looking around in /etc I saw a file called blkid-cache. It seems to be populated during the boot process. Maybe that would be a possible source for faster access to the blkid info?

EDIT : No, ignore that - it seems as if that /etc/blkid-cache is just 'historic' info, not updated realtime for current purposes.

Last edited by greengeek on Wed 21 May 2014, 16:29; edited 1 time in total
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1564
Location: nyc

PostPosted: Wed 21 May 2014, 15:57    Post subject:  

greengeek wrote:
Puppus Dogfellow wrote:
perhaps there was some other mistake i made when i tried to compress the original menu--doing it in _root_.jwmrc gave me the orange and red warning borders; the same wasn't true for the mod done in .jwmrc.
What were the orange and red warning borders? Sounds a bit like what happened to me a couple of times - and I'm still not sure why. I lost my tray at the bottom of the screen and had orange window borders. Had to manually load a backup .jwmrc but really didn't know what I had done to cause the problem.


if things aren't perfect--or in fact are completely messed up--jwm doesn't stop working, it just lets you know it is unhappy by using some garish theme. one bracket out of place is enough to cause it. yeah, sometimes the tray disappears as well under those conditions. i think it happens no matter what jwmrc-type file you mess up. it's expecting something a certain way and gets cranky when it doesn't find it. i guess preventing this sort of thing is what that jwm -p command is for...

***

maybe someone should link or post some untouched _root_.jwmrc and jwmrc files here--i don't think i have any left. could be useful down the line...
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1619
Location: Japan

PostPosted: Thu 22 May 2014, 03:48    Post subject:  

Puppus, me thinks that you are still happily violating
Rule #1: Never edit /root/.jwmrc !
The Puppymakers should have made this file read-only and explode in the face of anyone who tries to change a single bit. Making it hidden and putting a warning on top seems to be no deterrent for determined hackers like you. Laughing

But I'm confident. You are already on the right track to kick this bad habit.

Puppus Dogfellow wrote:
maybe someone should link or post some untouched _root_.jwmrc and jwmrc files here
Look into /initrd/pup_ro2/ for all your pristine Puppy files - unless you have remastered your installation.
Quote:
Mochi, what would it take to set that "mymenu" file up as a separate menu with its own button and click activation?

You have to wrap the whole stuff with <RootMenu> tags like this:
<?xml version="1.0"?>
<JWM>

<RootMenu onroot="2">
<Menu label="original menu" icon="" height="16">
[the entire original menu with many of my own menus buried within the extant categories, plus what ever menus and submenus i added outside it, under it, within it, etc]
</Menu>

</RootMenu>
</JWM>

This will turn it into a separate menu. Do not include this menu in the main menu with <Include> as proposed in my previous post, because now it has become a menu of its own, and you can't include complete menus in other menus.

JWM let's you create up to 10 different menus. They are referenced in tray buttons and keyboard shortcuts as root:0, root:1...root:9. You must create these shortcuts/buttons manually, but you can use the ones created for the main menu (root:3) as a model.

Menus with IDs 1 to 5 are special. They are automatically assigned to mouse actions and you can open them by clicking the desktop:
onroot:1 via left-click
onroot:2 via middle-click
onroot:3 via right-click
onroot:4 via scrollwheel-up
onroot:5 via scrollwheel-down

Be careful with onroot:3. If want to name your new menu onroot:3, you first have to rename the original menu in _root_.jwmrc
to something else. onroot:0 would be a nice number for the Mother of all Menus. Don't forget to assign a shortcut/tray button to root:0, otherwise the original menu will be unaccessible.

The next step is to link your mymenu into JWM's menu structure. I prefer to include it in .jwmrc-tray, but you can also put it into jwmrc-personal. There you can put the link right after the <JWM> tag, like this
<?xml version="1.0"?>
<JWM>

<Include>/path/to/mymenu</Include>

That's it.

Here is a very simple example which should work without modification, except for the last menu item. "Edit me!" opens itself in an editor. After saving and closing the editor it reloads the menu and you can see the results of your menu messing immediately. I prefer Leafpad because I normally keep Geany open for other tasks and don't want the menu to mix with other documents. Leafpad is ideal for quick single tasks. The ID for this menu is onroot:2. I don't have to explain how to open it, do I? Wink
Code:
<?xml version="1.0"?>
<JWM>
  <RootMenu onroot="2">
      <Program label="/root"      icon="mini-ofolder.xpm"> rox /root</Program>
      <Program label="/"          icon="mini-ofolder.xpm"> rox /</Program>
      <Menu label="TMP folders"   icon="mini-ofolder.xpm">
        <Program label="/tmp"     icon="mini-ofolder.xpm"> rox /tmp</Program>
        <Program label="/dev/shm" icon="mini-ofolder.xpm"> rox /dev/shm</Program>
      </Menu>       
      <Program label="HOME SWEET HOME"icon="usb16.xpm">    . /etc/rc.d/PUPSTATE;rox /mnt/$PDEV1</Program>
      <Separator/>
      <Program label="Edit me!"   icon="mini-edit.xpm">    leafpad "/path/to/mymenu";jwm -reload</Program>
  </RootMenu>
</JWM>
mymenu.png
 Description   
 Filesize   5.97 KB
 Viewed   432 Time(s)

mymenu.png


Last edited by MochiMoppel on Thu 22 May 2014, 05:15; edited 1 time in total
Back to top
View user's profile Send private message 
Jasper

Joined: 25 Apr 2010
Posts: 1350
Location: England

PostPosted: Thu 22 May 2014, 04:28    Post subject:  

@ MochiMoppel
Thank you for your brilliant and educational post immediately above and for your Additional Menu example.

@ musher0
This will link to PupMenu 3.5 (from radky - see his signature and his PupMates link for all his apps including updates and additions)
http://murga-linux.com/puppy/viewtopic.php?t=76713&sid=5cdb9063471a6e2eae5085d741d2231e
Back to top
View user's profile Send private message 
greengeek


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

PostPosted: Thu 22 May 2014, 05:22    Post subject:  

Now you've done it Mochi. My head just officially exploded.
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1564
Location: nyc

PostPosted: Thu 22 May 2014, 09:30    Post subject:  

MochiMoppel wrote:
Puppus, me thinks that you are still happily violating
Rule #1: Never edit /root/.jwmrc !
The Puppymakers should have made this file read-only and explode in the face of anyone who tries to change a single bit. Making it hidden and putting a warning on top seems to be no deterrent for determined hackers like you. Laughing

But I'm confident. You are already on the right track to kick this bad habit.

Puppus Dogfellow wrote:
maybe someone should link or post some untouched _root_.jwmrc and jwmrc files here
Look into /initrd/pup_ro2/ for all your pristine Puppy files - unless you have remastered your installation.
Quote:
Mochi, what would it take to set that "mymenu" file up as a separate menu with its own button and click activation?

You have to wrap the whole stuff with <RootMenu> tags like this:
<?xml version="1.0"?>
<JWM>

<RootMenu onroot="2">
<Menu label="original menu" icon="" height="16">
[the entire original menu with many of my own menus buried within the extant categories, plus what ever menus and submenus i added outside it, under it, within it, etc]
</Menu>

</RootMenu>
</JWM>

This will turn it into a separate menu. Do not include this menu in the main menu with <Include> as proposed in my previous post, because now it has become a menu of its own, and you can't include complete menus in other menus.

JWM let's you create up to 10 different menus. They are referenced in tray buttons and keyboard shortcuts as root:0, root:1...root:9. You must create these shortcuts/buttons manually, but you can use the ones created for the main menu (root:3) as a model.

Menus with IDs 1 to 5 are special. They are automatically assigned to mouse actions and you can open them by clicking the desktop:
onroot:1 via left-click
onroot:2 via middle-click
onroot:3 via right-click
onroot:4 via scrollwheel-up
onroot:5 via scrollwheel-down

Be careful with onroot:3. If want to name your new menu onroot:3, you first have to rename the original menu in _root_.jwmrc
to something else. onroot:0 would be a nice number for the Mother of all Menus. Don't forget to assign a shortcut/tray button to root:0, otherwise the original menu will be unaccessible.

The next step is to link your mymenu into JWM's menu structure. I prefer to include it in .jwmrc-tray, but you can also put it into jwmrc-personal. There you can put the link right after the <JWM> tag, like this
<?xml version="1.0"?>
<JWM>

<Include>/path/to/mymenu</Include>

That's it.

Here is a very simple example which should work without modification, except for the last menu item. "Edit me!" opens itself in an editor. After saving and closing the editor it reloads the menu and you can see the results of your menu messing immediately. I prefer Leafpad because I normally keep Geany open for other tasks and don't want the menu to mix with other documents. Leafpad is ideal for quick single tasks. The ID for this menu is onroot:2. I don't have to explain how to open it, do I? Wink
Code:
<?xml version="1.0"?>
<JWM>
  <RootMenu onroot="2">
      <Program label="/root"      icon="mini-ofolder.xpm"> rox /root</Program>
      <Program label="/"          icon="mini-ofolder.xpm"> rox /</Program>
      <Menu label="TMP folders"   icon="mini-ofolder.xpm">
        <Program label="/tmp"     icon="mini-ofolder.xpm"> rox /tmp</Program>
        <Program label="/dev/shm" icon="mini-ofolder.xpm"> rox /dev/shm</Program>
      </Menu>       
      <Program label="HOME SWEET HOME"icon="usb16.xpm">    . /etc/rc.d/PUPSTATE;rox /mnt/$PDEV1</Program>
      <Separator/>
      <Program label="Edit me!"   icon="mini-edit.xpm">    leafpad "/path/to/mymenu";jwm -reload</Program>
  </RootMenu>
</JWM>



That is awesome, Mochi. Thanks a ton.

And yes, i've officially started to stop messing with .jwmrc.

Wink

Last edited by Puppus Dogfellow on Tue 03 Mar 2015, 22:18; edited 1 time in total
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Thu 22 May 2014, 12:52    Post subject:  

Jasper wrote:
@ MochiMoppel
Thank you for your brilliant and educational post immediately above and for your Additional Menu example.

@ musher0
This will link to PupMenu 3.5 (from radky - see his signature and his PupMates link for all his apps including updates and additions)
http://murga-linux.com/puppy/viewtopic.php?t=76713&sid=5cdb9063471a6e2eae5085d741d2231e


Thanks, Jasper.

_________________
musher0
~~~~~~~~~~
Siempre será canción nueva... (V. Jara, Manifiesto)
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Fri 23 May 2014, 15:51    Post subject:  

Hi.

This is the first draft of a script that makes ROX-Filer Bookmarks available in the jwm menu. All constructive comments welcome.

Enjoy!

musher0

Code:
#!/bin/sh
# /root/my-applications/bin/rox-to-jwm_bkmrks.sh
# First draft. For Puppy
#
# Purpose: make the ROX "Bookmarks" available in the jwm menu.
# Dependencies: jwm, ROX-Filer, replaceit (http://pldaniels.com/replaceit),
# and a nicely populated bookmarks section in the ROX-Filer!
#
# (c) Christian L'écuyer (aka musher0), Gatineau (Qc), Canada, 23 mai 2014.
####
cd ~/.config/rox.sourceforge.net/ROX-Filer
cp -f Bookmarks.xml jwm-bookmarks.xml
sleep 0.1s
REP="replaceit --input=jwm-bookmarks.xml"
$REP bookmarks Menu
$REP bookmark Program
$REP bookmark Program
$REP title label
$REP ">/" ">exec rox /"
echo "<Menu label=\" ROX-Bookmarks\" icon=\"folder.xpm\" height=\"16\">" > places.menu
a="`wc -l jwm-bookmarks.xml | awk '{ print $1 }'`"
b="`expr $a - 2`"
tail -n $b jwm-bookmarks.xml >> places.menu
defaulttexteditor /etc/xdg/templates/_root_.jwmrc /root/.config/rox.sourceforge.net/ROX-Filer/places.menu &
#
# Instructions --
#
# Once geany is opened with the two files,
#
# 1) copy and paste the entire contents of file places.menu
# __ just above the "help" entry in the jwm menu,
# __ replacing any pre-existing sub-menu with the new one.

# 2) Save _root_.jwmrc

# 3) Exit geany

# 4) Exit X

# 5) Run fixmenus

# 6) Restart jwm
my-rox-bookmarks(example).jpg
 Description   A well populated rox bookmarks sub-menu
 Filesize   56.58 KB
 Viewed   349 Time(s)

my-rox-bookmarks(example).jpg

signets-ROX.xml.zip
Description  My ROX bookmarks file (as example of a starting point for the script above)
zip

 Download 
Filename  signets-ROX.xml.zip 
Filesize  720 Bytes 
Downloaded  131 Time(s) 
rox-bkmrks-in-jwm.jpg
 Description   
 Filesize   25.47 KB
 Viewed   339 Time(s)

rox-bkmrks-in-jwm.jpg

rox-to-jwm_bkmrks.sh.zip
Description 
zip

 Download 
Filename  rox-to-jwm_bkmrks.sh.zip 
Filesize  883 Bytes 
Downloaded  143 Time(s) 

_________________
musher0
~~~~~~~~~~
Siempre será canción nueva... (V. Jara, Manifiesto)
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1564
Location: nyc

PostPosted: Fri 23 May 2014, 16:39    Post subject:  

musher0 wrote:
Hi.

This is the first draft of a script that makes ROX-Filer Bookmarks available in the jwm menu. All constructive comments welcome.

Enjoy!

musher0

Code:
#!/bin/sh
# /root/my-applications/bin/rox-to-jwm_bkmrks.sh
# First draft. For Puppy
#
# Purpose: make the ROX "Bookmarks" available in the jwm menu.
# Dependencies: jwm, ROX-Filer, replaceit (http://pldaniels.com/replaceit),
# and a nicely populated bookmarks section in the ROX-Filer!
#
# (c) Christian L'écuyer (aka musher0), Gatineau (Qc), Canada, 23 mai 2014.
####
cd ~/.config/rox.sourceforge.net/ROX-Filer
cp -f Bookmarks.xml jwm-bookmarks.xml
sleep 0.1s
REP="replaceit --input=jwm-bookmarks.xml"
$REP bookmarks Menu
$REP bookmark Program
$REP bookmark Program
$REP title label
$REP ">/" ">exec rox /"
echo "<Menu label=\" ROX-Bookmarks\" icon=\"folder.xpm\" height=\"16\">" > places.menu
a="`wc -l jwm-bookmarks.xml | awk '{ print $1 }'`"
b="`expr $a - 2`"
tail -n $b jwm-bookmarks.xml >> places.menu
defaulttexteditor /etc/xdg/templates/_root_.jwmrc /root/.config/rox.sourceforge.net/ROX-Filer/places.menu &
#
# Instructions --
#
# Once geany is opened with the two files,
#
# 1) copy and paste the entire contents of file places.menu
# __ just above the "help" entry in the jwm menu,
# __ replacing any pre-existing sub-menu with the new one.

# 2) Save _root_.jwmrc

# 3) Exit geany

# 4) Exit X

# 5) Run fixmenus

# 6) Restart jwm


that looks great, musher. does it pull the list from the current bookmarks and auto-update? (i guess that would be my "constructive comment" Wink )

even if it doesn't, it's still a tremendous time saver compared to having to enter the entries individually...

i will try it out shortly after getting home, i think.

thanks for your contributions!
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Fri 23 May 2014, 18:40    Post subject:  

Puppus Dogfellow wrote:
(...)
that looks great, musher. does it pull the list from the current bookmarks and auto-update? (...)


Yes ! Smile But you still have to do the last part of the "migration" manually. Hence, I
called it "a first draft".

I'm looking for a way to fully automate the process, but it may take some doing.
Maybe awk can do that, we'll see. That involves fracturing the existing jwm menu
template at just right place, inserting the "Bookmarks" sub-menu there, and re-
cementing the parts.

Anyway, it's progress, isn't ? BFN.

musher0

_________________
musher0
~~~~~~~~~~
Siempre será canción nueva... (V. Jara, Manifiesto)
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Fri 23 May 2014, 19:08    Post subject:  

Hello again, all.

In case someone needs it, here is a pet for replaceit:
http://murga-linux.com/puppy/viewtopic.php?search_id=623833918&t=90907

BFN.

musher0

_________________
musher0
~~~~~~~~~~
Siempre será canción nueva... (V. Jara, Manifiesto)
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1564
Location: nyc

PostPosted: Fri 23 May 2014, 19:19    Post subject:  

musher0 wrote:
Puppus Dogfellow wrote:
(...)
that looks great, musher. does it pull the list from the current bookmarks and auto-update? (...)


Yes ! Smile But you still have to do the last part of the "migration" manually. Hence, I
called it "a first draft".

I'm looking for a way to fully automate the process, but it may take some doing.
Maybe awk can do that, we'll see. That involves fracturing the existing jwm menu
template at just right place, inserting the "Bookmarks" sub-menu there, and re-
cementing the parts.

Anyway, it's progress, isn't ? BFN.

musher0


it's great progress and what i actually what i had in mind when i posted this, the predecessor of this thread.

while not quite as fast (activation is instant, but i think it takes a second or so for the list to be populated or the box to be drawn or something) as the bookmarks list in rox's own windows, disciple's script (of which i know you're aware) also autoupdates. anything you can use from it?

...

getting happy and complacent with my setup is causing me to drag my feet implementing the great stuff coming from you and Mochi. i feel remiss in my "developer" (Embarassed) duties...

since i haven't yet made a places entry, how would you recommend i go about incorporating my /root/.config/rox.sourceforge.net/ROX-Filer/Bookmarks.xml file into the menu? can you give alternate instructions for those who didn't do your earlier mod? am i misreading that as a necessary step?

i may end up doing both your mod and his at the same time (making a separate menu and adding yours to that one...or both the new one and the original) since i've yet to do either, but i'm feeling especially brain dead right now for some reason. anyway, a little forethought never really hurt anybody very much.

but again, this was the sort of thing jwm was missing. i think it's a really important development.
Very Happy

***

oh, almost forgot my complete noob question: "exit x"--does this mean restart x, exit to prompt, or something else?
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 5 of 14 [202 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, ..., 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.1148s ][ Queries: 12 (0.0187s) ][ GZIP on ]