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

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

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

#1 Post by Puppus Dogfellow »

(it's got some navigation and windows manipulation tweaks as well)


this is the thread formerly known as Add A JWM Bookmarks Menu or Submenu
drastically innocuous menu tweaking: instant access to folders or files opened by specific programs

and more recently subtitled
button, menu, and key tweaking: instantly access folders and files with specific programs

__________



if you open .jwmrc (turns out that /etc/xdg/templates/_root_.jwmrc is likely a better choice--no fixmenus issue as described below) and insert something like:

Code: Select all

<Menu label="bookROXmarks" icon="/root/puppy-reference/buttons icons etc/bookmarks.png" height="16">
<Program label="~" icon="/root/puppy-reference/buttons icons etc/bookmarks.png">rox /root</Program>
<Program label="/" icon="/root/puppy-reference/buttons icons etc/bookmarks.png">rox /mnt/home</Program>
<Program label="mnt" icon="/root/puppy-reference/buttons icons etc/bookmarks.png">rox /mnt</Program>
<Program label="sc3" icon="/root/puppy-reference/buttons icons etc/th_jeff-foott-killer-whale-petroglyph_zps59d28c0f.jpg">libreoffice4.2 --writer /mnt/mmcblk0p2/Dropbox/ANCN/sc3.odt</Program>
<Program label="S" icon="/root/puppy-reference/buttons icons etc/bookmarks.png">rox /root/Startup</Program>
<Program label="applications" icon="/mnt/sda3/Copysda3/Copy/My Documents-20gigsync/Software/custon icons/IMAG0017.jpg">rox /usr/share/applications</Program>

<Program label="MMMMMM" icon="/root/puppy-reference/buttons icons etc/bookmarks.png">rox /mnt/home/precise-5.6.1/Dropbox/MMMMMMMMM</Program>

<Program label="custom icons" icon="/root/puppy-reference/buttons icons etc/ant nebula.jpg">rox "/root/puppy-reference/buttons icons etc"</Program>

<Program label="DWNLDSFFF" icon="/root/puppy-reference/buttons icons etc/babyElephant.jpg">rox "/mnt/sda2/downloadsFFFsda2"</Program>
<Program label="mtptempypalette" icon="mini-palette.xpm">mtpaint "/mnt/mmcblk0p2/Dropbox/small empty.png"</Program>
</Menu>


you get fast access to the folders of your choice or files opened by the programs of your choice. if the file name (target directory, file, or image) has spaces in it, use quotation marks around it. this model will give you instant access to applications, root, and home... it has libreoffice 4.2 opening a specific file, and mt paint opening a specific file (blank template); you'd need to alter these entries and the image icon choices to suit your machine and preferences. i included the browser download folder template because i just pasted this from one machine to another and needed to alter that. so, it works. it's also easy to repair, modify, and spread to other installations.

the whole chunk of text can be placed pretty much anywhere in the first 99 percent of the .jwmrc file in root--if you want it as a submenu, place it inside an existing menu. if you want it as its own menu, look for <menu> as an easy aid in seeing where one entry ends and other begins. or you could just put it at the top, right under

Code: Select all

<RootMenu label="Menu" labeled="false" height="24" onroot="3">
.

changing the rox command in the above examples allows you to open the directories with other file managers, so that's why i used JWM in the thread title. my own personal rox-reliant menu reflects what it contains and the aspect of it that is most likely to grow. highly mess aroundable. have fun.

:D

screeny:

Image


those towel over the stall bookmarks, the bright white ones, activate disciple's excellent bookmark script, which gives you both gtk and rox bookmarks in a configurable popup.


in short,

Code: Select all

<Program label="title on menu" icon="location of the image you want as an icon for the entry">program  "name of file or folder you want that program to open"</Program> 
is the template to make the menu do pretty much anything you want.
skip the "name of file you want that program to open" bit to just make it into a regular launcher. include the full path of the program if it itself is a hack, a script, or just something that got installed in a non-traditional location and is without a .desktop entry in usr/share/applications.


***

as has been correctly pointed out in this post, i'm ignoring
or am ambivalent about

Code: Select all

<!-- IMPORTANT, ONLY EDIT /etc/xdg/templates/_root_.jwmrc -->
,the warning that appears atop the .jwmrc file. Backing up the original file is a good idea, as is backing up the modded replacement (fixmenus will lose your changes; reboots and jwm restarts won't; the installation and removal of pets or sfs files will) and the newly created (and readily pastable) menu/menu fragment.

you can drag folders or files to an xpad or leafpad window to get the paths you can copy into the template, or you can go to
/root/.config/rox.sourceforge.net/ROX-Filer/ and open that file as text to easily get the rox locations you have bookmarked. the gtk bookmarks are located in /root/.gtk-bookmarks.


...hopefully this will soon be a bit less hackey...if MochiMoppel continues to provide feedback, that will surely be the case. As it stands, following the advice he gives there (use /etc/xdg/templates/_root_.jwmrc instead of .jwmrc) makes it persistent through all foreseeable natural stressors.

paste your custom menu in /etc/xdg/templates/_root_.jwmrc in a place that appears to correlate to where you want it in the actual menu. i'll post when i work out how to put submenus in the existing, stock menus without reverting to the previous method, or have anything else to add. as it stands, it's reliable, functional, and fast, and your own submenus will carry over if they are a part of a newly created menu entry. as an example of how simply this works: i just made some changes to my menu (in .jwmrc) and noticed that 1) i should give partview a more prominent position, and 2) i'm not using the latest partview. i saved the repositioned, old partview version of the .jwmrc file as 512.jwmrc, installed the pet, saved the 512.jwmrc file as .jwmrc, and did a jwm restart--the menu as i want it with the new pet installation reflected (and the harm taken out of the fixmenus command all pet and sfs installations appear to automatically run.) The same technique also worked for recent libreoffice pet and sfs installations.


