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 Wed 01 Oct 2014, 04:32
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 1 of 9 [135 Posts]   Goto page: 1, 2, 3, ..., 7, 8, 9 Next
Author Message
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 585
Location: nyc

PostPosted: Wed 07 May 2014, 01:24    Post subject:  Add A JWM Bookmarks Menu or Submenu/Messing Around With JWM
Subject description: button, menu, and key tweaking: instantly access folders and files with specific programs
 

[it's got some navigation tweaks, too. 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
.]



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

Very Happy

screeny:




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

<!-- 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 MochiMoppelcontinues 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:
<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:
<Menu label="original menu" icon="" height="16">

right below

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


and
Code:
</Menu>


right above

Code:
</RootMenu>


squashes the whole thing down to one line, giving you more room to mess around. personally, i place the
Code:
</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:
<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:
<!-- 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.

Laughing

Last edited by Puppus Dogfellow on Sun 18 May 2014, 11:20; edited 3 times in total
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 585
Location: nyc

PostPosted: Mon 12 May 2014, 16:20    Post subject:  




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

Wink
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 585
Location: nyc

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

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:


<!-- 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:
<Key mask="AC" key="t">exec:roxterm</Key>
would probably be more useful to most as
Code:
<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:
<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:
<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, 01:39; edited 1 time in total
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 402
Location: Japan

PostPosted: Sat 17 May 2014, 03:26    Post subject:  

Puppus Dogfellow wrote:
my .jwmrc file is close to 3000 lines and constantly evolving
Laughing Puppus, you have a problem!
Quote:
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:
(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...
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 585
Location: nyc

PostPosted: Sat 17 May 2014, 10:06    Post subject:  

MochiMoppel wrote:
Puppus Dogfellow wrote:
my .jwmrc file is close to 3000 lines and constantly evolving
Laughing Puppus, you have a problem!


many. and quite a few issues, too. Razz

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

Quote:
Please try to use correct XML syntax. This is sufficiently messy:
Code:
(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.

Laughing
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 585
Location: nyc

PostPosted: Sat 17 May 2014, 23:21    Post subject:  

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

<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, 18:08; edited 3 times in total
Back to top
View user's profile Send private message 
musher0


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

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

Hi, guys!

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

BFN.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
greengeek

Joined: 20 Jul 2010
Posts: 2558
Location: New Zealand

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

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


Joined: 07 Jan 2013
Posts: 585
Location: nyc

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

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. Laughing
(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! Smile

BFN.

musher0


as usual, thanks for the encouragement.

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

Joined: 20 Jul 2010
Posts: 2558
Location: New Zealand

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

Dang, I was hoping you would get it sorted by dinner time Smile

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


Joined: 07 Jan 2013
Posts: 585
Location: nyc

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

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

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

Quote:
(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
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2558
Location: New Zealand

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

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

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


Joined: 11 Jun 2011
Posts: 2487
Location: Bulgaria

PostPosted: Sun 18 May 2014, 03:27    Post subject:  

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
Back to top
View user's profile Send private message MSN Messenger 
MochiMoppel


Joined: 26 Jan 2011
Posts: 402
Location: Japan

PostPosted: Sun 18 May 2014, 04:07    Post subject:  

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

Joined: 20 Jul 2010
Posts: 2558
Location: New Zealand

PostPosted: Sun 18 May 2014, 05:51    Post subject:  

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.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 9 [135 Posts]   Goto page: 1, 2, 3, ..., 7, 8, 9 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.1878s ][ Queries: 12 (0.0050s) ][ GZIP on ]