After a 2 years using Stumpwm as my default X11 window manager at FreeBSD: Stumpwm is an awesome wm for people who loves Emacs key bindings and a lightweight wm.

As an Emacs user I have my stuff managed by org files <3:

  • My dotfiles as a `.org`
  • TODOS
    1. Birthdays
    2. Reading
    3. Tasks
    4. Events
    5. Watch
    6. Travels
  • Programming
    1. Go
    2. Elixir
    3. Clojure
  • Blogging (Markdow + Coleslaw)

Stumpwm by itself:

StumpWM is a tiling, keyboard driven X11 Window Manager written entirely in Common Lisp.
Stumpwm

I do not use things like GDM, LightDM... My option is startx.

$HOME/.xinitrc:

$(which xrdb) -merge $HOME/.Xresources
$(which dunst) -config $HOME/.dunstrc &

# Set keyboard layout to Dvorak Programmer http://www.kaufmann.no/roland/dvorak/
# Swap left Control with left Alt keys
setxkbmap -model "pc-104" -layout "us" -variant "dvp" -option "ctrl:swap_lalt_lctl"

# define default mouse cursor as arrow
xsetroot -cursor_name left_ptr

# Set wallpaper
[ -d ~/Sync/wallpapers ] && feh --bg-fill "$(find ~/Sync/wallpapers/ -type f |sort -R |tail -1)" &

exec sbcl --load ~/.start-stumpwm

Above:

  • .Xresources set some X configurations.
  • Load Dunst.
  • Set my keyboard layout to Dvorak Programmer and swap left control with left alt.
  • Set a random wallpaper of my image library.
  • Finally load Stumpwm via SBCL - Steel Bank Common Lisp + Quicklisp.

Here $HOME/.start-stumpwm:

(ql:quickload :clx)
(ql:quickload :cl-ppcre)
(ql:quickload :stumpwm)
(ql:quickload :swank)
(stumpwm:stumpwm)
(quit)

I keep a short key bindings to applications that I mostly use:

(defcommand terminal () ()
        "Start a Sakura instance or switch to it, if ti is already running."
        (run-or-raise "sakura" '(:instance "sakura")))
(define-key *root-map* (kbd "c") "terminal")


;; Volume control
(defcommand volup () ()
        "Increase sound volume"
        (run-shell-command "amixer -q sset Master 3%+"))
(define-key *root-map* (kbd "u") "volup")

(defcommand voldown () ()
        "Decrease sound volume"
        (run-shell-command "amixer -q sset Master 3%-"))
(define-key *root-map* (kbd "d") "voldown")
(define-key *top-map* (kbd "XF86AudioLowerVolume") "voldown")
(define-key *top-map* (kbd "XF86AudioRaiseVolume") "volup")
(define-key *top-map* (kbd "XF86AudioMute") "exec amixer set Master toggle")


(defcommand emacs () ()
  "run-or-raise emacs"
  (run-or-raise "emacsclient -ca emacs" '(:class "Emacs")))
(define-key *root-map* (kbd "e") "emacs")


(defcommand browser () ()
  "run or raise conkeror"
  (run-or-raise "conkeror" '(:class "Conkeror")))
(define-key *root-map* (kbd "w") "browser")


(defcommand terminal () ()
        "Start a Sakura instance or switch to it, if ti is already running."
        (run-or-raise "sakura" '(:instance "sakura")))
(define-key *root-map* (kbd "c") "terminal")


(defcommand firefox () ()
  "run or raise firefox"
  (run-or-raise "firefox" '(:class "Firefox")))
(define-key *root-map* (kbd "C-w") "firefox")


(defcommand chromium () ()
  "run or raise chromium"
  (run-or-raise "chrome" '(:class "Chromium")))
(define-key *root-map* (kbd "C-c") "chromium")


(defcommand google-chrome () ()
        "run or raise google-chrome"
        (run-or-raise "google-chrome-stable" '(:class "Google Chrome")))
(define-key *root-map* (kbd "C-g") "google-chrome")


(defcommand dmenu_run () ()
  "run or raise dmenu"
  (run-or-raise "dmenu_run -fn 'Liberation Mono'  -nb '#EEEEEE' -nf '#000000' -sb '#3399cc'" '(:class "dmenu")))
(define-key *root-map* (kbd "C-r") "dmenu_run")

Using Stumpwm in my dailybasis is very easy:

  • I use two monitors: C-t o or C-t <tab> to switch between them.
  • The (run-or-raise) is awesome concept:
    1. C-t e get the Emacs window.
    2. C-t w get Conkeror browser.
    3. C-t c get Sakura
  • C-t C-t switch between the two last used windows.
  • C-t C-r start dmenu. Stumpwm comes with command 'shell execute' via C-t !.
  • C-t n for the 'next window' and C-t p for the 'previous window'.

I will start a post series covering the Arch Linux using this environment.

by Lenilson Jose Dias
Written on 2017-05-08