thanks to MochiMoppel, puppy_apprentice, and disciple. etc.

(playing around with this stuff is too fun sometimes).

(and thanks, BarryK.)

***

You Must Restart JWM to See Your Changes.

edit: messing around, i find .jwmrc more accurately reflects one's customizations, but i'm not going to officially recommend going against the caution the file itself gives. i keep a separate document synced to the cloud and work on it from time to time, sharing the changes between computers. copy, paste, save--you'll eventually have so many menus that you'll be glad to lose a few from time to time.

also, changes in /etc/xdg/templates/_root_.jwmrc are more permanent, but can be corrected almost as easily (a simple "fixmenus" won't do it, but a file swap/rename is arguably just as simple) as the ones in .jwmrc--just make sure to keep a backup of the pristine version--using the skeletal structure isn't as intuitive as seeing the text of the menu laid out for you, and there's a bit of an extra delay before you see if maybe you may want to try again. if you get carried away with moving and pasting, it may just be easier to drop in the backup than try to undo what you've done.

both methods are pretty handy. and i personally back up both the most recent modded .jwmrc and the original (though the machine does the latter automatically. there's also a built in back up made for the _file in .../templates), but i guess the way to look at it is this: play around in .jwmrc and move the changes to /etc/xdg/templates/_root_.jwmrc when you are sure you want to keep them. nesting modded menus in the existing ones still works, but you (i'm guessing--will try it soon.) just have to comment out the placeholders for the existing menus so that you don't end up with duplicate slots for any of the original set (edit: nope, need a better guess. something more than that is needed to get rid of the originals...).



here's a template for a menu button:

Code: Select all

<TrayButton popup="bookmarks" icon="/root/.icons/rox-toolbar/reflection/bookmarks.png"border="true">exec:bm</TrayButton>
bm=name of script mentioned earlier placed in /root/my-applications/bin/bm.

the bookmarks pics in /root/.icons/rox-toolbar/reflection/bookmarks.png will work because as a guess it's in your puppy. more likely than the one i just swapped out...

menu buttons get placed in ~/.jwmrc-tray. you can put them, at least as far as i can tell, anywhere between the far left and the desktops, the active app bar and pod with the blinking lights and volume/battery icons, and between that thing and the clock. i haven't tried to move the clock over for it.

you can bind a key to the action/program/menu by heading back over to .jwmrc and scrolling towards the bottom, adding an (for this example) exec:bm key or changing something into one. if that works out, you can make the change more permanent by doing the same thing in /etc/xdg/templates/_root_.jwmrc.

helpful hint:

placing

Code: Select all

<Menu label="original menu" icon="" height="16">
right below

Code: Select all

<RootMenu label="Menu" labeled="false" height="24" onroot="3">
and

Code: Select all

</Menu>


right above

Code: Select all

</RootMenu>
squashes the whole thing down to one line, giving you more room to mess around. personally, i place the

Code: Select all

</Menu>
for the new "original menu" category right above the shutdown menu. that makes it easy for that last menu to swallow the next period of growth the rest of the root menu experiences (just move its title bar to right below

Code: Select all

<RootMenu label="Menu" labeled="false" height="24" onroot="3">
). plus, the shut down menu is pretty short and can be deposited easily into existing pipes. adding folders or websites to the main popup (i.e. without a pipe menu) is pretty convenient, but tends to eat space, hence this solution.

helpful hint 2:

Code: Select all

<!-- Virtual Desktops -->
<!-- Name tags can be contained within Desktops for desktop names.  BK: syntax change with jwm 500... -->
<Desktops  width="3" height="1"/>
inserted into the main menu or a submenu gives you a pipe to all your desktops.


i'm very fond of my menu.

:lol:


edit: here's an easy workaround for the consequences of ignoring the IMPORTANT, ONLY EDIT /etc/xdg/templates/_root_.jwmrc warning atop .jwmrc and here are possibly the easiest ways to access all your rox bookmarks through jwm.
Last edited by Puppus Dogfellow on Wed 06 May 2015, 06:14, edited 9 times in total.

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

#2 Post by Puppus Dogfellow »

Image


(my .jwmrc file is close to 3000 lines and constantly evolving)

:wink:

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

#3 Post by Puppus Dogfellow »

jwmrc-personal in /root/.jwm is a nice place to mess around with bookmarks. for the machine i'm currently typing on, i really only have access to eight function keys--something provided by a wireless mini-keyboard hook-and-loop-fastened (there's some adhesive involved as well) to a programmable keyboard too involved to reprogram/wouldn't want to unlearn the present shortcuts anyway. okay, so other than when i get up and go to the laptop this thing is connected to, i have eight function keys, which is generally eight more than i ever need. now at least they do something. here's my jwmrc-personal file in its current, nearly menu-obviating (i'm thinking of changing the title of the thread to "messing around with buttons, keys, and menus in jwm and rox" or something like that) form:

Code: Select all


<!-- Personally configurable options for JWM: these override default settings and theme settings -->

<JWM>

<!-- Number of virtual desktops  BK: syntax change with jwm 500... -->
<Desktops width="2" height="2"/>

<!-- Double click speed (in milliseconds) -->
<DoubleClickSpeed>400</DoubleClickSpeed>

<!-- Double click delta (in pixels) -->
<DoubleClickDelta>3</DoubleClickDelta>

<!-- The focus model (sloppy or click) -->
<FocusModel>click</FocusModel>

<!-- The snap mode (none, screen, or border) -->
<SnapMode distance="10">none</SnapMode>

<!-- The move mode (outline or opaque) -->
<MoveMode>outline</MoveMode>

<!-- The resize mode (outline or opaque) -->
<ResizeMode>outline</ResizeMode>

<!-- Key bindings -->

<Key mask="AC" key="b">exec:bm</Key>
<Key mask="AC" key="r">exec:rox /mnt/mmcblk0p2/Dropbox/MMMMMMMMM</Key>
<Key mask="AC" key="x">exec:xpad</Key>
<Key mask="AC" key="l">exec:leafpad</Key>
<Key mask="AC" key="g">exec:geany</Key>
<Key mask="AC" key="o">exec:libreoffice4.2 --writer /mnt/mmcblk0p2/Dropbox/ANCN/sc3.odt</Key>
<Key mask="AC" key="d">exec:"/mnt/sda2/downloadsFFFsda2/GoldenDict 1.5.0-RC-154-gc7cc9e4-i386"</Key>
<Key mask="AC" key="s">showdesktop</Key>
<Key mask="AC" key="m">root:3</Key>
<Key mask="AC" key="w">window</Key>
<Key mask="AC" key="t">exec:roxterm</Key>
<Key mask="AC" key="e">exec:mtpaint "/mnt/mmcblk0p2/Dropbox/small empty.png"</Key>
<Key mask="AC" key="z">exec:zensound</Key>
<Key mask="AC" key="n">exec:gnome-search-tool</Key>
<Key mask="AC" key="v">exec:partview</Key>
<Key mask="AC" key="y">/root/.Pup-Shots/.PupShots</Key>
<Key mask="AC" key="q">exec:notecase /mnt/mmcblk0p2/Dropbox/ANCN/Scaffolding/ncdSCAFF01/ncdSCAFF01.ncd</Key>
<Key mask="AC" key="k">exec:/root/Startup/htOPuRXVT</Key>

(this       <Key key="Up">up</Key>
section   <Key key="Down">down</Key>
              <Key key="Right">right</Key>
              <Key key="Left">left</Key>
              <Key key="h">left</Key>
              <Key key="j">down</Key>
is            <Key key="k">up</Key>
              <Key key="l">right</Key>
              <Key key="Return">select</Key>
stock)     <Key key="Escape">escape</Key>
	
<Key key="F12">root:3</Key> (this, too, is stock, but the key is undocumented).

<Key key="F11">exec:bm</Key>
<Key key="F10">window</Key>
<Key key="F9">exec:rox /mnt/mmcblk0p2/Dropbox/MMMMMMMMM</Key>

<Key key="F1">root:3</Key>
<Key key="F2">exec:bm</Key>
<Key key="F3">window</Key>
<Key key="F4">exec:rox /mnt/mmcblk0p2/Dropbox/MMMMMMMMM</Key>
<Key key="F5">exec:xpad</Key>
<Key key="F6">showdesktop</Key>
<Key key="F7">window</Key>
<Key key="F8">root:3</Key>

<Key mask="C" key="F1">window</Key>
<Key mask="C" key="F2">exec:geany</Key>
<Key mask="C" key="F3">root:3</Key>
<Key mask="C" key="F4">exec:leafpad</Key>
<Key mask="C" key="F5">maximize</Key>
<Key mask="C" key="F6">exec:pfind</Key>
<Key mask="C"  key="F8">exec:bm</Key>
<Key mask="C"  key="F7">exec:xpad</Key>

<Key mask="A" key="F1">move</Key>
<Key mask="A" key="F2">resize</Key>
<Key mask="A" key="F3">minimize</Key>
<Key mask="A" key="F4">close</Key>
<Key mask="A" key="F5">exec:"/mnt/sda2/downloadsFFFsda2/GoldenDict 1.5.0-RC-154-gc7cc9e4-i386"</Key>
<Key mask="A" key="F6">exec:gnome-search-toolminimize</Key>
<Key mask="A"  key="F7">exec:roxterm</Key>
<Key mask="A"  key="F8">exec:bm</Key>

<Key mask="A" key="Tab">next</Key> (stock)


</JWM>

Code: Select all

<Key mask="AC" key="t">exec:roxterm</Key>
would probably be more useful to most as

Code: Select all

<Key mask="AC" key="t">exec:urxvt</Key>
, as that's what's in most puppies.

i chose one of the most out of the way locations on my machine for my rox key for the same reason i think /mnt should be an entry on the main JWM window--gets you into the file manager and ~ and / are both just a click away. it's also good for those who want a puppy that doesn't revolve around rox so much. just take

Code: Select all

<Key mask="AC" key="r">exec:rox /mnt</Key>
and swap out the rox for pcman or thunor or whatever--you'll be dancing around rox in no time. personally, i've come to really like it. the right click menus are extensive and useful and i think it was worth getting used to. spacefm's cool, too.

you can also add S (shift--A is alt and C is ctrl; AC means the two are held down together. not sure how you tell the machine to look for sequential presses) into the mix, but you're on your own for the windows key (edit: maybe not)--from what i've read, it's not identifiable by a consistent key and is called various things by various machines...i haven't gotten up to reprogramming non reprogrammable keyboards yet...

this last one is a good example of making something that doesn't fit fit.

Code: Select all

<Key mask="AC" key="d">exec:"/mnt/sda2/downloadsFFFsda2/GoldenDict 1.5.0-RC-154-gc7cc9e4-i386"</Key>
was installed some time after i broke the original goldendict installation. reinstallation didn't work, so i tried a stand alone "release candidate" version. worked great, but was ignored by the menu. putting its location (in quotation marks in this case because of the space/break in the name) in the program slot integrates it and allows it to be launched from a key, button, or menu, even if it resides on some remote drive apart from the main system.
Last edited by Puppus Dogfellow on Sun 29 Jun 2014, 05:39, edited 1 time in total.

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

#4 Post by MochiMoppel »

Puppus Dogfellow wrote:my .jwmrc file is close to 3000 lines and constantly evolving
:lol: Puppus, you have a problem!
jwmrc-personal in /root/.jwm is a nice place to mess around
..but don't overdo it.
5 (!) new shortcuts just to open the main menu while deleting the default shortcut that would work in all Puppies (Alt+F1). How many do you need? How do you (or better:your fingers) remember them? And worse: If they do remember them, how will you ever be able to operate an uncustomized Puppy without constant surprises?

Please try to use correct XML syntax. This is sufficiently messy:

Code: Select all

(this       <Key key="Up">up</Key> 
 section   <Key key="Down">down</Key> 
 is            <Key key="k">up</Key> 
 stock)     <Key key="Escape">escape</Key>   
 <Key key="F12">root:3</Key> (this, too, is stock, but the key is undocumented).
Despite the funny round brackets (use <!--...--> for comments) all these shortcuts will work. No idea what "stock" means...

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

#5 Post by Puppus Dogfellow »

MochiMoppel wrote:
Puppus Dogfellow wrote:my .jwmrc file is close to 3000 lines and constantly evolving
:lol: Puppus, you have a problem!
many. and quite a few issues, too. :P
jwmrc-personal in /root/.jwm is a nice place to mess around
..but don't overdo it.
5 (!) new shortcuts just to open the main menu while deleting the default shortcut that would work in all Puppies (Alt+F1). How many do you need? How do you (or better:your fingers) remember them? And worse: If they do remember them, how will you ever be able to operate an uncustomized Puppy without constant surprises?
it's an ergo (kinesis) keyboard with the f1-f8 deal basically at my finger tips. the lettered shortcuts have a reason behind them, and more or less correspond to the letter i've chosen in some way. the others are laid out by what buttons are more important to me--those are the ones that are most easily reached. i confess i didn't know about ALT+F1 being the same as F12. not only do my fingers tend to remember what i've laid out, they remember them with their slight differences from set up to set up (this may be from the machine i messed around with most, but they're all pretty messed around with). anyway, this way i have a big template laid out, and i can adjust as i go. i seriously have never used the function keys in puppy until two weeks ago (which is when i discovered the F12 key). how other puppies use them wouldn't affect me.

if it makes you feel better, i think i've messed up the search command on one machine's geany: looks like i have to check its files for control+f silliness of some sort--think it screwed up searching a browser page as well. (geany work around is the search box, but i guess i should just try to find the conflict--on that machine it can be in any of three or four files, i think...).
Please try to use correct XML syntax. This is sufficiently messy:

Code: Select all

(this       <Key key="Up">up</Key> 
 section   <Key key="Down">down</Key> 
 is            <Key key="k">up</Key> 
 stock)     <Key key="Escape">escape</Key>   
 <Key key="F12">root:3</Key> (this, too, is stock, but the key is undocumented).
Despite the funny round brackets (use <!--...--> for comments) all these shortcuts will work. No idea what "stock" means...
sorry--my normal language parentheses weren't inserted to be taken as part of the code--the "code" tag made it so i couldn't highlight it with another color. didn't try boldface...

anyway, stock is more car jargon than computer lingo, i guess. i put the notation there to allow people unfamiliar with the file to see where i put my additions. stock = unmodified, i.e. the way it comes from the factory, so to speak.


thanks for your interest, Mochi.

:lol:

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

#6 Post by Puppus Dogfellow »

Code: Select all

<Key mask="A" key="1">desktop#1</Key>
<Key mask="A" key="2">desktop#2</Key>
<Key mask="A" key="3">desktop#3</Key>
<Key mask="A" key="4">desktop#4</Key>
<Key mask="A" key="5">desktop#5</Key>
<Key mask="A" key="6">desktop#6</Key>
<Key mask="A" key="7">desktop#7</Key>
<Key mask="A" key="8">desktop#8</Key>
<Key mask="A" key="9">desktop#9</Key>
<Key mask="A" key="0">desktop#10</Key>
[pretty easy way to get from desktop to desktop; as before, inserted into jwmrc-personal. of course, make sure it doesn't conflict with other key cuts you may be using so you don't confuse your machine.]

not sure why we're given a built-in next window shortcut but not a previous window one, so here's a set:

Code: Select all

<Key mask="A" key="Tab">next</Key>
<Key mask="C" key="Tab">prev</Key>

edit: for whatever reason, the shortcut to desktop ten doesn't work (0 for 2) in either the above form or in Key mask="AC" key="9">desktop#10</Key> form...you may want to keep to eight or fewer...maybe "desktop#0" is how the machine identifies ten...
Last edited by Puppus Dogfellow on Sun 18 May 2014, 22:08, edited 3 times in total.

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

#7 Post by musher0 »

Hi, guys!

Nice initiative! Gnome & Co. have a "Places" sub-menu, so this is just what the vet
ordered for Puppy! :)

BFN.

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

#8 Post by greengeek »

Hi Puppus, this looks really interesting! Congratulations on pushing the boundaries. This sort of thing is really inspiring and I can think of a few applications for it. A challenge springs to mind - do you think it would be possible to use this to "bookmark" a storage drive by UUID?

If that were possible I could immediately navigate to a specific usb stick, not caring if it was being called sdb1, sdb2, sde4 or whatever. (I have several puppies on my machine and they do not allocate the same sdx number to a specific usb drive - it seems to depend upon which order they activate the usb hubs).

I know that my music folder is always on the same usb stick so if I could go straight to that stick without knowing what sdx number it was currently assigned I would be extremely happy.

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

#9 Post by Puppus Dogfellow »

greengeek wrote:Hi Puppus, this looks really interesting! Congratulations on pushing the boundaries. This sort of thing is really inspiring and I can think of a few applications for it. A challenge springs to mind - do you think it would be possible to use this to "bookmark" a storage drive by UUID?

If that were possible I could immediately navigate to a specific usb stick, not caring if it was being called sdb1, sdb2, sde4 or whatever. (I have several puppies on my machine and they do not allocate the same sdx number to a specific usb drive - it seems to depend upon which order they activate the usb hubs).

I know that my music folder is always on the same usb stick so if I could go straight to that stick without knowing what sdx number it was currently assigned I would be extremely happy.
i'm pretty sure it can be done but entirely sure i don't know how. good luck. :lol:
(i had to look up uuid, but--get a script that says, "hey, mount this [thing identified in a specific manner] and open with..."? that could be bookmarked.)
musher0 wrote:Hi, guys!

Nice initiative! Gnome & Co. have a "Places" sub-menu, so this is just what the vet
ordered for Puppy! :)

