deft / Ratpoison

Tiling window manager.

Configuration tangle

Special Keys

Monitor

definekey top XF86MonBrightnessDown exec light -U 5
definekey top XF86MonBrightnessUp exec light -A 5
definekey top XF86Display exec toggle-monitor

Volume

definekey top XF86AudioLowerVolume exec amixer set Master 5%-
definekey top XF86AudioRaiseVolume exec amixer set Master 5%+
definekey top XF86AudioMute exec amixer set Master toggle

Media

definekey top XF86Tools exec playerctl play-pause
definekey top XF86Bluetooth exec playerctl next

Program Hotkeys

bind c exec alacritty
bind q exec qute
bind e exec emacsclient -e "(raise-frame)" || emacsclient -nc
bind "C-e" exec emacs

Status Message

Script

#!/usr/bin/bash

power_supply="/sys/class/power_supply/AC/online"
battery_level=`acpi -b | grep -P -o '[0-9]+(?=%)'`
charging=`cat $power_supply`
date=`date +"%a %F %k:%M"`

if [  $charging = "0" ]
then
  echo "${date} | -${battery_level}%"
else
  echo "${date} | +${battery_level}%"
fi
chmod +x ~/src/bin/ratpoison_status

Key

bind a exec ratpoison -c "echo `~/src/bin/status`"

Window Name / Format

set winname title
set winfmt %n %s %t
defwinname name

Frames, Splitting

Like in Emacs .

bind 1 only
bind 0 remove
bind 2 hsplit
bind 3 hsplit

dmenu

bind w exec ratpoison -c "select `ratpoison -c "windows" | dmenu -i -l 20 | awk '{print $1}'`"
bind b exec ratpoison -c "select `ratpoison -c "windows" | dmenu -i -l 20 | awk '{print $1}'`"
bind d exec mupdf `find ~/Media/Documents -name "*.pdf" | dmenu -i -l 20 | awk '{print $1}'`
bind x exec $(dmenu_path | dmenu -i -l 20)
bind p exec passmenu

Screenshots

bind "C-s" exec screenshot

Script

#!/usr/bin/env bash

NAME=$(ratpoison -c "prompt name " | sed "s/ /_/g")
import ~/screenshots/$(date -u  +"%F")_$NAME.png
chmod +x ~/src/bin/screenshot

Multi-Monitor

bind s nextscreen
bind "C-n" exchangedown
bind "C-p" exchangeup
bind "C-r" exchangeup

set warp 1
warp on

Other Hotkeys

bind r restart
bind o focus

Autostarts

exec pgrep redshift || /usr/bin/redshift
exec pgrep unclutter || /usr/bin/unclutter

Sloppy disabled

Follow mouse with focus ArchWiki - Ratpoison

# exec "pgrep sloppy || /usr/share/ratpoison/sloppy"

If you have an idea how this page could be improved or a comment send me a mail.