Notices


Reply
Thread Tools
Benson's Avatar
Posts: 4,930 | Thanked: 2,271 times | Joined on Oct 2007
#21
You can do iiiedokeiii's install script, which prevents matchbox from restarting; this isn't necessarily the best option though, because if matchbox dies from a crash or something, you could be stuck with no window manager at all.

If you read through the whole thread, you'll see a couple of options to avoid that; the one in post 15 is what I currently use, as I think it's the best option.

I think the CPU applet iiiedokeiii mentioned is the same one I use; it's full name is osso-statusbar-cpu. You can also use Personal Menu or Personal Launcher to run arbitrary commands.

With any of those, you should be able to select a menu item that will run a script; you can have that script either shut matchbox down cleanly (as above) or kill it, as you like, and then start FVWM. You can also have another entry to stop FVWM and restart Matchbox.
 

The Following User Says Thank You to Benson For This Useful Post:
Posts: 33 | Thanked: 1 time | Joined on Aug 2008 @ South Carolina
#22
Benson,

Thanks....I feel like such a leech, so I am apologizing up front.

You posted this Code:
chroot /mnt/initfs dsmetool --stop="$(tr '\000' ' ' </proc/`pidof matchbox-window-manager`/cmdline|sed 's/ $//')"

So a few questions:

-- So does this go into a script text file?
-- What is the extension of that file?
-- And you call it with....sh "filename.sh"...or..?
-- The CPU status bar then hold a button that you put that above command in and it executes it.
-- This one looks like the stop....so is there a start one..?
-- Should I remove part of the stuff that iiiedokeiii's did in his install script that changed the restart of matchbox..
-- When you exit FVWM how do you restart Matchbox....doesnt that leave you with no window manager...?
-- What file under FVWM to I set the resolution of the desktop I want....say 1280x1024 or 1024x768...?

I know there are alot of questions, but I hate to bother you guys will onsey twosey questions constantly....I am sure I will be asking more....let me know when it gets annoying.

Steve
 
Benson's Avatar
Posts: 4,930 | Thanked: 2,271 times | Joined on Oct 2007
#23
Yeah, I wouldn't use that one, because it is stop only.