BFN.

musher0
as usual, thanks for the encouragement.
Last edited by Puppus Dogfellow on Sun 18 May 2014, 04:52, edited 1 time in total.

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

#10 Post by greengeek »

Dang, I was hoping you would get it sorted by dinner time :-)

Here is my thinking - lets say your bookmark system is capable of bookmarking "sdm1" as a destination. I could assign 'sdm1' as my music drive. If there was then some way of forcing puppy to mount a specific UUID as "sdm1" it would be perfect. (m=music - get it?)

Then I could assign the following:
sdd1 as my "document" drive
sdt1 as "Toms" data drive
sdp1 as "Peters" data drive

sdm1 would be MY music drive but sdm2 and sdm3 would be someone else's music drive - lets face it, who wants to listen to Nickelback or The back street boys?

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

#11 Post by Puppus Dogfellow »

greengeek wrote:Dang, I was hoping you would get it sorted by dinner time :-)

Here is my thinking - lets say your bookmark system is capable of bookmarking "sdm1" as a destination. I could assign 'sdm1' as my music drive. If there was then some way of forcing puppy to mount a specific UUID as "sdm1" it would be perfect. (m=music - get it?)

Then I could assign the following:
sdd1 as my "document" drive
sdt1 as "Toms" data drive
sdp1 as "Peters" data drive

