How do I do this _root_.jwmrc to _root_.jwmrc_old?SOLVED

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

How do I do this _root_.jwmrc to _root_.jwmrc_old?SOLVED

#1 Post by oldyeller »

Hello Everyone,

I have done a new Manna OS and I did a new menu for it, But I want users to be able to change it back to the original one which I have named _root_.jwmrc_old.

Can this be done by GUI. I would also like to have it show up with the menu when it is chosen.

Any help with this would be great Thanks
Last edited by oldyeller on Sun 12 May 2013, 17:47, edited 1 time in total.

R-S-H
Posts: 487
Joined: Mon 18 Feb 2013, 12:47

#2 Post by R-S-H »

Hi.

You can do this easily by having two files: the original and the modified. Put them in a special directory and just copy the wanted menu file to its location and execute fixmenus after this.

Here are two examples of how I do switch Openbox Menu:

Standard Menu

Code: Select all

#!/bin/sh

xdotool key alt+control+w
#rm /usr/share/applications/obmenuwrapper.desktop
cp -af /usr/share/applications-desktop-files/admin/openbox/obmenu-refresh-full-lp2.desktop /usr/share/applications-desktop-files/admin/obmenuwrapper.desktop
ln -s -f /usr/share/applications-desktop-files/admin/obmenuwrapper.desktop /usr/share/applications/obmenuwrapper.desktop
cp -af /usr/share/applications-desktop-files/admin/openbox/obmenu-refresh-std-lp2 /usr/bin/obmenu-refresh
sleep .1
fixmenus
xdotool key alt+control+w

exit 0
Full Menu

Code: Select all

#!/bin/sh

xdotool key alt+control+w
#rm /usr/share/applications/obmenuwrapper.desktop
cp -af /usr/share/applications-desktop-files/admin/openbox/obmenu-refresh-std-lp2.desktop /usr/share/applications-desktop-files/admin/obmenuwrapper.desktop
ln -s -f /usr/share/applications-desktop-files/admin/obmenuwrapper.desktop /usr/share/applications/obmenuwrapper.desktop
cp -af /usr/share/applications-desktop-files/admin/openbox/obmenu-refresh-full-lp2 /usr/bin/obmenu-refresh
sleep .1
fixmenus
xdotool key alt+control+w

exit 0
The xdotool command executes a key command defined to popup Openboxmenu by key command - so, I do immediately see the changed Openboxmenu on the screen.

I do use such stuff for several puposes - for example: switching option on/off to create a save file at first shutdown in LazY Puppy and some more...

RSH

Hope that helps
[b][url=http://lazy-puppy.weebly.com]LazY Puppy Home
The new LazY Puppy Information Centre[/url][/b]

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#3 Post by oldyeller »

Hi RSH,

this is what I end up doing

Code: Select all

 
cp -f /root/my-document/jwm1/_root_.jwmrc /etc/xdg/templates
fixmunes
restartwm
I did this in the cli, but I would like to do this with xmessage have it say menu1 or menu2 I will need to take a look at this and see what I can come up with.

Cheers

R-S-H
Posts: 487
Joined: Mon 18 Feb 2013, 12:47

#4 Post by R-S-H »

Hi.

As you might have noticed in the two examples: I do copy two files!

The second file is a .desktop file for a menu entry that shows the revert of the current used menu (to switch to it). So, if full menu is enabled, the menu shows option (entry) for standard and revert!

Just to make sure...
[b][url=http://lazy-puppy.weebly.com]LazY Puppy Home
The new LazY Puppy Information Centre[/url][/b]

R-S-H
Posts: 487
Joined: Mon 18 Feb 2013, 12:47

#5 Post by R-S-H »

By the way:

I think it is better to change this:

Code: Select all

cp -f /root/my-document/jwm1/_root_.jwmrc /etc/xdg/templates
to this

Code: Select all

cp -af /root/my-document/jwm1/_root_.jwmrc /etc/xdg/templates/
Note the '/' at the end of destination path and '-a' option to keep its properties/permissions (to keep it 'as is').
[b][url=http://lazy-puppy.weebly.com]LazY Puppy Home
The new LazY Puppy Information Centre[/url][/b]

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#6 Post by oldyeller »

Hi RSH,

This is what I have done

Code: Select all

#!/bin/sh


cp -af /usr/local/jwm1/_root_.jwmrc /etc/xdg/templates/
fixmenus
restartwm


exit 0
I changed the jwm1 to jwm2 for the other script and it all works great. Will put this in the next build.

Thanks

Post Reply