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 Fri 22 Aug 2014, 02:02
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How do I do this _root_.jwmrc to _root_.jwmrc_old?SOLVED
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [6 Posts]  
Author Message
oldyeller


Joined: 15 Nov 2011
Posts: 779
Location: Mishawaka IN

PostPosted: Sat 11 May 2013, 17:33    Post subject:  How do I do this _root_.jwmrc to _root_.jwmrc_old?SOLVED
Subject description: for code to change one to another
 

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, 13:47; edited 1 time in total
Back to top
View user's profile Send private message 
R-S-H

Joined: 18 Feb 2013
Posts: 490

PostPosted: Sat 11 May 2013, 19:22    Post subject:  

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:
#!/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:
#!/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

_________________
LazY Puppy Home
The new LazY Puppy Information Centre

Back to top
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 779
Location: Mishawaka IN

PostPosted: Sat 11 May 2013, 20:51    Post subject:  

Hi RSH,

this is what I end up doing

Code:

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

Joined: 18 Feb 2013
Posts: 490

PostPosted: Sat 11 May 2013, 21:07    Post subject:  

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

_________________
LazY Puppy Home
The new LazY Puppy Information Centre

Back to top
View user's profile Send private message 
R-S-H

Joined: 18 Feb 2013
Posts: 490

PostPosted: Sat 11 May 2013, 22:06    Post subject:  

By the way:

I think it is better to change this:
Code:
cp -f /root/my-document/jwm1/_root_.jwmrc /etc/xdg/templates

to this
Code:
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').

_________________
LazY Puppy Home
The new LazY Puppy Information Centre

Back to top
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 779
Location: Mishawaka IN

PostPosted: Sun 12 May 2013, 13:46    Post subject:  

Hi RSH,

This is what I have done

Code:

#!/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
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [6 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.0535s ][ Queries: 12 (0.0045s) ][ GZIP on ]