FVWM

Don't get me wrong, I've nothing to complain about pcmanfm, I've been using it for some 5 years now and rather like it. It really goes a long way as a standalone file manager, I'm very thankful for it. It does provide everything you'll need in a file manager, that's true.
My FVWM config related to this FM only onсe, I added icon to start it quickly from dock. But it's very easy to switch this icon to start any another one FM, so I cannot understand, why we discuss pcmanfm in serious FVWM topic. Personally I use GUI FM pretty rarely, to perform most of file operations, I use drop-down terminal, which is also present in my config and may be easily launched with F1 hotkey.
 
Last edited by a moderator:
Wmatrix.gif

In FVWM ( x11-wm/fvwm2 ) it is pretty easy to "dock" whatever application you want. If app has WM_CLASS or WM_NAME in its properties (use FvwmIdent or xprop to find it out), then, it's possible to add it to your dock (FvwmButtons module). For example, it is possible to "dock" graphics/sxiv, which will play your favorite gif animation, for example, to add it to my config (https://forums.freebsd.org/posts/390111), find lines containing "*FvwmButtons:" and replace one of dockapps with it. To replace wmclock with animated gif, find
Code:
*FvwmButtons: (Frame 2, Swallow(UseOld,NoClose) wmclock 'Exec exec wmclock -led green -24', \
...
in ~/.fvwm/config and replace it with
Code:
*FvwmButtons: (Frame 2, Swallow(UseOld,NoClose) myanimation 'Exec exec sxiv -g 64x64 -N myanimation -ba /path/to/your/animated.gif, \
...
If you want to change this animated dockapp click actions, edit few lines, which follows the line from above:
Code:
...
Action(Mouse1) 'Exec exec $[infostore.terminal] -g 66x36 -cr white -bd white -bg white -fg black -b 25 -hold -e cal -A11', \
Action(Mouse3) 'Exec exec $[infostore.terminal] -g 74x31 -cr black -bd black -fg white -bg black -b 25 -hold -e ncal -A11')
Change commands after "Exec exec". By default, these lines should open two types of calendar with left/right click. "Action(Mouse1)" is left click, "Action(Mouse2)" is middle click and "Action(Mouse3)" is right mouse click.
Here is couple of ~ 60x60px gifs, for example:
whypnotic.gif

wmatrix.gif


But it is even possible to use some terminal applications as dockapps, for example, to "dock" misc/termatrix, it is possible to use the following code
Code:
*FvwmButtons: (Frame 2, Swallow(UseOld,NoClose) wmatrix 'Exec exec urxvt -fn xft:Andale\\ Mono:size=6 -name wmatrix -g 4x6 -e termatrix')
termatrix.gif
 
Last edited by a moderator:
Hi! This thread seems to a bit dated (last post over a year ago), but it seems to be the best place to jump in with my question. I have first the first time decided to use something other than Xfce/Thunar for my desktop/window manager and have tried plain vanilla FVWM. After a few days it feels great but there are three shortcuts that I have not figured out how to implement:

1) Autofocus on a new window when it is created. (not crucial but would be nice to have)
2) Be able to switch between windows with alt+tab. (crucial)
3) Be able to switch between virtual desktops with ctrl+alt + Left/Right keys. (crucial)

The FVWM docs are quite lengthy and I still haven't figured them out. Haven't found anything else either that was helpful on fora that were not extremely complex, very old, or difficult to understand.

Any tips on this would be greatly appreciated!
 
1. To use autofocus, add Style * ClickToFocus to your config file.
2. Alt+TAB — Key Tab A M WindowList Root c c MaxLabelWidth 99
3. This depends on number of desks you're using. To have 4 desks, use these lines in your config file:
Code:
DesktopSize 1x1
Key Left   A   CM    Desk -1 0 3     #Ctrl+Alt+Left
Key Right  A   CM    Desk +1 0 3     #Ctrl+Alt+Right
Where "0" is 1st desk and "3" is 4th (last).
 
Hey, people, what do you use as your clock app on your FVWM desktop? I used to be content with xclock, until got bored. So I wrote this little script based on date and xterm to give me multi-color date clock -- at least, more fun than plain xclock.
Code:
$ >cat clock.sh
#!/usr/local/bin/bash
while true
do
tput clear
date | awk '{ print "\033[34m" $1,"\033[35m" $2,"\033[35m" $3,"\033[39m" $4, \
"\033[33m" $5,"\033[36m" $6 "\t" }' | tr -d '\n'
sleep 1
done
Then I set it in .fvwm/config to run without title bar and always be in left top:
Code:
Style *clock*  !Title WindowListSkip
..........
###And lanuch my script in terminal###
AddToFunc FvwmMyClock
+ I Exec exec xterm -geometry 30x1+1+1 -bg black -fg green \
  -fa 'xos Terminus:style=Bold' -fs 16 -e ~/clock.sh
