~yerinalexey/dotfiles

ref: a20b9321f36d731891bfadcdd178e7cf1c1e5af7 dotfiles/river/init -rwxr-xr-x 2.7 KiB
a20b9321Alexey Yerin rel: make unknown type error more descriptive 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/sh

mod="Mod4"

# Layout
riverctl layout rivertile left

# Move focus between windows
riverctl map normal $mod j focus-view next
riverctl map normal $mod k focus-view previous

# Swap windows
riverctl map normal $mod+Shift j swap next
riverctl map normal $mod+Shift k swap previous
riverctl map normal $mod+Shift h zoom

# Resize columns
riverctl map normal $mod h mod-main-factor -0.05
riverctl map normal $mod l mod-main-factor 0.05

# Move floating windows with mouse
riverctl map-pointer normal $mod BTN_LEFT move-view
riverctl map-pointer normal $mod BTN_RIGHT resize-view

# Toggle floating
riverctl map normal $mod Space toggle-float

# Quick launchers
riverctl map normal $mod Return spawn $TERMINAL
riverctl map normal $mod W spawn $BROWSER

# Start application launcher
riverctl map normal $mod D spawn bemenu-run -p "Run: "

# Fullscreen a view
riverctl map normal $mod F toggle-fullscreen

# Close current window
riverctl map normal $mod Q close

# Dismiss all notifications
riverctl map normal $mod+Shift D spawn fnottctl dismiss all

# Player controls
riverctl map normal $mod P spawn player-menu
riverctl map normal $mod bracketleft spawn playerctl-mod previous
riverctl map normal $mod backslash spawn playerctl-mod play-pause
riverctl map normal $mod bracketright spawn playerctl-mod next

# Music
riverctl map normal $mod+Shift M spawn $TERMINAL ncmpcpp
riverctl map normal $mod M spawn mpd-menu

# Volume stuff
riverctl map normal $mod v spawn $TERMINAL pulsemixer
riverctl map normal $mod+Shift bracketleft spawn pulsemixer --change-volume -5
riverctl map normal $mod+Shift bracketright spawn pulsemixer --change-volume +5

# Emoji 🤪
riverctl map normal $mod semicolon spawn emoji-menu

# Copy password
riverctl map normal $mod apostrophe spawn pass-menu

# Log out/shut down
riverctl map normal $mod+Shift Q spawn shutdown-menu

# Tags
for tag in $(seq 1 9); do
	# I honestly don't know what is this magic but it works
	tagmask=$((1 << ($tag - 1)))

	riverctl map normal $mod               $tag set-focused-tags $tagmask
	riverctl map normal $mod+Shift         $tag set-view-tags $tagmask
	riverctl map normal $mod+Control       $tag toggle-focused-tags $tagmask
	riverctl map normal $mod+Shift+Control $tag toggle-view-tags $tagmask
done

## Options
# Focus follows cursor
riverctl focus-follows-cursor normal

# Border colors
riverctl border-color-unfocused '#282c34'
riverctl border-color-focused '#a2b0c4'

# No useless padding
riverctl view-padding 0
riverctl outer-padding 0

# Autostart
autostart() {
	prog="$1"
	shift 1

	killall -q "$prog"
	riverctl spawn "$prog" "$@"
}

autostart waybar
autostart fnott
autostart swaybg -i "$XDG_CONFIG_HOME"/wall.jpg

# Music!
pgrep mpd >/dev/null \
	|| riverctl spawn mpd

autostart mpDris2

# Cron jobs
riverctl spawn pcrond-run