Skip to content

Instantly share code, notes, and snippets.

@lidgnulinux
Last active April 19, 2026 00:55
Show Gist options
  • Select an option

  • Save lidgnulinux/4f0e066260b1fad842beab64cf557d0e to your computer and use it in GitHub Desktop.

Select an option

Save lidgnulinux/4f0e066260b1fad842beab64cf557d0e to your computer and use it in GitHub Desktop.
An attempt to mimic cwmrc for riverwm.
#!/bin/sh
alias bind-key="riverctl map normal"
alias bind-mouse="riverctl map-pointer normal"
alias borderwidth="riverctl border-width"
export W=Super
export S=Shift
export A=Alt
export C=Control
color() { riverctl border-color-$1 $2; }
touchpad() { riverctl input "pointer-2-7-SynPS/2_Synaptics_TouchPad" $1 $2; }
color unfocused 0x586e75
color focused 0xffad00
borderwidth 3
touchpad tap enabled
touchpad drag enabled
touchpad drag-lock enabled
bind-key $W+$S Return spawn foot
bind-key $W D spawn 'rofi -show drun'
bind-key $W Q close
bind-key $W+$S E exit
bind-key $W J focus-view next
bind-key $W K focus-view previous
bind-key $W+$S J swap next
bind-key $W+$S K swap previous
bind-key $W Period focus-output next
bind-key $W Comma focus-output previous
bind-key $W+$S Period send-to-output next
bind-key $W+$S Comma send-to-output previous
bind-key $W Return zoom
bind-key $W+$A H move left 100
bind-key $W+$A J move down 100
bind-key $W+$A K move up 100
bind-key $W+$A L move right 100
bind-key $W+$A+$C H snap left
bind-key $W+$A+$C J snap down
bind-key $W+$A+$C K snap up
bind-key $W+$A+$C L snap right
bind-key $W+$A+$S H resize horizontal -100
bind-key $W+$A+$S J resize vertical 100
bind-key $W+$A+$S K resize vertical -100
bind-key $W+$A+$S L resize horizontal 100
bind-key $W F toggle-fullscreen
bind-mouse $W BTN_LEFT move-view
bind-mouse $W BTN_RIGHT resize-view
bind-mouse $A BTN_LEFT resize-view
bind-mouse $W BTN_MIDDLE toggle-float
for i in $(seq 1 9)
do
tags=$((1 << ($i - 1)))
bind-key $W $i set-focused-tags $tags
bind-key $W+$S $i set-view-tags $tags
bind-key $W+$C $i toggle-focused-tags $tags
bind-key $W+$S+$C $i toggle-view-tags $tags
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment