LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-28-2011, 07:48 PM   #1
MystKid
Member
 
Registered: Dec 2010
Posts: 51

Rep: Reputation: 0
switching DE/WM without killing X


hello guys i have been using fluxbox and openbox in slackware and i have seen that the fluxbox menu by default it has a menu entry that lets tyou switch from fluxbox to openbox,twm,kde and so on with a simple click. i was wondering if there is a way of adding an option like that in openbox menu. the flusbox menu entryes for switching WM/DE look like this:
Code:
[submenu] (Window Managers)
      [restart] (openbox) {openbox-session}
      [restart] (mwm) {mwm}
      [restart] (twm) {twm}
      [restart] (compiz) {compiz}
      [restart] (kde) {startkde}
      [restart] (fvwm) {fvwm}
      [restart] (xfce4) {startxfce4}
      [restart] (fvwm2) {fvwm2}
      [restart] (blackbox) {blackbox}
      [restart] (windowmaker) {wmaker}
[end]
 
Old 02-28-2011, 10:22 PM   #2
Mol_Bolom
Member
 
Registered: Nov 2008
Location: S.W. Kansas
Distribution: Slackware64 14.0 / 14.2
Posts: 243
Blog Entries: 2

Rep: Reputation: 41
Looks like it is possible. Have a look at openbox's wiki.
Restart section of Openbox's wiki.
Code:
Restart
Restarts Openbox. This starts a new copy of Openbox, and can be used to upgrade to a newly installed version without logging out of your X session. It can also be used to start another window manager.
Option	Default Value	Description
<command>	""	A string which is the command to be executed as the new window manager, along with any arguments to be passed to it.
Example:
<keybind key="W-F12">
  <action name="Restart"/>
</keybind>
<keybind key="W-F11">
  <action name="Restart"><command>firebox</command></action>
</keybind>
 
Old 03-01-2011, 09:40 AM   #3
MystKid
Member
 
Registered: Dec 2010
Posts: 51

Original Poster
Rep: Reputation: 0
so to start another WM like fluxbox from openbox? what would the command be
 
Old 03-01-2011, 01:56 PM   #4
Mol_Bolom
Member
 
Registered: Nov 2008
Location: S.W. Kansas
Distribution: Slackware64 14.0 / 14.2
Posts: 243
Blog Entries: 2

Rep: Reputation: 41
Quote:
Originally Posted by MystKid View Post
so to start another WM like fluxbox from openbox? what would the command be
Note the next line from your first post.

Code:
     [restart] (twm) {twm}
Now look at the Openbox configure lines.

Code:
<keybind key="W-F11">
  <action name="Restart"><command>firebox</command></action>
</keybind>
So adding a window manager in a menu would be basically the same.

Code:
<menu>
     <item label="Menu item name here">
          <action name="Restart"><command>window manager program name here</command></action>
     </item>
</menu>
I'll test it on my openbox and report back here.
<Edit> Yep, that's it. Just add something like that into the menu xml file in ~/.config/openbox, or wherever else your configurations might be.

Last edited by Mol_Bolom; 03-01-2011 at 01:59 PM.
 
Old 03-01-2011, 02:48 PM   #5
MystKid
Member
 
Registered: Dec 2010
Posts: 51

Original Poster
Rep: Reputation: 0
<item label="FluxBox">
<action name="Restart">
<command>
fluxbox
</command>
</action>
this is what i tryed and nothing happens when i click on it
 
Old 03-01-2011, 02:55 PM   #6
MystKid
Member
 
Registered: Dec 2010
Posts: 51

Original Poster
Rep: Reputation: 0
<menu>
<item label="fluxbox">
<action name="Restart"><command>fluxbox</command></action>
</item>
</menu>
both of these didnt work

Last edited by MystKid; 03-01-2011 at 02:58 PM.
 
Old 03-01-2011, 09:02 PM   #7
Mol_Bolom
Member
 
Registered: Nov 2008
Location: S.W. Kansas
Distribution: Slackware64 14.0 / 14.2
Posts: 243
Blog Entries: 2