The only problem is, don't know how to get rid of the cursor in the end... though it doesn't hurt me that much.
EDIT: Well, strictly speaking, I actually composed the script from the parts somebody else wrote. The script itself is somewhere at stackexchange.com, I only added the awk coloration part to it.
 
Ok, the only way I was able to put it into a single file was this:
Code:
#!/usr/local/bin/bash
clock_f () {
while true
do
tput clear
date | awk '{ print "\033[34m" $1,"\033[35m" $2,"\033[35m" $3,"\033[39m" $4,"\033[33m" $5,"\033[36m" $6 "\t" }' | tr -d '\n'
sleep 1
done
}
export -f clock_f
xterm -geometry 30x1+1+1 -bg black -fg green -fa 'Terminus:style=Bold' -fs 16 -T Clock -e bash -c clock_f & disown
Edit: using export -f solves the problem.
And then:
Code:
Style *Clock*  Sticky, !Title
 
Last edited:
Boom...
Any more fvwm configs and how tos... ?
I want to create a mac like or maybe a windowmaker style based on fvwm...
I am searching for various config files here and there...
 
I use fvwm when I want to run a nested X11 session using Xnest or Xephyr. It' can be very useful.

Suppose you have two users on your machine, one who uses it most of the time, and a second one who uses it just now and again. You want to give the second user a way to have his own isolated desktop, so he doesn't mess around with the main users's desktop. The main user might use something like kde plasma as his desktop, but he wants to give the second user a lightweight X environment he can log into and use as if he is on a separate head... as if he were working at an X terminal connected over the network.

You can make a little script like this.
Bash:
#!/usr/bin/bash
unset DISPLAY
export DISPLAY=:0
xauth merge /tmp/myauth

# choose whether to run Xephyr fullscreen or windowed
Xephyr -fullscreen -nolisten tcp :1 2>/dev/null &
#Xephyr -screen 1024x768 -nolisten tcp -reset -terminate :1 2>/dev/null &

# hint: there is a race here, need a way to fix properly, but sleep 1 works for now
sleep 1
export DISPLAY=:1
fvwm3 &

# note we probably ought to detele the security cookie file now
rm /tmp/myauth

Note that the script runs xauth to gain permission to access the host user's display. Somewhere in the host user's login scripts you will need to run
$ xauth extract - $DISPLAY > /tmp/myauth
to initialise the authentication cookie, that can be picked up when the second user runs the script. Alternatively you can allow the second user to access the display :0 by running xhost.

Now to set up the second user's display, go to a different virtual desktop, open an xterm and login as the second user, then run the script shown above. The script will
1. merge in the authentication cookie for display :0, enabling the second user to run X clients on display :0
2. start Xephyr which provides a nested X-server, either in a separate window or fullscreen; the nested server is set to display :1
3. start fvwm as the window manager inside the nested X session, on display :1

This gives the the second user a complete self-contained X session with its own window manager, isolated from the host system. And because the second user is a separate unix login, you have full process, address space and filesystem isolation from the host user, assuming permissions are set up appropriately

Now... you COULD run something like kde itself as the nested desktop, but (a) that might get a little confusing on the same keyboard/monitor head and (b) using fvwm gives a much lighter weight desktop, so uses less machine resources. Lightweight window managers like fvwm are ideal in this nested display scenario.

And a third variant is to run the nested fvwm session over ssh on a remote machine; in that case you would change the last line of the script to run fvwm over ssh on the remote machine, rather than locally. If you have a lab full of eg test machines, this can be very useful, similar to using rdesktop to access other boxes on a lan. And that is when the true power of X11 as a network protocol rather than a local graphics library becomes apparant. If you have a large screen, you can set up say a 3x3 matrix of nested X servers, each running an independent desktop (like fvwm) on 9 different remote machines. People do this kind of thing with web interfaces nowadays, but you can do it directly with X as well. Or it's the equivalent to having a set of terminals with text ssh sessions onto a bunch of remote machines, but you have a full GUI on each remote machine.
 
Back
Top