blob: 8118a211664389ac27908504013839693e76af0e (
plain)
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
#!/bin/sh
# River configuration ported from ~/.config/hypr.
# River classic is configured through riverctl and external layout generators.
# Environment inherited by applications started from River.
export XCURSOR_SIZE=24
export HYPRCURSOR_SIZE=24
CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
# Theme values are generated by apply-theme. Keep these fallbacks so the
# configuration remains usable before its first generated theme is installed.
theme_file="$CONFIG_DIR/river/generated-theme.sh"
if [ -r "$theme_file" ]; then
. "$theme_file"
else
RIVER_BACKGROUND_COLOR="0x1e1e2eff"
RIVER_BORDER_WIDTH=3
RIVER_BORDER_FOCUSED="0x33ccffee"
RIVER_BORDER_UNFOCUSED="0x595959aa"
RIVER_BORDER_URGENT="0xf5c2e7ff"
RIVER_GAP_INNER=5
RIVER_GAP_OUTER=5
fi
# Appearance: closest equivalent to the Hyprland configuration.
riverctl background-color "$RIVER_BACKGROUND_COLOR"
riverctl border-width "$RIVER_BORDER_WIDTH"
riverctl border-color-focused "$RIVER_BORDER_FOCUSED"
riverctl border-color-unfocused "$RIVER_BORDER_UNFOCUSED"
riverctl border-color-urgent "$RIVER_BORDER_URGENT"
riverctl focus-follows-cursor normal
riverctl set-cursor-warp disabled
riverctl keyboard-layout es
riverctl input '*' accel-profile flat
riverctl input '*' natural-scroll disabled
# rivertile is the available layout generator. Its main/stack layout is the
# closest equivalent to the current Hyprland master layout.
riverctl default-layout rivertile
rivertile -view-padding "$RIVER_GAP_INNER" -outer-padding "$RIVER_GAP_OUTER" \
-main-count 1 -main-ratio 0.55 &
# Start the services used by the Hyprland configuration.
command -v hypridle >/dev/null 2>&1 && hypridle &
command -v waybar >/dev/null 2>&1 && waybar &
command -v hyprpaper >/dev/null 2>&1 && hyprpaper &
# Helpers. riverctl's spawn command receives one shell command argument.
map() {
riverctl map normal "$@"
}
map_repeat() {
riverctl map -repeat normal "$@"
}
map_locked() {
riverctl map locked "$@"
}
map_locked_repeat() {
riverctl map -repeat locked "$@"
}
# Applications / launchers.
map Mod1 R spawn "rofi -show drun -theme '$CONFIG_DIR/rofi/config.rasi'"
map Mod1+Shift Return spawn 'foot'
map Mod1+Control L spawn 'hyprlock'
map Mod1 W spawn 'plumb'
map Mod1 E spawn 'dolphin'
map Mod1 F spawn 'firefox'
# Focus and window actions.
map Mod1 J focus-view next
map Mod1 K focus-view previous
map Mod1+Shift C close
map Mod1+Shift Space toggle-float
map Mod1 Tab focus-view previous
map Mod1 P zoom
map Mod1 Left focus-view left
map Mod1 Right focus-view right
map Mod1 Up focus-view up
map Mod1 Down focus-view down
# Output navigation.
map Mod1 comma focus-output previous
map Mod1 period focus-output next
map Mod1+Shift comma send-to-output -current-tags previous
map Mod1+Shift period send-to-output -current-tags next
# Tags 1-10 (River's equivalent of workspaces 1-10).
for i in $(seq 1 10); do
key=$((i % 10))
tag=$((1 << (i - 1)))
map Mod1 "$key" set-focused-tags "$tag"
map Mod1+Shift "$key" set-view-tags "$tag"
done
# Scratchpad approximation using tag 11.
# SUPER+S toggles tag 11 alongside the current tag; SUPER+SHIFT+S sends the
# focused view to it.
scratchpad_tag=$((1 << 10))
map Mod1 S toggle-focused-tags "$scratchpad_tag"
map Mod1+Shift S set-view-tags "$scratchpad_tag"
# Rivertile controls. These preserve the useful master-layout keymaps from
# Hyprland. River classic needs a separate layout generator for other layouts
# such as dwindle, scrolling and monocle.
map Mod1 I send-layout-cmd rivertile 'main-count +1'
map Mod1 D send-layout-cmd rivertile 'main-count -1'
map Mod1 H send-layout-cmd rivertile 'main-ratio -0.05'
map Mod1 L send-layout-cmd rivertile 'main-ratio +0.05'
map Mod1 Return swap next
map Mod1+Control D output-layout rivertile
map Mod1+Control M output-layout rivertile
map Mod1+Control S output-layout rivertile
map Mod1+Control N toggle-fullscreen
# Dwindle's togglesplit has no rivertile equivalent.
# SUPER+SHIFT+J is intentionally left unmapped rather than doing something
# surprising.
# Mouse bindings: move, toggle floating, resize.
riverctl map-pointer normal Mod1 BTN_LEFT move-view
riverctl map-pointer normal Mod1 BTN_MIDDLE toggle-float
riverctl map-pointer normal Mod1 BTN_RIGHT resize-view
# Multimedia keys. They are also available while the session is locked.
for mode in normal locked; do
if [ "$mode" = normal ]; then
map_cmd=map_repeat
map_plain=map
else
map_cmd=map_locked_repeat
map_plain=map_locked
fi
"$map_cmd" None XF86AudioRaiseVolume spawn 'wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+'
"$map_cmd" None XF86AudioLowerVolume spawn 'wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-'
"$map_plain" None XF86AudioMute spawn 'wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle'
"$map_plain" None XF86AudioMicMute spawn 'wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle'
"$map_cmd" None XF86MonBrightnessUp spawn 'brightnessctl -e4 -n2 set 5%+'
"$map_cmd" None XF86MonBrightnessDown spawn 'brightnessctl -e4 -n2 set 5%-'
"$map_plain" None XF86AudioNext spawn 'playerctl next'
"$map_plain" None XF86AudioPause spawn 'playerctl play-pause'
"$map_plain" None XF86AudioPlay spawn 'playerctl play-pause'
"$map_plain" None XF86AudioPrev spawn 'playerctl previous'
done
# Toggle Waybar visibility.
map Mod1 F2 spawn 'killall -SIGUSR1 waybar'
# Exit River. This replaces the Hyprland hyprshutdown fallback.
map Mod1+Shift Q exit
# A simple River equivalent of the Hyprland gamemode toggle: disable/restore
# view borders. River has no built-in animations, blur or rounded corners.
map Mod1 F1 spawn "$CONFIG_DIR/river/gamemode"
# Cursor zoom. River does not expose Hyprland's cursor.zoom_factor setting;
# use a compositor-independent magnifier if one is installed.
# SUPER+Z / SUPER+plus / SUPER+minus are therefore not mapped here.
|