sdm1 would be MY music drive but sdm2 and sdm3 would be someone else's music drive - lets face it, who wants to listen to Nickelback or The back street boys?
i added
(i had to look up uuid, but--get a script that says, "hey, mount this [thing identified in a specific manner] and open with..."? that could be bookmarked.)


as you posted. it's beyond my abilities (i can't code at all) but i have a feeling musher could write something for you that could do it. i can vaguely remember reading an issue like yours--someone wanted to rename the drives or have them consistently named. i'm not sure how good your coding skills are, but short of asking someone do write something for you, that may be part of the route you may want to take...

:wink:

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

#12 Post by greengeek »

Puppus Dogfellow wrote: i'm not sure how good your coding skills are, but short of asking someone do write something for you, that may be part of the route you may want to take...
I do know how good my coding skills are and quite frankly they are not good at all :-) I was hoping musher0 might come to the party and hack up some code (he has provided me with some unmount code in the past and it worked really well, so I guess it is just a question of reversing that for the mount function.... ) 8)

No pressure musher0...

EDIT :There would have to be a 2-step process:
1) It would be necessary to have a "reservation list" - so that the user could reserve certain sdx designations eg sdd1, sdm1, sdm2, sdp1
2) There would need to be some way to get puppy drive mounter (pmount and drive_all?) to consult that reservation list before allocating the sdx number (sort of like MAC reservation on network allocation of IP addresses...)

