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 Mon 10 Dec 2018, 22:43
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 6 of 14 [202 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, ..., 12, 13, 14 Next
Author Message
MochiMoppel


Joined: 26 Jan 2011
Posts: 1705
Location: Japan

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

Puppus, if you have followed the earlier example to create a separate menu (mymenu, to be opened by middle click), the following script would replace your current mymenu with the ROX bookmarks. You can run this whenever your ROX bookmarks change:
Code:
#!/bin/sh
MENUPATH="/path/to/mymenu"
sed 's|^[ \t]*||g' /root/.config/rox.sourceforge.net/ROX-Filer/Bookmarks.xml | tr -d "\n" |
sed '
s|<bookmarks>|\n<JWM>\n<RootMenu onroot="2">\n|
s|</bookmarks>|</RootMenu>\n</JWM>|
s|<bookmark title=|<Program label=|g
s|</bookmark>|"</Program>\n|g
s|\(<Program label[^>]*>\)|\1rox "|g
' > "$MENUPATH"
jwm -reload


If you follow the route of greengeek and musher0, i.e. to integrate the bookmarks into the main menu, you could use this script to create a file places_submenu
Code:
#!/bin/sh
MENUPATH="/path/to/places_submenu"
sed 's|^[ \t]*||g' /root/.config/rox.sourceforge.net/ROX-Filer/Bookmarks.xml | tr -d "\n" |
sed '
s|<bookmarks>|\n<JWM>\n<Menu label="Places" icon="/usr/local/PupControl/icons/gtkicons20.png">\n|
s|</bookmarks>|</Menu>\n</JWM>|
s|<bookmark title=|<Program label=|g
s|</bookmark>|"</Program>\n|g
s|\(<Program label[^>]*>\)|\1rox "|g
' > "$MENUPATH"
jwm -reload
EDIT1: Changed code to accomodate various file formats created by ROX
EDIT2: Changed code to handle directory names containing spaces


Include above submenu in /etc/xdg/templates/_root_.jwmrc like this:

<RootMenu label="Menu" labeled="false" height="24" onroot="3">
<Include>/path/to/places_submenu</Include>
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-desktop.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-system.menu


Run fixmenus once and you are done with fixmenus and _root_.jwmrc. You'll never have to touch this file again Laughing
Running above script will update the main menu with your ROX bookmarks.
places_submenu.png
 Description   
 Filesize   11.07 KB
 Viewed   422 Time(s)

places_submenu.png


Last edited by MochiMoppel on Sat 24 May 2014, 08:41; edited 2 times in total
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1567
Location: nyc

PostPosted: Sat 24 May 2014, 00:59    Post subject:  

MochiMoppel wrote:
Puppus, if you have followed the earlier example to create a separate menu (mymenu, to be opened by middle click), the following script would replace your current mymenu with the ROX bookmarks. You can run this whenever your ROX bookmarks change:
Code:
#!/bin/sh
MENUPATH="/path/to/mymenu"
sed '
s|<bookmarks>|<JWM>\n<RootMenu onroot="2">|
s|</bookmarks>|</RootMenu>\n</JWM>|
s|<bookmark title=|<Program label=|
s|</bookmark>|</Program>|
s|\(<Program label[^>]*>\)|\1rox |
' /root/.config/rox.sourceforge.net/ROX-Filer/Bookmarks.xml > "$MENUPATH"
jwm -reload


If you follow the route of greengeek and musher0, i.e. to integrate the bookmarks into the main menu, you could use this script to create a file places_submenu
Code:
#!/bin/sh
MENUPATH="/path/to/places_submenu"
sed '
s|<bookmarks>|<JWM>\n<Menu label="Places" icon="/usr/local/PupControl/icons/gtkicons20.png">|
s|</bookmarks>|</Menu>\n</JWM>|
s|<bookmark title=|<Program label=|
s|</bookmark>|</Program>|
s|\(<Program label[^>]*>\)|\1rox |
' /root/.config/rox.sourceforge.net/ROX-Filer/Bookmarks.xml > "$MENUPATH"
jwm -reload


Include above submenu in /etc/xdg/templates/_root_.jwmrc like this:

<RootMenu label="Menu" labeled="false" height="24" onroot="3">
<Include>/path/to/places_submenu</Include>
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-desktop.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-system.menu


Run fixmenus once and you are done with fixmenus and _root_.jwmrc. You'll never have to touch this file again Laughing
Running above script will update the main menu with your ROX bookmarks.


Mochi, that second script creates the submenu and populates it with the Rox bookmarks? Shocked if so, that's amazing. if not, it's still great to have both options. thanks yet another ton...
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1705
Location: Japan

PostPosted: Sat 24 May 2014, 01:03    Post subject:  

Puppus Dogfellow wrote:
that second script creates the submenu and populates it with the Rox bookmarks?
Yes.
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1567
Location: nyc

PostPosted: Sat 24 May 2014, 01:09    Post subject:  

MochiMoppel wrote:
Puppus Dogfellow wrote:
that second script creates the submenu and populates it with the Rox bookmarks?
Yes.


holy crap is that great. Laughing

just out of curiosity, does the "submenu" in "places_submenu" change how the item gets treated by jwm or could it have been named anything?

and really, thanks again.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1705
Location: Japan

PostPosted: Sat 24 May 2014, 01:13    Post subject:  

No, you can name it anything you like.
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1567
Location: nyc

PostPosted: Sat 24 May 2014, 02:15    Post subject:  

MochiMoppel wrote:
No, you can name it anything you like.


cool, but i stuck with your title.

ran into some sort of problem on a fresh installation. it only did some of the bookmarks and required a reboot to show up in the menu, though i didn't try an x-restart, just a few reloads and fixmenus. anyway, here's the "/root/places_submenu" file:

Code:
<?xml version="1.0"?>
<JWM>
<Menu label="Places" icon="/usr/local/PupControl/icons/gtkicons20.png">
  <Program label="/mnt/sda1/dwnldsfff/pets">rox /mnt/sda1/dwnldsfff/pets</Program>
<Program label="/root/Startup">rox /root/Startup</Program><bookmark title="/root/Downloads">/root/Downloads</bookmark><bookmark title="/usr/share/applications">/usr/share/applications</bookmark><bookmark title="/root/puppy-reference">/root/puppy-reference</bookmark></Menu>
</JWM>


and the (backup, see below) rx2mm file that generated it:

Code:
#!/bin/sh
MENUPATH="/root/places_submenu"
sed '
s|<bookmarks>|<JWM>\n<Menu label="Places" icon="/usr/local/PupControl/icons/gtkicons20.png">|
s|</bookmarks>|</Menu>\n</JWM>|
s|<bookmark title=|<Program label=|
s|</bookmark>|</Program>|
s|\(<Program label[^>]*>\)|\1rox |
' /root/.config/rox.sourceforge.net/ROX-Filer/Bookmarks.xml > "$MENUPATH"
jwm -reload


what did i do wrong? to give it another go, all i need do is erase that "includes" line from _root_.jwmrc and fixmenus/jwm reload, right? because now that i think about it, i think the script i actually ran it from was called "places_submenu," which in turn got overwritten as the xml file, and that seems like enough of a mistake to have caused the problem. was it?

thank you for your patience.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1705
Location: Japan

PostPosted: Sat 24 May 2014, 02:53    Post subject:  

Puppus Dogfellow wrote:
what did i do wrong?

Nothing. My Bookmarks.xml has one line for each bookmark. It appears that different ROX versions use the same syntax, but different file formats.
I changed the code (see my previous updated post) and it should be OK now for all versions. Could you please give it a test run? It works for me.
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1567
Location: nyc

PostPosted: Sat 24 May 2014, 10:33    Post subject:  

MochiMoppel wrote:
Puppus Dogfellow wrote:
what did i do wrong?

Nothing. My Bookmarks.xml has one line for each bookmark. It appears that different ROX versions use the same syntax, but different file formats.
I changed the code (see my previous updated post) and it should be OK now for all versions. Could you please give it a test run? It works for me.


works for me, too. updates instantly. you're a Wizard, Mochi.

Very Happy

i dragged the update (/create) script to the desktop and gave it an icon. doubt i'd ever set up a puppy without putting this in place. really excellent.
Back to top
View user's profile Send private message 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Sat 24 May 2014, 21:10    Post subject:  

This is interesting.

Is there a solution to do this for the recently used files (file: recently-used.xbel)?

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Sat 24 May 2014, 21:58    Post subject:  

RSH wrote:
This is interesting.

Is there a solution to do this for the recently used files (file: recently-used.xbel)?


Hello, RSH.

Here's an appetizer to what you're looking for, based on aemenu.
http://murga-linux.com/puppy/viewtopic.php?p=737639&sort=lastpost&search_id=1286012613#737639

Best regards.

musher0

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1567
Location: nyc

PostPosted: Sat 24 May 2014, 23:29    Post subject:  

musher0 wrote:
RSH wrote:
This is interesting.

Is there a solution to do this for the recently used files (file: recently-used.xbel)?


Hello, RSH.

Here's an appetizer to what you're looking for, based on aemenu.
http://murga-linux.com/puppy/viewtopic.php?p=737639&sort=lastpost&search_id=1286012613#737639

Best regards.

musher0


another needed (or at the very least, excellent) tweak. your script works great in precise 571, musher (i upped it and the aemenu dependency to my repo). it's a new setup, so maybe i haven't set it up as completely as i think, but in rox, odt opens with LO; your script opens it with abi. is there a way to change it? (as i said, i may not have adjusted the defaults...) anyway, seems pretty easy to add your script to the jwm menu or tray, as a popup if not a rollup. (roll down?--trying to remember what term you used).

anyway, very cool. very nice.
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Sun 25 May 2014, 09:14    Post subject:  

Puppus Dogfellow wrote:
musher0 wrote:
RSH wrote:
This is interesting.

Is there a solution to do this for the recently used files (file: recently-used.xbel)?


Hello, RSH.

Here's an appetizer to what you're looking for, based on aemenu.
http://murga-linux.com/puppy/viewtopic.php?p=737639&sort=lastpost&search_id=1286012613#737639

Best regards.

musher0


another needed (or at the very least, excellent) tweak. your script works great in precise 571, musher (i upped it and the aemenu dependency to my repo). it's a new setup, so maybe i haven't set it up as completely as i think, but in rox, odt opens with LO; your script opens it with abi. is there a way to change it? (as i said, i may not have adjusted the defaults...) anyway, seems pretty easy to add your script to the jwm menu or tray, as a popup if not a rollup. (roll down?--trying to remember what term you used).

anyway, very cool. very nice.


Hello, Puppus D.

Thanks for the flower! It's simple enough to adapt it. In the file
/usr/local/bin/defaultwordprocessor, change the executable < abiword > to < soffice >.

Of course, double check that a < soffice > link or executable is somewhere in one of
the following binary paths: /usr/bin, /usr/local/bin or /root/my-applications/bin.

Please note that my script works most of the time. Some extensions are still not
recognized, nothing will happen when you'll click on those. I couldn't figure out why.
Are Puppy's MIME-types wanting? Or maybe Puppy doesn't have enough default-this-
and-that-executable in /usr/local/bin?

Maybe RSH can apply his powerful brain Smile to solving the rest of this mystery!

In any case, we're lucky to have something, because before, there was nothing. Smile
(That's profound, don't you think?! I'm feeling philosophical this morning!) Smile

BFN.

musher0

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1567
Location: nyc

PostPosted: Sun 25 May 2014, 10:24    Post subject:  

musher0 wrote:


Thanks for the flower! It's simple enough to adapt it. In the file
/usr/local/bin/defaultwordprocessor, change the executable < abiword > to < soffice >.

Of course, double check that a < soffice > link or executable is somewhere in one of
the following binary paths: /usr/bin, /usr/local/bin or /root/my-applications/bin.

Please note that my script works most of the time. Some extensions are still not
recognized, nothing will happen when you'll click on those. I couldn't figure out why.

Are Puppy's MIME-types wanting? Or maybe Puppy doesn't have enough default-this-
and-that-executable in /usr/local/bin?

Maybe RSH can apply his powerful brain Smile to solving the rest of this mystery!

In any case, we're lucky to have something, because before, there was nothing. Smile
(That's profound, don't you think?! I'm feeling philosophical this morning!) Smile

BFN.

musher0


i was about to report that the text files stopped responding. on the bright side, one such file's last mortal twitch was to open up geany with a file that had the info for default word processor ("take me instead"?). i didn't notice if it was the same file you specified above, but i changed it to "libreoffice4.2 --writer" and those files now work with no problem, it seems.

and yes, it's good to have something to work with--a ladder functions better against a wall than thrown down a well. also, real ladders are often sturdier than their imaginary counterparts.

[i'm feeling more groggy than philosophical, but you deserve the flower and your comment echoes the development of cultures. and many manufactured goods.]

Smile


and i agree: RSH taking an active interest in this is certainly a good omen.

on a related note, i wonder if Mochi's xml brilliance works with xbel files... (as perhaps was RSH).
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Sun 25 May 2014, 13:45    Post subject:  

A simple cure for those file ailments would be to have, in the defaultwordprocessor file:
soffice --writer || abiword .
That means : if soffice is present in your binary paths, use it; if not, fall back on abiword.

That way, if the user does not have LO or aOO installed, the file will open in abiword.
But the user who has Libre Office won't be frustrated!

Same goes for gnumeric.
soffice --calc || gnumeric

In defaultbrowser, perhaps
seamoney || firefox || palemoon || midori || opera

I'm sure you're getting the idea.

Why no Puppyist has thought of this simple trick before, only God knows! Smile

BFN.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1567
Location: nyc

PostPosted: Sun 25 May 2014, 13:53    Post subject:  

musher0 wrote:
A simple cure for those file ailments would be to have, in the defaultwordprocessor file:
soffice --writer || abiword .
That means : if soffice is present in your binary paths, use it; if not, fall back on abiword.

That way, if the user does not have LO or aOO installed, the file will open in abiword.
But the user who has Libre Office won't be frustrated!

Same goes for gnumeric.
soffice --calc || gnumeric

In defaultbrowser, perhaps
seamoney || firefox || palemoon || midori || opera

I'm sure you're getting the idea.

Why no Puppyist has thought of this simple trick before, only God knows! Smile

BFN.


thanks for the syntax lesson, musher.

uh, where on the keyboard is that pipe character?

edit: nevermind. only the logitech keyboard had it labeled as itself broken in the middle. still shows up as | regardless.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 6 of 14 [202 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, ..., 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.2500s ][ Queries: 13 (0.0454s) ][ GZIP on ]