...
 
Commits (2)
;;;;;
title: Stumpwm is Awesome
tags: stumpwm, emacs, X, startx, dunst, sbcl, quicklisp, dmenu, sakura
date: 2017-05-08
author: Lenilson Jose Dias
format: md
;;;;;
After a 2 years using [Stumpwm](https://stumpwm.github.io/) 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](https://github.com/kingcons/coleslaw))
Stumpwm by itself:
<blockquote>
StumpWM is a tiling, keyboard driven X11 Window Manager written entirely in Common Lisp.
<br/><span class="attribution"> Stumpwm </span>
</blockquote>
I do not use things like GDM, LightDM... My option is [startx](https://www.x.org/archive/X11R6.8.2/doc/startx.1.html).
`$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](https://dunst-project.org/).
- 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](http://www.sbcl.org/) + [Quicklisp](https://www.quicklisp.org/beta/).
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](http://www.pleyades.net/david/projects/sakura)
- `C-t C-t` switch between the two last used windows.
- `C-t C-r` start [dmenu](http://tools.suckless.org/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](https://www.archlinux.org/) using this environment.
.hljs-comment,.hljs-title{color:#65737e}.hljs-variable,.hljs-attribute,.hljs-tag,.hljs-regexp,.ruby .hljs-constant,.xml .hljs-tag .hljs-title,.xml .hljs-pi,.xml .hljs-doctype,.html .hljs-doctype,.css .hljs-id,.css .hljs-class,.css .hljs-pseudo{color:#bf616a}.hljs-number,.hljs-preprocessor,.hljs-built_in,.hljs-literal,.hljs-params,.hljs-constant{color:#d08770}.ruby .hljs-class .hljs-title,.css .hljs-rules .hljs-attribute{color:#ebcb8b}.hljs-string,.hljs-value,.hljs-inheritance,.hljs-header,.ruby .hljs-symbol,.xml .hljs-cdata{color:#a3be8c}.css .hljs-hexcolor{color:#96b5b4}.hljs-function,.python .hljs-decorator,.python .hljs-title,.ruby .hljs-function .hljs-title,.ruby .hljs-title .hljs-keyword,.perl .hljs-sub,.javascript .hljs-title,.coffeescript .hljs-title{color:#8fa1b3}.hljs-keyword,.javascript .hljs-function{color:#b48ead}.hljs{display:block;background:#eff1f5;color:#4f5b66;padding:.5em}.coffeescript .javascript,.javascript .xml,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:.5}
/* Stolen from lisppaste for the colorize output of 3bmd */
.paste { background-color: #F4F4F4; color: black; }
.paste:hover { background-color: #F4F4F4; color: black; }
.symbol { color : #770055; background-color : transparent; border: 0px; margin: 0px;}
.special { color : #FF5000; background-color : inherit; }
.keyword { color : #770000; background-color : inherit; }
.comment { color : #007777; background-color : inherit; }
.string { color : #777777; background-color : inherit; }
.atom { color : #314F4F; background-color : inherit; }
.macro { color : #FF5000; background-color : inherit; }
.variable { color : #36648B; background-color : inherit; }
.function { color : #8B4789; background-color : inherit; }
.attribute { color : #FF5000; background-color : inherit; }
.character { color : #0055AA; background-color : inherit; }
.syntaxerror { color : #FF0000; background-color : inherit; }
.diff-deleted { color : #5F2121; background-color : inherit; }
.diff-added { color : #215F21; background-color : inherit; }
span.paren1 { background-color : inherit; -webkit-transition: background-color 0.2s linear; }
span.paren1:hover { color : inherit; background-color : #BAFFFF; }
span.paren2 { background-color : inherit; -webkit-transition: background-color 0.2s linear; }
span.paren2:hover { color : inherit; background-color : #FFCACA; }
span.paren3 { background-color : inherit; -webkit-transition: background-color 0.2s linear; }
span.paren3:hover { color : inherit; background-color : #FFFFBA; }
span.paren4 { background-color : inherit; -webkit-transition: background-color 0.2s linear; }
span.paren4:hover { color : inherit; background-color : #CACAFF; }
span.paren5 { background-color : inherit; -webkit-transition: background-color 0.2s linear; }
span.paren5:hover { color : inherit; background-color : #CAFFCA; }
span.paren6 { background-color : inherit; -webkit-transition: background-color 0.2s linear; }
span.paren6:hover { color : inherit; background-color : #FFBAFF; }
......@@ -615,7 +615,7 @@ a:hover, a:visited {
}
/* Main blockquote */
#main-blockquote {
blockquote {
background: #f9f9f9;
border-left: 0.625em solid #cccccc;
margin: 1.5em 0.625em;
......@@ -623,7 +623,7 @@ a:hover, a:visited {
quotes: '“' '”';
}
#main-blockquote:before {
blockquote:before {
color: #ccc;
content: open-quote;
font-size: 4em !important;
......@@ -632,8 +632,7 @@ a:hover, a:visited {
vertical-align: -.4em;
}
#main-blockquote p {
blockquote p {
display: inline;
}
......