repos / dotfiles

my dotfiles

dotfiles / dot_config / river
Eric Bower  ·  2026-01-23

init

 1#!/bin/sh
 2
 3# If you wish to edit this, you will probably want to copy it to
 4# $XDG_CONFIG_HOME/river/init or $HOME/.config/river/init first.
 5# See the river(1), riverctl(1), and rivertile(1) man pages for complete
 6# documentation.
 7# Note: the "Super" modifier is also known as Logo, GUI, Windows, Mod4, etc.
 8
 9mod=Mod4
10
11riverctl set-repeat 30 300
12
13riverctl map normal $mod Return spawn foot
14riverctl map normal $mod D spawn bemenu-run
15
16riverctl map normal $mod Q close      # close the focused view
17riverctl map normal $mod+Shift E exit # exit river
18
19# focus the next/previous view in the layout stack
20riverctl map normal $mod J focus-view next
21riverctl map normal $mod K focus-view previous
22
23# swap the focused view with the next/previous view in the layout stack
24riverctl map normal $mod+Shift J swap next
25riverctl map normal $mod+Shift K swap previous
26# bump the focused view to the top of the layout stack
27riverctl map normal $mod+Shift Return zoom
28
29riverctl map-pointer normal $mod BTN_RIGHT resize-view
30riverctl map normal $mod Space toggle-float
31riverctl map normal $mod F toggle-fullscreen
32
33for i in $(seq 1 9)
34do
35    tags=$((1 << ($i - 1)))
36    riverctl map normal $mod $i set-focused-tags $tags
37    riverctl map normal $mod+Shift $i set-view-tags $tags
38    riverctl map normal $mod+Control $i toggle-focused-tags $tags
39    riverctl map normal $mod+Shift+Control $i toggle-view-tags $tags
40done
41
42scratch_tag=$((1 << 20))
43riverctl map normal Super P toggle-focused-tags ${scratch_tag}		# toggle the scratchpad
44riverctl map normal Super+Shift P set-view-tags ${scratch_tag}		# send windows to the scratchpad
45# Set spawn tagmask to ensure new windows do not have the scratchpad tag unless explicitly set.
46all_but_scratch_tag=$(( ((1 << 32) - 1) ^ $scratch_tag ))
47riverctl spawn-tagmask ${all_but_scratch_tag}
48
49for mode in normal locked
50do
51    riverctl map -repeat $mode None XF86AudioRaiseVolume  spawn 'pamixer -i 5'
52    riverctl map -repeat $mode None XF86AudioLowerVolume  spawn 'pamixer -d 5'
53    riverctl map -repeat $mode None XF86AudioMute         spawn 'pamixer --toggle-mute'
54    riverctl map -repeat $mode None XF86MonBrightnessUp   spawn 'light -A 1'
55    riverctl map -repeat $mode None XF86MonBrightnessDown spawn 'light -U 1'
56done
57
58riverctl border-width 2
59riverctl background-color 0x282a36
60
61wlr-randr --output eDP-1 --scale 1.7 # laptop display scale
62# `riverctl list-inputs`
63riverctl input pointer-2362-628-PIXA3854:00_093A:0274_Touchpad tap enabled
64riverctl input pointer-20547-23623-Ploopy_Corporation_Ploopy_Adept_Trackball_Mouse accel-profile flat
65riverctl input pointer-20547-23623-Ploopy_Corporation_Ploopy_Adept_Trackball_Mouse pointer-accel -0.65
66
67riverctl map normal $mod W send-layout-cmd rivercarro "main-location-cycle monocle,left"
68riverctl default-layout rivercarro
69rivercarro -main-location monocle -inner-gaps 3 -outer-gaps 1 &
70
71# auto-tag windows
72riverctl rule-add -app-id 'org.mozilla.firefox' tags $((1 << 0))  # tag 1
73riverctl rule-add -app-id 'irc-chat' tags $((1 << 1))             # tag 2
74riverctl rule-add -app-id 'term*' tags $((1 << 2))                # tag 3
75riverctl rule-add -app-id 'pico*' tags $((1 << 3))                # tag 4
76riverctl rule-add -app-id 'zmx*' tags $((1 << 4))                 # tag 5
77riverctl rule-add -app-id 'dot*' tags $((1 << 5))                 # tag 6
78
79# status bar
80waybar &
81# color temperature adjustment
82gammastep -l 42.265385:-83.716557 -t 6500:3500 &
83# GNOME font settings
84gsettings set org.gnome.desktop.interface font-name 'Noto Sans 10'
85# notification daemon
86mako &
87
88# auto-start windows
89riverctl spawn "firefox"