The next post down is really the recommended one. You dump that in a file (extension doesn't matter), make it executable with chmod +x <filename>, and then call it as /path/to/filename start or /path/to/filename stop. (If you don't make it executable, you can still run it with sh filename start, as you suggested, but it's tidier to set execute permissions.) You have to be root to start and stop that though, so either this, or the other script that you run via osso-statusbar-cpu will have to get root.

To actually axe matchbox and start F, you'll need a script that ensures it's root, runs the matchbox stopper, and starts F; mine looks like this: (I have the above script installed as /usr/bin/matchbox.)
/home/user/bin/mbfv
Code:
#!/bin/sh
sudo gainroot << E_O_F
/usr/bin/matchboxwm stop
/usr/local/bin/fvwm2
E_O_F
/home/user/bin/fvmb
Code:
#!/bin/sh
sudo gainroot << E_O_F
killall fvwm2
/usr/bin/matchboxwm start
E_O_F
And I have two entries in osso-statusbar-cpu; one's named FVWM, and has a commandline /home/user/bin/mbfv, the other is named Matchbox and has /home/user/bin/fvmb.

For configuring F, you edit .fvwm2rc; you can set number and size of desktops. Unlike most WMs, F lets you have any combination of virtual and multiple desktops. (The essential distinctions are that you can pan incrementally in a virtual desktop, but only switch between multiple desktops, and that apps hanging over a screenful of virtual desktop show up in the next screenful, while apps hanging off the edge of a desktop don't show up in any other virtual desktop.) The config you've got should make (I think) 5 desktops, each the size of your screen. At least that's what I'm running right now. If you wanted to display large windows without scrollbarring them, for some reason, you could set that to fewer (or even more...) larger desktops, but scrollbarring works fine for me.

FVWM is very configurable, and the config file may be correspondingly intimidating, but it's really not that bad once you get into it.

One thing it occurred to me I do have custom is three-button stylus support. See the code below: you paste the green lines into the relevant region in your .fvwm2rc; you'll get a button in the window titlebars that lets you pick what mouse button the stylus is. (And that button works regardless of which mouse button you use, so you can actually switch back; version 1 was somewhat awkward that way... )


This one defines the button, or rather the (vector) icon on it.
Code:
ButtonStyle 1 5 45x45@1 55x45@1 55x55@0 45x55@0 45x45@1 # Dot
ButtonStyle 2 5 25x25@1 25x75@1 75x75@0 75x25@0 25x25@1 # Big Box
ButtonStyle 4 4 50x65@1 35x35@1 65x35@1 50x65@0 # small down triangle
ButtonStyle 3 13 25x25@1 41x25@1 41x50@0 41x25@0 59x25@1 59x50@0 59x25@0 75x25@1 75x55@0 60x80@0 40x80@0 25x55@1 25x25@1 # Mouse

#ButtonStyle * 4 50x35@1 65x65@0 35x65@0 50x35@1 # Small up Triangle
#ButtonStyle * 4 50x65@1 35x35@1 65x35@1 50x65@0 # Small down Triangle
#ButtonStyle * 4 50x25@1 75x75@0 25x75@0 50x25@1 # Large up Triangle
#ButtonStyle * 4 50x75@1 25x25@1 75x25@1 50x75@0 # Large down Triangle
Add an option to exit FVWM but restart Matchbox through FVWM options rather than osso-statusbar-cpu...
Code:
# This menu is invoked as a sub-menu - it allows you to quit,
# restart, or switch to another WM.
AddToMenu "Quit-Verify" "Really Quit Fvwm? " Title
+              "Yes, Really Quit " Quit
+              "Restart fvwm " Restart fvwm2
+              "Restart fvwm 1.x" Restart fvwm
+              "Start matchbox " Restart /usr/bin/matchboxwm start
+              "" Nop
+              "No, Don't Quit " Nop

Add the input menu to the desktop pop-up menu -- not really needed, but convenient. And at the bottom is the menu itself. Xvkbd is the onscreen keyboard I use, but with an N810, you may not want that. Remove the last 2 lines to dump it.
Code:
# This menu will fire up some very common utilities
AddToMenu "Utilities" "Utilities " Title
+              "Xterm " Exec exec xterm -e /bin/sh&
+              "Rxvt " Exec exec rxvt -fn 6x13 -rv -e /bin/bash&
+              "Calculator " Exec exec xcalc &
+              "Xman " Exec exec xman &
+              "Xmag " Exec exec xmag &
+              "" Nop
+              "Input " Popup Input
+              "" Nop
+              "Modules" Popup Module-Popup
+              "" Nop
+              "Exit Fvwm " Popup Quit-Verify

AddToMenu "Input" "Input " Title
+              "Button 1 " Exec exec xmodmap -e 'pointer = 1 2 3'
+              "Button 2 " Exec exec xmodmap -e 'pointer = 2 3 1'
+              "Button 3 " Exec exec xmodmap -e 'pointer = 3 1 2'
+              "" Nop
+              "Xvkbd" Exec exec xvkbd &
OK, here's where we actually assign a command (popping up the menu) to all mouse clicks on that button:
Code:
#
# On Appilcation Window Decoration
#
#     Button    Context Modifi  Function
# the title bar buttons
Mouse 0         1       A       Menu Window-Ops Close
Mouse 0         2       A       Maximize-Func
Mouse 0         3       A       Menu Input Nop
Mouse 0         4       A       Iconify
# titlebar
Mouse 1         T       A       Move-or-Raise
Mouse 2         T       A       Menu Window-Ops2 Nop
# rest of the frame
Mouse 1         FS      A       Resize-or-Raise
Mouse 2         FS      A       Menu Window-Ops2 Nop
# Icon
Mouse 1         I       A       Move-or-Iconify
Mouse 2         I       A       Menu Window-Ops2 Iconify
# anything
Mouse 3         TSIF    A       RaiseLower
And I think that's all the reasonably non site-local changes I made...

Last edited by Benson; 2008-10-03 at 17:07.
 

The Following 3 Users Say Thank You to Benson For This Useful Post:
Posts: 33 | Thanked: 1 time | Joined on Aug 2008 @ South Carolina
#24
OMG.....thanks so much....!!

Am so grateful for this.....I have printed it out and will be digesting this tonite.....

Thanks again....that was a lot of thought.

Will let you know how it goes....

Steve
 
BrentDC's Avatar
Posts: 903 | Thanked: 630 times | Joined on Apr 2008
#25
Benson,

I don't know if you are familiar with PokerTH, but someone on ITT recently ported it to Hildon.

There is one major problem with it though, and that is everytime the turn comes to you, the keyboard pops up. Very frustrating.

So, the most elegant way I found to stop this from happening was to kill hildon-input-method via "/etc/osso-a-init/keyboard.sh stop" while using the game. Originally, I wrote a simple "script" that would see if hildon-input-method was running, and if it was kill it, else start it.

This was still a bit of a pain because you'd have to run this script everytime you were done with the game to restart your keyboard (you could automatically run it when PokerTH started to kill your keyboard).

So today, I spent an hour seeing if I could automate the whole process. And after a bit and trial and error, I came up with this:

Code:
#!/bin/sh

KEYBOARD=`pidof hildon-input-method`
POKERTH=`pidof pokerth`

if [ "$POKERTH" ]
then
	echo "PokerTH is already started, exiting..."
	exit 0
else

	if [ "$KEYBOARD" ] 
	then
		/etc/osso-af-init/keyboard.sh stop
		echo "Starting PokerTH..."
		/usr/local/games/PokerTH-0.6.2/pokerth.sh

		while [ "$POKERTH" ]
			do
			echo "Debugger: If you see this text, there is a problem"
			sleep 300
		done

		/etc/osso-af-init/keyboard.sh start
	else
		echo "hildon-input-method is stopped."

		if [ "$POKERTH" ]
			then
			echo "Killing PokerTH..."
			kill $POKERTH
		fi
		echo "Starting hildon-input-method..."
		/etc/osso-af-init/keyboard.sh start
	fi
fi

exit 0
Please disregard the while loop, I put it in there before I knew what I was doing

As you can probably see, my script calles PokerTH on line 15, and when PokerTH is killed control "returns" to my script and hildon-input-method is started back up. Ok, this is the second script I've ever written, be easy

Couldn't this exact same philosophy be applied to killing hildon-desktop, starting fvwm, then when fvwm quits, restarting hildon-desktop?

Please point out where my logic is flawed
__________________
-Brent

Author of TouchSearch -- web searching software for Maemo 5.

Mobile Device lineage: Palm Z22 -> Palm TX -> Nokia N800 -> Nokia N900
 
Posts: 33 | Thanked: 1 time | Joined on Aug 2008 @ South Carolina
#26
Benson,

I have tried to do all of this.....but I cant get it to shutdown matchbox. So I tried to do it all manually......I got root and typed in everything at the prompt....ie /usr/bin/matchboxwm stop.....but it just went back to the prompt. So then I manually typed in the below script....one by one....and none of them errored out, but still didnt get rid of matchbox.....

This is what I put into the file.....and also tried to put in manually.

#!/bin/sh
. /etc/osso-af-init/af-defines.sh
. /etc/osso-af-init/matchbox.defs
. /etc/osso-af-init/matchbox.sh


The script file I called matchboxwm and made it executable, but it doesnt do anything. I tried to run the commands above one at a time with Stop and it looks like it took them, but nothing happened....really frustating.

It is like it takes the commands, but doesnt do anything with them....is there something I mind need to load that I havent....?

Any thoughts would be appreciated....as I am stuck.

Steve
 
Posts: 33 | Thanked: 1 time | Joined on Aug 2008 @ South Carolina
#27
Benson,

If I get root....then change to /home/user/bin and then type: /home/user/bin/mbfv

I get this error:
/bin/sh: /home/user/bin/mbfv: not found

if I do a ls in the directory, both files are there: mbfv and fvmb

So why does it tell me it is not there....if it is...?

Steve
 
Benson's Avatar
Posts: 4,930 | Thanked: 2,271 times | Joined on Oct 2007
#28
Could be something it calls is not found; is the matchbox script above saved as /usr/bin/matchboxwm, and made executable?

Also, the "stop" must be lowercase, whereas you typed "Stop" above.
 
Benson's Avatar
Posts: 4,930 | Thanked: 2,271 times | Joined on Oct 2007
#29
Originally Posted by BrentDC View Post
Benson,

I don't know if you are familiar with PokerTH, but someone on ITT recently ported it to Hildon.

There is one major problem with it though, and that is everytime the turn comes to you, the keyboard pops up. Very frustrating.

So, the most elegant way I found to stop this from happening was to kill hildon-input-method via "/etc/osso-a-init/keyboard.sh stop" while using the game. Originally, I wrote a simple "script" that would see if hildon-input-method was running, and if it was kill it, else start it.

This was still a bit of a pain because you'd have to run this script everytime you were done with the game to restart your keyboard (you could automatically run it when PokerTH started to kill your keyboard).

So today, I spent an hour seeing if I could automate the whole process. And after a bit and trial and error, I came up with this:

Code:
#!/bin/sh

KEYBOARD=`pidof hildon-input-method`
POKERTH=`pidof pokerth`

if [ "$POKERTH" ]
then
	echo "PokerTH is already started, exiting..."
	exit 0
else

	if [ "$KEYBOARD" ] 
	then
		/etc/osso-af-init/keyboard.sh stop
		echo "Starting PokerTH..."
		/usr/local/games/PokerTH-0.6.2/pokerth.sh

		while [ "$POKERTH" ]
			do
			echo "Debugger: If you see this text, there is a problem"
			sleep 300
		done

		/etc/osso-af-init/keyboard.sh start
	else
		echo "hildon-input-method is stopped."

		if [ "$POKERTH" ]
			then
			echo "Killing PokerTH..."
			kill $POKERTH
		fi
		echo "Starting hildon-input-method..."
		/etc/osso-af-init/keyboard.sh start
	fi
fi

exit 0
Please disregard the while loop, I put it in there before I knew what I was doing

As you can probably see, my script calles PokerTH on line 15, and when PokerTH is killed control "returns" to my script and hildon-input-method is started back up. Ok, this is the second script I've ever written, be easy

Couldn't this exact same philosophy be applied to killing hildon-desktop, starting fvwm, then when fvwm quits, restarting hildon-desktop?

Please point out where my logic is flawed
Yeah, that could work. The only possible downside would be if you had more than two window managers...
 
Posts: 33 | Thanked: 1 time | Joined on Aug 2008 @ South Carolina
#30
SUCCESS....!!!!!!!!!!!!!!!!

Benson.....I had typed the scripts in windows notepad and saved them to the memory card. Well it put a ^M at the end of each line, and I removed those in VI.....and wala...!! I have FVWM running.

Ok.....now back to the editor to change some stuff...

Thanks for your help....

Steve
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 06:49.