View Single Post
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 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: