SkillAgentSearch skills...

Cwmrc

Configuration of the Calm Window Manager (CWM)

Install / Use

/learn @pguerin3/Cwmrc
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

= The Calm Window Manager (CWM) Authored by me :description: setup for a minimalist interface. :url-repo: https://github.com/pguerin3/cwmrc :url-adoc: https://docs.gitlab.com/ee/user/asciidoc.html :icons: font :hide-uri-scheme:

// https://docs.gitlab.com/ee/user/asciidoc.html // Note: It’s possible to generate diagrams and flowcharts from text in GitLab using Mermaid or PlantUML.

A minimalist floating window manager that also tiles.

This repository showcases configuration of the Calm Window Manager (CWM) to keep the minimal asthetic, but at the same time make more practical.

image:images/fullscreenshot.png[tiled windows]

CWM is a minimalist floating window manager:

[x] float windows by default. [x] snap any window into a corner, or edge of the screen. [x] snap the floating windows into a tiling configuration. eg either [x] horizontal master/stack, or vertical master/stack. [x] retain gaps between the windows and the edge of the screen.

Also there is also a native application launcher that you can drive with the mouse or touchpad. eg use the keyboard to launch applications.

If the native application launcher is not to your liking, then it's easy to add 3rd-party lanchers and status bars. eg Polybar.

As CWM doesn't feature multi-monitor support, the ideal use-case is that you are just using a single monitor.

==== X11 startx configuration

Can use ~/.xinitrc to start the default the applications, before starting CWM:

[source, bash] ....

inside ~/.xinitrc or .bash_profile (note: bash_profile calls .bashrc)

xrandr --output VGA-0 --auto

for VirtualBox only

xrandr --output Virtual1 --mode 1440x900

does this fix the file picker problem???

if [ -d /etc/X11/xinit/xinitrc.d ] ; then for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do [ -x "$f" ] && . "$f" done unset f fi

#feh --no-fehbg --bg-fill --randomize /usr/share/backgrounds/wallpapers-master& feh --no-fehbg --bg-fill ~/Downloads/cropped-1920-1080-467642.jpg&

picom --backend xrender&

dunst&

exec cwm ....

Now start the Calm Window Manager from the TTY with:

[source, bash] .... startx ....

// thematic break (aka horizontal rule)

=== Screenshots of floating windows that are snapped into tiles

To create a few terminal windows, use alt+cntrl+enter for each terminal.

==== Without a Polybar:

For example, 4 floating windows can be snapped into tiles.

Then alt+cntrl+minus to tile the 4 windows, into a master window on the left and 3 stacked windows on the right.

Then in the tiled layout, to switch the active window (in the non-primary) with the primary position - simply alt-cntrl-minus again.

image:images/VirtualBox_Fedora35_23_04_2022_18_33_47.png[4 tiled windows snapped with alt+cntrl+minus]

Use alt+cntrl+enter to create another terminal.

It will float on top of the 4 other windows for a total of 5 windows.

image:images/VirtualBox_Fedora35_23_04_2022_21_10_02.png[5 windows]

Then alt+cntrl+minus to restacck the 5 windows into the tiled layout with the focused window placed in the master position on the left.

image:images/VirtualBox_Fedora35_23_04_2022_21_10_51.png[5 tiled windows]

So now 4 windows have been snapped into the stack on the right, and the focused window at that time was snapped into the master position on the left.

The tiled windows can also be restacked with alt+cntrl+shift+minus, so the master is now on top.

image:images/screen.png[tiled windows]

Other configurations include:

image:images/screen2.png[tiled windows]

image:images/screen.png[tiled windows]

image:images/screen1.png[tiled windows]

=== Screenshots of floating windows (without tiling)

If you prefer floating windows then CWM has you covered too:

image:images/VirtualBox1.png[screenshot1]

image:images/VirtualBox2.png[screenshot2]

image:images/VirtualBox3.png[screenshot3]

image:images/VirtualBox4.png[screenshot4]

image:images/VirtualBox5.png[screenshot5]

image:images/VirtualBox6.png[screenshot6]

image:images/VirtualBox7.png[screenshot7]

=== Screenshots with the native application launcher

A native application laucher can be run with a mouse right-click.

image:images/VirtualBox10.png[native-luancher1]

image:images/VirtualBox11.png[native-luancher2]

Or you may run applications from the shell. For example:

[source, bash] .... chromium-browser& ....

And to ignore any run-time errors:

[source, bash] .... chromium-browser > /dev/null 2>&1 & ....

Add the disown command to detach the application from the terminal:

[source, bash] .... chromium-browser > /dev/null 2>&1 & disown ....

As systemd is used, managing the host from the shell can also be achieved with the following commands:

[source, bash] .... systemctl suspend ....

[source, bash] .... systemctl reboot ....

[source, bash] .... systemctl poweroff ....

// thematic break (aka horizontal rule)

== Installation and configuration of CWM

The official repo for CWM is here:

https://github.com/leahneukirchen/cwm

Most Linux distributions have the CWM in their repository. So installing CWM is extremely easy. For example, to install in Fedora:

[source, bash] .... sudo dnf install cwm ....

For Debian:

[source, bash] .... sudo apt-get install cwm ....

For Arch:

[source, bash] .... sudo pacman -S cwm ....

FreeBSD also has CWM in their repository, and is installed as follows:

[source, bash] .... sudo pkg install cwm ....

The ~/.cwmrc configuration file used in the screen shots is similar to this:

[source] ....

CMS-r = restart

these are for the menu

#fontname "sans-serif:pixelsize=16" #fontname "monospace:pixelsize=15" #fontname "dejavu sans mono:size=7" fontname fixed-11

moveamount 10 # granularity of finest movement vtile 50 htile 75 gap 1 1 1 1 color activeborder red color inactiveborder black snapdist 3

#bind-key CM-Return "urxvt" bind-key CM-Return "kitty" bind-key CM-minus window-vtile bind-key CMS-minus window-htile unbind-key CS-minus unbind-key CS-plus unbind-key C-slash

autogroup definitions

as shown by xprop

autogroup 1 kitty,kitty autogroup 2 urxvt,URxvt autogroup 3 brave-browser, Brave-browser autogroup 4 chromium-browser, Chromium-browser #autogroup 5 "thorium-browser", "Thorium-browser" autogroup 5 thorium-browser, Thorium-browser autogroup 6 "VirtualBox Manager", "VirtualBox Manager" autogroup 7 "VirtualBox Machine", "VirtualBox Machine" autogroup 8 "vncviewer", "Vncviewer" autogroup 9 "vncviewer", "Vncviewer"

bind-key M-1 group-toggle-1 bind-key M-2 group-toggle-2 bind-key M-3 group-toggle-3 bind-key M-4 group-toggle-4 bind-key M-5 group-toggle-5 bind-key M-6 group-toggle-6 bind-key M-7 group-toggle-7 bind-key M-8 group-toggle-8 bind-key M-9 group-toggle-9 bind-key M-0 group-toggle-all

don't include Polybar as a window

#ignore polybar

applications

note - scroll up = shift-pageup, and scroll down = shift-pagedown

+ssr = turn off secondary screen scroll

#command alacritty-top "alacritty -e top" command xscreensaver "xscreensaver" command xclock "xclock" command chromium "chrome" command tmux "urxvt +sb -depth 32 -bg rgba:0000/0000/0000/aaaa -fg [100]grey -e tmux" command top-green "urxvt +sb -depth 32 -bg rgba:1111/1111/1111/9999 -fg [100]green -e top" command top-magenta "urxvt +sb -depth 32 -bg rgba:1111/1111/1111/9999 -fg [100]magenta -e top" command top-grey "urxvt +sb -depth 32 -bg rgba:1111/1111/1111/9999 -fg [100]grey -e top" command top-lightgrey "urxvt +sb -depth 32 -bg rgba:1111/1111/1111/9999 -fg [100]lightgrey -e top" command top-lightblue "urxvt +sb -depth 32 -bg rgba:1111/1111/1111/9999 -fg [100]lightblue -e top" command top-lightgreen "urxvt +sb -depth 32 -bg rgba:1111/1111/1111/9999 -fg [100]lightgreen -e top" command top-lightpink "urxvt +sb -depth 32 -bg rgba:1111/1111/1111/9999 -fg [100]lightpink -e top" command top "urxvt +sb -depth 32 -bg rgba:0000/0000/0000/6666 -fg [100]cyan -e top" command vim "urxvt -e vim ." command gvim "urxvt -e gvim ."

....

Inspect the CWM manual for all the default key bindings:

[source, bash] .... man cwm ....

Then inspect the CWM configuration manual for the other possibilities for the ~/.cwmrc file:

[source, bash] .... man cwmrc ....

// thematic break (aka horizontal rule)

== Applications

=== The virtual terminal with Urxvt

In an X11 environment, it's good to have a few terminal emulators available. In the event that you want to edit the configuration of a terminal emulator, and you get an unexpected result, then you should have another ready to go.

I like to have the Urxvt terminal emulator ready to go in cate I need it in a hurry.

Urxvt is present in the Fedora repo:

[source, bash] .... sudo dnf install rxvt-unicode ....

My urxvt terminal is configured without scroll bars. Also use shift-pageup to scroll up, and shift-pagedown to scroll down. The +ssr parameter of urxvt turns off secondary screen scroll, so for example text inside the Vim editor will not be shown in the primary window after Vim has exited. The same setting is set with secondaryScroll.

Create a ~/.Xdefaults file for the configuration of the urxvt terminal. Place the following configuration in it:

[source] ....

effective on next login

URxvt.scrollBar: off

turn off secondary screen scroll for a pager. eg less.

URxvt.secondaryScroll: off URxvt.depth: 32

black (0000/0000/0000) with no transparency (ffff)

grey (1111/1111/1111) with no transparency (ffff)

URxvt.background: rgba:1111/1111/1111/ffff URxvt.foreground: [100]grey URxvt.font: xft:monospace:pixelsize=12 URxvt.geometry: 132x50 URxvt.visualBell: on ....

=== The virtual terminal with Kitty

Kitty is in the Fedora repo:

[source, bash] .... sudo dnf install kitty ....

My Kitty terminal is configured without scroll bars. Also use cntrl-shift-pageup to scroll up, and cntrl-shift-pagedown to scroll down. In Kitty, secondary screen scrolling is off by default.

Also define the font and font size you want to use with the Fish shell. In the config above I'm using FiraCode:

https://github.com/tonsky/FiraCode

[source, bash] .... sudo dnf in

View on GitHub
GitHub Stars18
CategoryDevelopment
Updated23d ago
Forks1

Languages

Shell

Security Score

80/100

Audited on Mar 14, 2026

No findings