Just spitballin' here - just an idea that popped into my head when I saw what you were doing with the bookmarks..

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

#13 Post by saintless »

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

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

#14 Post by MochiMoppel »

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

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

		<Program label="BOOTPARTITION"	icon="usb16.xpm">
			. /etc/rc.d/PUPSTATE
			rox /mnt/$PDEV1
		</Program>

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

#15 Post by greengeek »

Sorry - didn't mean to distract from the bookmarks idea. Interesting things here for me to try.. Going to take me a while to digest.

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

#16 Post by greengeek »

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..
Attachments
music-on-flash.jpg
(162.77 KiB) Downloaded 749 times

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

#17 Post by musher0 »

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

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

		<Program label="BOOTPARTITION"	icon="usb16.xpm">
			. /etc/rc.d/PUPSTATE
			rox /mnt/$PDEV1
		</Program>
Right on the ball, MochiMoppel ! :) Important breakthrough, too ! :) 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
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

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

#18 Post by musher0 »

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.
Attachments
Zorin_OS_gnome_desktop(part).jpg
(11.3 KiB) Downloaded 680 times
Last edited by musher0 on Sun 18 May 2014, 18:42, edited 1 time in total.
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

#19 Post by Puppus Dogfellow »

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

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

#20 Post by saintless »

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

		<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.
Last edited by saintless on Sun 18 May 2014, 15:58, edited 1 time in total.

Post Reply