Contributed by maxime on from the calm-like-a-bomb dept.
Reader Rodolfo Gouveia (rgouveia) came up some days ago with this story:
For some time now cwm (calm window manager) has been part of the OpenBSD X.org installation. I've been fond of it since I tried it last year. Lately I've been exploring and would like to share my findings. I divided them in simple topics ending with my current configuration file (~/.cwmrc).
Initial impressions
When starting cwm we get only a "blank desktop". I personaly use "xsetroot -solid steelblue" as a background. Let's start with the default key binding of Ctrl-Alt-Enter which will open a xterm.
(From now on I will use C to symbolize Ctrl, M for Alt, S for Shift, M1 left mouse button and M3 for the right mouse button. This follows the cwm man page notations.)
Now that we have that xterm open we can manipulate its window. C-M-f to make it full-screen or C-M-= to maximize it vertically. You can also move it using the mouse (M-M1) or resize it (M-M1-M2). Close it with C-M-x. You can run other applications by pressing M-?. This will pop up the exec dialog on which you can type the name of the application that you want to run. You will see it tries to auto-complete the name of the program. Just press Return when it shows what you want and the application will start. Add your favorite applications to .cwmrc so you can access them through the right mouse button M3.
Virtual Desktops
Let's imagine that we have this xterm running and another program by its side: Firefox. We can alternate between both with M-tab. Or we could use virtual desktops. In cwm this can be accomplished with groups. Each window can be assigned to a group with C-M-[n], "n" being a number between 1 to 9, moving the focus of the mouse to the window we want and pressing C-M-g. You will see a temporary blue border around the window when it's assigned a group and red when it's removed.
In our example we will press C-M-1, move the cursor to the xterm and press C-M-g. We will do the same for firefox and assign it to group 2. Now even though you assigned different groups to each window, you're still seeing both. That happens because cwm is showing all groups (C-M-0). Let's just select group 2 (firefox) with C-M-2. This will show us all of group 2 windows. You can get back to xterm with C-M-1. You can also cycle through groups with M-right or M-left.
Inherit the group when opening a window
You will notice when you open a window that, by default, it won't be assigned membership to a specific group. We can change this by adding the option "sticky" in .cwmrc. That will make each window inherit the group in which was opened.
Automatic window grouping
We can also automatically assign a window to a group based on its class and/or name properties. By using xprop we can get these properties. xterm has a useful -class switch, which I use to set my ssh connection to my mail server simply as mail instead of the default xterm so I can distinguish it. Again, this configuration is done through .cwmrc.
This should be enough to get you started. Don't forget to read the cwm(1) and cwmrc(5) man pages.
So without further ado here's my .cwmrc:
# customize some bindings (C-control M-alt M1-button1) bind M-r exec bind CM-r reload bind CM-l label bind CM-t "xterm -e \"top -s 0.6\"" bind CM-m menusearch mousebind M-1 window_move mousebind CM-1 window_resize # application menu command pidgin pidgin command xchat xchat command silc "xterm -class silc -e mysilc.sh" command mail "xterm -class mail -e \"ssh my.mail.host\"" command firefox firefox # groups predefined, use xprop to get these from each program autogroup 2 "Navigator,Firefox" autogroup 3 "pidgin" autogroup 3 "xchat" autogroup 3 "xterm,silc" autogroup 4 "xterm,mail" # inherit current selected group sticky yes
(Comments are closed)
By Anonymous Coward (38.103.144.42) on
tiled managers are fail, go back to Windows 3.1 you retard.
Comments
By Anonymous Coward (2001:638:a00:1e:21e:68ff:fe2f:2bc0) on
>
> tiled managers are fail, go back to Windows 3.1 you retard.
cwm isn't a tiling wm.
By Anonymous Coward (82.82.64.123) on
>
> tiled managers are fail, go back to Windows 3.1 you retard.
Oh hai!
U fail at trolling.
By Anonymous Coward (89.103.118.13) on
> fluxbox is 10 trillion times better.
>
> tiled managers are fail, go back to Windows 3.1 you retard.
By Anonymous Coward (88.192.76.90) on
>
> tiled managers are fail, go back to Windows 3.1 you retard.
That's kinda tells everything from the commentator.
By Anonymous Coward (88.68.29.52) on
By Anonymous Coward (85.19.213.88) on
# ~/.cwmrc
sticky yes
# Override built-in term command
command term "xterm +vb +sb -ls -fn 9x15 -bg black -fg white -geometry 80x30"
# Keybindings: commands
bind 4-t terminal
bind 4-r exec
bind 4-g firefox
bind 4-e "emacs -geometry 80x40"
bind 4-d gnome-dictionary
bind 4-b sylpheed
bind 4-comma "mixerctl outputs.master=-5"
bind 4-period "mixerctl outputs.master=+5"
bind 4-m "xmms -f"
bind 4-n "xmms -r"
# Keybindings: windows
bind 4-f maximize
bind 4-q delete
bind 4-j cyclegroup
bind 4-k rcyclegroup
bind 4-l label
bind 4-h hide
bind 4-v vmaximize
Comments
By Anonymous Coward (85.19.213.88) on
>
> sticky yes
>
[...]
Might as well include my .xinitrc for completeness:
xv -root -quit images/background.png
pgrep aucat || /usr/bin/aucat -l &
xset b off
xset r rate 250 80
ssh-agent cwm
Comments
By thoren (2001:470:b:284::4) on
feh is a great in-ports replacement for xv. it'll do most everything xv will, including bg stuff, and its lic is a little less odd.
Comments
By Anonymous Coward (85.19.213.88) on
>
> feh is a great in-ports replacement for xv. it'll do most
> everything xv will, including bg stuff, and its lic is a
> little less odd.
Thank you for that. xv now replaced by feh (because of the
licensing issues that I was not aware of). Don't like that
it have to create two new dot-files, but I guess I can live
with it ;-)
By Anonymous Coward (81.165.178.114) on
>
> feh is a great in-ports replacement for xv. it'll do most everything xv will, including bg stuff, and its lic is a little less odd.
Feh has more dependency's than xv, did you check the dependency's licenses too?
Comments
By thoren (2001:470:a:284::2) on
> >
> > feh is a great in-ports replacement for xv. it'll do most everything xv will, including bg stuff, and its lic is a little less odd.
>
> Feh has more dependency's than xv, did you check the dependency's licenses too?
$ cat /var/db/pkg/feh-1.3.4/+REQUIRING
jpeg-6bp3
giblib-1.2.4p3
png-1.2.33
imlib2-1.4.0p0
jpeg, and png are already brought in by firefox (for those that use it). giblib is written by the same guy that writes feh, and is marked # BSD in its ports makefile along with imlib2 and png. the trickiest one there is jpeg, which is also required by xv and xloadimage, and still doesn't appear that tricky. as far as graphics progs that will display modern formats to the root window go, it's the most benign useful thing i know. if you are aware of sth even better, i'd love to hear it.
By Anonymous Coward (82.113.121.113) on
>
> ...
Hi, what's the Super-Key?
Comments
By Anonymous Coward (85.19.213.88) on
aka. the Windows key.
By rgouveia (rgouveia) on http://cosmico.net
> command term "xterm +vb +sb -ls -fn 9x15 -bg black -fg white -geometry 80x30"
I use ~/.Xdefaults:
XTerm*loginShell: true
Xft.antialias: true
xterm*faceName: mono
xterm*faceSize: 14
xterm*cursorBlink: true
xterm*visualBell: false
xterm*background: yellow
xterm*foreground: black
Also look at /etc/X11/app-defaults/Xterm
Comments
By Anonymous Coward (82.113.106.112) on
Whoa, do you fear sleeping in front of the monitor? ;)
By raw foo(d) (80.249.194.29) on
.Xresources
.xsession
By Predrag Punosevac (64.234.51.73) on
Comments
By Dmitry (201.223.53.74) on http://deoxyt2.livejournal.com
> about Calm Window Manager is no exception. Spot on!!! Great job.
>
>
> Personally, I would like to thank OpenBSD developers for cleaning CWM from bugs and adding new features. Anybody who tried to use vanilla version of CWM will know what I am talking about. I have been using CWM for almost a year now and I would not go back to OpenBox unless somebody
> points the gun into my head. Presently, when most "enterprise" operating systems Unix like or not need 4GB or RAM and 2 cores just to boot OpenBSD is like a breath of a fresh air.
>
>
> To all of those who think that CWM is for Unix geeks only I can attest
> that my wife loves it as well. She is about as far as it gets from being Unix geek.
>
>
> Finally, I would like to share with you my favorite key binding for CWM.
>
>
>
> # Email client Heirloom mailx way
> bind CM-g "xterm -e nail -A gmail"
>
My CMW no have border in xterm or any program, but I donīt stand, wath is the problem?
Comments
By Anonymous Coward (85.19.213.88) on
> wath is the problem?
Set borderwidth. If that doesn't do anything, you might want to
talk to misc@openbsd.org or something like that.
By sepp0 (sepp0) sepp0@openbsderos.org on http://www.openbsderos.org
Comments
By Seth (98.165.60.42) seth@2t3k.com on
My first reaction was "Wtf, is that a joke?"
Apparently not
Comments
By Anonymous Coward (85.19.213.88) on
>
> My first reaction was "Wtf, is that a joke?"
>
> Apparently not
Never used a tiling wm then. Try it out sometime. Less mousejerking to get work done.
Comments
By Russell (76.171.156.159) @dotplan.dyndns.org on
Have you ever said "Boy, I sure am glad Window foo is overlapping window bar!" Changing to point to focus(not raise) mitagates the pain a little. But you usually want to be in one of two modes anyhow, one window fullscreen, or multi window with full access, I have never needed a half obscured window.
Exceptions and downsides, i.e. the incompleteness theorem.
Small notification windows, they are better not shifting your layout around. but... design wise, no window should ever lock another window, why are you using a multiple access design and preventing access? real solution, a status/mode change area to handle locking events.
programs that don't flow well, some programs are just too dependent on being able to set the window size. They tend to freak out on a tiling wm. I actually have not seen too many off them, so I can't think of any examples.
So take the plunge, start tiling, learn/set the hotkeys. it is how windowing should be.
By Anonymous Coward (190.190.2.152) on
>
>
> My first reaction was "Wtf, is that a joke?"
>
>
> Apparently not
Hellyeah. And you love it.
By Anonymous Coward (88.68.29.52) on
Comments
By jason (jason) on http://www.dixongroup.net/
Scrotwm allows you to toggle (Mod-T).
By Anonymous Coward (81.165.178.114) on
awesome.naquadah.org :-p
Comments
By Anonymous Coward (88.68.29.52) on
>
> awesome.naquadah.org :-p
Awesome is not bad but need to many depends like lua etc.
CWM is nearly perfect in my eyes. It need just the possibility to switch to float mode my a hotkey to arrange the windows on the screen. Then you can create groups with and without floating etc... but this is just a dream and will never realized. NP, I love CWM with or without tiling mode. :)
By Owain G. Ainsworth (oga) on
I may do this eventually. Maybe.
I accept diffs, though.
By Martin Toft (130.225.243.84) on
It saves the day when you are forced to work in a penguin environment...
http://martintoft.dk/?p=cwm
By rgouveia (rgouveia) rgouveia@cosmico.net on http://cosmico.net
It seems the class and name has to be specified and not just one or the other.
So on my cwmrc, pidgin and xchat go like this:
autogroup 3 "pidgin,Pidgin"
autogroup 3 "xchat,Xchat"
I've also discovered that cwm wouldn't assign firefox dialogs along with the same group window as the main program. That was because the name of the window was different, so I had to add another entry:
autogroup 2 "Navigator,Firefox"
autogroup 2 "Dialog,Firefox"
Comments
By rgouveia (rgouveia) on http://cosmico.net
1. I forgot to mention that M2 is the middle mouse button.
2. The default window resize command is M-M2.
By Anonymous Coward (80.221.6.179) on
I tried it at some point but didn't really like it back then.
Currently running simple, manual tiling wm (musca) that fills my desktop needs quite nicely.
If I had to use other than musca I might try cwm again though. Its clean and simple like OpenBSD :)
By sthen (2a01:348:108:100:230:18ff:fea0:6af6) on