Files
opalfiles/StumpWM.org

5.2 KiB

StumpWM Configuration

In my quest to make my computer a Lisp machine in its own right, I am using StumpWM as my window manager.

Init

(in-package :stumpwm)
;; (defvar *sbcl-path* "~/.guix-home/profile/share/common-lisp/sbcl/")

;; StumpWM Modules
(stumpwm:add-to-load-path "~/.guix-home/profile/share/common-lisp/sbcl/stumpwm-swm-gaps")
(stumpwm:add-to-load-path "~/.guix-home/profile/share/common-lisp/sbcl/stumpwm-ttf-fonts")
(stumpwm:add-to-load-path "~/.guix-home/profile/share/common-lisp/sbcl/stumpwm-stumptray")
(stumpwm:add-to-load-path "~/.guix-home/profile/share/common-lisp/sbcl/stumpwm-kbd-layouts")

Environment

Workspaces

(run-commands
 "gnewbg I"
 "gnew II"
 "gnewbg III"
 "gnewbg IV"
 "gnewbg V"
 "gnewbg-float F")

Set Prefix

(set-prefix-key (kbd "s-d"))

Focus window with mouth

setf *mouse-focus-policy* :click)

Messages

(setq *message-window-gravity* :top)
(setq *message-window-padding* 10)
(setq *message-window-y-padding 10)

Command Window

(setq *input-window-gravity* :center)

Keyboard

Load Keyboard Layout Module

;; (load-module "kbd-layouts")

Remap Caps Lock

setf kbd-layouts:*caps-lock-behavior* :esc)

Xmodmap

;; (run-shell-command "xmodmap ~/Dotfiles/.config/Xmodmap")

Keybinds

;; Set some super key bindings
(define-key *top-map* (kbd "s-h") "move-focus left")
(define-key *top-map* (kbd "s-l") "move-focus right")
(define-key *top-map* (kbd "s-j") "move-focus down")
(define-key *top-map* (kbd "s-k") "move-focus up")

(define-key *top-map* (kbd "s-S-h") "move-window left")
(define-key *top-map* (kbd "s-S-l") "move-window right")
(define-key *top-map* (kbd "s-S-j") "move-window down")
(define-key *top-map* (kbd "s-S-k") "move-window up")

(define-key *top-map* (kbd "s-f") "fullscreen")
(define-key *top-map* (kbd "s-r") "iresize")
(define-key *top-map* (kbd "s-S-q") "delete")
(define-key *top-map* (kbd "s-SPC") "run-shell-command emacsclient -e \"(call-interactively #'app-launcher-run-app)\"")
;; (define-key *top-map* (kbd "C-s-l") "run-shell-command slock")

(define-key *top-map* (kbd "s-TAB") "next-in-frame")
(define-key *top-map* (kbd "s-S-TAB") "prev-in-frame")

(define-key *top-map* (kbd "s-1") "gselect I")
(define-key *top-map* (kbd "s-2") "gselect II")
(define-key *top-map* (kbd "s-3") "gselect III")
(define-key *top-map* (kbd "s-4") "gselect IV")
(define-key *top-map* (kbd "s-5") "gselect V")

(define-key *top-map* (kbd "s-S-1") "gmove I")
(define-key *top-map* (kbd "s-S-2") "gmove II")
(define-key *top-map* (kbd "s-S-3") "gmove III")
(define-key *top-map* (kbd "s-S-4") "gmove IV")
(define-key *top-map* (kbd "s-S-5") "gmove V")

;; Brightness and volume
;; (define-key *top-map* (kbd "XF86MonBrightnessDown") "run-shell-command brightnessctl set 5%-")
;; (define-key *top-map* (kbd "XF86MonBrightnessUp") "run-shell-command brightnessctl set +5%")
;; (define-key *top-map* (kbd "XF86AudioLowerVolume") "run-shell-command amixer set Master 3%- unmute")
;; (define-key *top-map* (kbd "XF86AudioRaiseVolume") "run-shell-command amixer set Master 3%+ unmute")
;; (define-key *top-map* (kbd "XF86AudioMute") "run-shell-command amixer set Master toggle")

UI

Colors

;; Set UI colors
(set-border-color "#c792ea")
(set-bg-color "#232635")
(set-fg-color "#A6Accd")
(set-msg-border-width 2)

Gaps

(load-module "swm-gaps")
(setf swm-gaps:*inner-gaps-size* 3)
(run-commands "toggle-gaps-on")

Fonts

;; Enable TTF fonts
;; (load-module "ttf-fonts")
;; (setf xft:*font-dirs* '("/home/opal/.guix-home/profile/share/fonts/"))
;; (setf clx-truetype:+font-cache-filename+ "/home/daviwil/.local/share/fonts/font-cache.sexp")
;; (xft:cache-fonts)

;; (set-font (make-instance 'xft:font :family "Fira Mono" :subfamily "Regular" :size 16))

Mode-Line

;; Set mode line colors
(setf *mode-line-background-color* "#232635")
(setf *mode-line-foreground-color* "#A6Accd")

;; Set the mode line format
(setf *screen-mode-line-format* "[^B%n^b] %W ^>%d")
(run-commands "mode-line" "mode-line")

;; Start the mode line
(run-commands "mode-line")

System tray

;; Add the system tray module
(load-module "stumptray")
(stumptray:stumptray)

Applications

;; (run-shell-command "feh --bg-scale ~/.dotfiles/backgrounds/samuel-ferrara-uOi3lg8fGl4-unsplash.jpg")
;; (run-shell-command "dunst")
;; (run-shell-command "nm-applet")
;; (run-shell-command "syncthing-gtk --minimized")
;; (run-shell-command "redshift -l 37.983810:23.727539 -t 6500:3500")
(run-shell-command "emacs")

Repl Start

(require :slynk)
(slynk:create-server :dont-close t)