Rep: Reputation: 41
Huh. Odd. I tried it with...
Code:
<item label="Start Echinus Window Manager">
	<action name="Restart">
		<command>echinus</command>
	</action>
</item>
Just before the Reconfigure men item.

Try adding the path and see if that works. For Slackware on my system it would be something like...

Code:
<item label="Start Echinus Window Manager">
	<action name="Restart">
		<command>/usr/bin/fluxbox</command>
	</action>
</item>
If that doesn't work, then try to give me some more information, such as where your menu.xml file is located, if the console shows any errors ( Most systems that's CTL+ALT+F1 ), if there is a menu item for Fluxbox, version of openbox your using, or any other information you can think of that might be helpful.
 
Old 03-02-2011, 10:55 AM   #8
MystKid
Member
 
Registered: Dec 2010
Posts: 51

Original Poster
Rep: Reputation: 0
ok i have tryed that and it actually loads fluxbox but it loads it on top of openbox so i still have the openbox tint2 panel loaded.
 
Old 03-02-2011, 11:25 AM   #9
Mol_Bolom
Member
 
Registered: Nov 2008
Location: S.W. Kansas
Distribution: Slackware64 14.0 / 14.2
Posts: 243
Blog Entries: 2

Rep: Reputation: 41
Quote:
Originally Posted by MystKid View Post
ok i have tryed that and it actually loads fluxbox but it loads it on top of openbox so i still have the openbox tint2 panel loaded.
Yeah, I noticed this as well last night when I opened openbox before shutting down the computer.

Might be possible to run a script instead. One that would kill tint2's process.

Code:
# kill $(ps -C tint2 -o pid=)
Though, I am not a guru when it comes to "kill", so you might use "ps -C tint2" in a terminal a few times to make sure it only prints tint2's information. If it does, then a simple script could be written to kill tint2 and run fluxbox. Going to try a couple of things myself and see what happens...
 
Old 03-02-2011, 11:55 AM   #10
Mol_Bolom
Member
 
Registered: Nov 2008
Location: S.W. Kansas
Distribution: Slackware64 14.0 / 14.2
Posts: 243
Blog Entries: 2

Rep: Reputation: 41
Ok, I wrote a script for only killing the process (using lxpanel rather than tint2, but I'm sure it should work as well). Then I added in two commands instead of only one.

Code:
<item label="Start Echinus Window Manager">
	<action name="Execute">
		<command>sh ~/scripts/killit.sh lxpanel</command>
	</action>
	<action name="Restart">
		<command>echinus</command>
	</action>
</item>
The first <action> runs the command sh with arguments "~/scripts/killit.sh" and "lxpanel", which will kill lxpanel.
The second <action> then exits openbox and restarts into echinus.

Here's the script I wrote. (Again, I'm no expert with kill and ps, so be sure to read and understand the man pages before attempting this.
If anyone who is experienced with running ps and kill in this way and happens to be reading this, please chime in with some helpful hints).

Code:
#!/bin/bash

if [ "$1" = "" ]
then
	echo "Can not do\n"
else
	PROCESS=$(ps -C $1 -o pid=)
	if [ "$PROCESS" = "" ]
	then
		echo "No process $1."
	else
		kill $PROCESS
	fi
fi
Also, it may be more prudent "not" to leave this so ambiguous. Instead have the script kill tint2 explicitly.

Code:
#!/bin/bash
kill $(ps -C tint2 -o pid=)
This way it kills only tint2, and there can be no accidents with running the script with something else.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Its killing me demilade Linux - Hardware 3 12-29-2007 03:30 PM
KDE 3.3 Bad Monitor Switching on Desktop Switching Inchoate Linux - Software 1 05-25-2005 02:00 PM
This is killing me UncleEricB Linux - Networking 2 02-01-2005 09:41 PM
killing X jabberwock486 Linux - Newbie 7 09-10-2003 11:59 AM
Killing X ? sp0t Linux - Newbie 7 08-17-2002 07:53 AM


All times are GMT -5. The time now is 12:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration