~yerinalexey/dotfiles

ref: 0adec4c4229360c00332818277cc99677e955ebd dotfiles/river/init -rwxr-xr-x 3.7 KiB
0adec4c4Alexey Yerin ash: don't export PS1 3 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/sh

mod="Mod4"

# 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

# Floating move & resize
riverctl map normal $mod+Control h move left  10
riverctl map normal $mod+Control j move down  10
riverctl map normal $mod+Control k move up    10
riverctl map normal $mod+Control l move right 10

riverctl map normal $mod+Control+Shift h resize horizontal -10
riverctl map normal $mod+Control+Shift j resize vertical   -10
riverctl map normal $mod+Control+Shift k resize vertical   10
riverctl map normal $mod+Control+Shift l resize horizontal 10

# Resize columns
riverctl map normal $mod h mod-layout-value rivertile fixed main_factor -0.05
riverctl map normal $mod l mod-layout-value rivertile fixed 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

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

# 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 makoctl dismiss -a

# 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

# Volume stuff
riverctl map normal $mod v spawn $TERMINAL pulsemixer
riverctl map normal $mod+Shift bracketright spawn update-volume up
riverctl map normal $mod+Shift bracketleft  spawn update-volume down

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

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

# "Now it's safe to turn off your computer"
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

# "Scratchpad"
# Actually is a tenth workspace
riverctl map normal $mod minus 'set-view-tags'     $((1 << (10 - 1)))
riverctl map normal $mod equal toggle-focused-tags $((1 << (10 - 1)))

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

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

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

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

autostart yambar
autostart mako
autostart swaybg -i "$XDG_CONFIG_HOME"/wall.jpg

# Volume bar
start_wob() {
	# Clean up
	[ -e /tmp/wob-in ] && rm /tmp/wob-in

	border="#ff282c34"
	background="#ff131e26"

	mkfifo /tmp/wob-in
	tail -f /tmp/wob-in | wob \
	  -a top -a right -M 20 \
	  -W 35 -H 400 \
	  --overflow-mode nowrap \
	  --bar-color "#ff61afef" --overflow-bar-color "#ffec7171" \
	  --border-color "$border" --overflow-border-color "$border" \
	  --background-color "$background" --overflow-background-color "$background" &
}

killall wob
start_wob

# Cron jobs
riverctl spawn pcrond-run

# Layout
pgrep rivertile >/dev/null \
	|| riverctl spawn rivertile \
		-main-location left \
		-view-padding 0 -outer-padding 0

riverctl default-layout rivertile