···
2
-
app [main!] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.19.0/Hj-J_zxz7V9YurCSTFcFdu6cQJie4guzsPMUi5kBYUk.tar.br" }
2
+
app [main!] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.20.0/X73hGh05nNTkDHU06FHC0YfFaQB1pimX7gncRcao5mU.tar.br" }
# TODO: Create a platform that interfaces directly with the river wayland protocol
# TODO: Check for a cli argument to determine if the autostart commands should be run
12
+
Num.shift_left_by 1 (num - 1)
named_tag_to_rtag = |tag_name|
···
23
-
KeePassXC -> tag_to_rtag 10
24
-
Nautilus -> tag_to_rtag 11
25
-
Thunderbird -> tag_to_rtag 12
26
-
All -> (Num.shift_left_by 1 32) - 1
26
+
Discord -> tag_to_rtag 10
27
+
Games -> tag_to_rtag 11
28
+
Hide -> tag_to_rtag 12
29
+
KeePassXC -> tag_to_rtag 13
30
+
Nautilus -> tag_to_rtag 14
31
+
Signal -> tag_to_rtag 15
32
+
Steam -> tag_to_rtag 16
33
+
Thunderbird -> tag_to_rtag 17
34
+
All -> Num.to_str ((Num.shift_left_by 1 32) - 1)
29
-
home = Env.decode! "HOME" ?? "/"
37
+
"systemctl --user start river-session-pre.target",
38
+
"update-session-vars",
39
+
"systemctl --user start river-session.target",
41
+
"xrandr --output HDMI-A-5 --primary",
42
+
"rivertile -outer-padding 0 -view-padding 0 -main-ratio 0.5",
43
+
"swaybg -i /media/nextcloud/wallpapers/dark/evie-s-Pb1KFv4tauY-unsplash.jpg -m fill",
32
-
"systemctl --user start river-session-pre.target",
33
-
"update-session-vars",
34
-
"systemctl --user start river-session.target",
36
-
"rivertile -outer-padding 0 -view-padding 0 -main-ratio 0.5",
37
-
Str.replace_each "swaybg -i $HOME/pic/wallpapers/dark/evie-s-Pb1KFv4tauY-unsplash.jpg -m fill" "$HOME" home,
48
+
"org.mozilla.Thunderbird",
52
+
{ option: "allow-tearing", args: ["enabled"] },
{ option: "border-color-focused", args: ["0x93a1a1"] },
{ option: "border-color-unfocused", args: ["0x586e75"] },
55
+
{ option: "border-width", args: ["0"] },
{ option: "focus-follows-cursor", args: ["normal"] },
{ option: "set-cursor-warp", args: ["on-output-change"] },
{ option: "xcursor-theme", args: ["Adwaita", "24"] },
49
-
"pointer-1356-3570-Sony_Interactive_Entertainment_DualSense_Edge_Wireless_Controller_Touchpad",
59
+
{ option: "input", args: ["pointer-1356-3570-Sony_Interactive_Entertainment_DualSense_Edge_Wireless_Controller_Touchpad", "events", "disabled"] },
60
+
{ option: "input", args: ["pointer-4660-22136-extest_fake_device", "map-to-output", "HDMI-A-5"] },
64
+
{ id: "discord", title: "", action: "output", args: ["AOC 2460G4 0x0000075E"] },
65
+
{ id: "discord", title: "", action: "tags", args: [named_tag_to_rtag Discord] },
{ id: "org.gnome.Nautilus", title: "", action: "float", args: [] },
58
-
{ id: "org.gnome.Nautilus", title: "", action: "tags", args: [Num.to_str (named_tag_to_rtag Nautilus)] },
59
-
{ id: "org.gnome.Nautilus", title: "", action: "float", args: [] },
67
+
{ id: "org.gnome.Nautilus", title: "", action: "tags", args: [named_tag_to_rtag Nautilus] },
68
+
{ id: "org.keepassxc.KeePassXC", title: "", action: "csd", args: [] },
{ id: "org.keepassxc.KeePassXC", title: "", action: "float", args: [] },
62
-
id: "org.keepassxc.KeePassXC",
63
-
title: "KeyChain.kdbx [Locked] - KeePassXC",
65
-
args: [Num.to_str (named_tag_to_rtag KeePassXC)],
67
-
{ id: "org.mozilla.Thunderbird", title: "", action: "tags", args: [Num.to_str (named_tag_to_rtag Thunderbird)] },
70
+
{ id: "org.keepassxc.KeePassXC", title: "KeyChain.kdbx [Locked] - KeePassXC", action: "output", args: ["LG Electronics LG HDR WFHD 0x0000B11B"] },
71
+
{ id: "org.keepassxc.KeePassXC", title: "KeyChain.kdbx [Locked] - KeePassXC", action: "tags", args: [named_tag_to_rtag KeePassXC] },
72
+
{ id: "org.mozilla.Thunderbird", title: "", action: "output", args: ["LG Electronics LG HDR WFHD 0x0000B11B"] },
73
+
{ id: "org.mozilla.Thunderbird", title: "", action: "tags", args: [named_tag_to_rtag Thunderbird] },
74
+
{ id: "signal", title: "", action: "output", args: ["AOC 2460G4 0x0000075E"] },
75
+
{ id: "signal", title: "", action: "tags", args: [named_tag_to_rtag Signal] },
76
+
{ id: "steam", title: "", action: "output", args: ["LG Electronics LG HDR WFHD 0x0000B11B"] },
77
+
{ id: "steam", title: "", action: "tags", args: [named_tag_to_rtag Steam] },
78
+
{ id: "steam_app_*", title: "", action: "output", args: ["LG Electronics LG HDR WFHD 0x0000B11B"] },
79
+
{ id: "steam_app_*", title: "", action: "tags", args: [named_tag_to_rtag Games] },
···
List.range { start: At(1), end: At(9) }
87
-
key: Num.to_str tag_num,
88
-
cmd: "toggle-focused-tags",
89
-
args: [Num.to_str (tag_to_rtag tag_num)],
93
-
mods: [Super, Shift],
94
-
key: Num.to_str tag_num,
95
-
cmd: "toggle-view-tags",
96
-
args: [Num.to_str (tag_to_rtag tag_num)],
100
-
mods: [Super, Control],
101
-
key: Num.to_str tag_num,
102
-
cmd: "set-focused-tags",
103
-
args: [Num.to_str (tag_to_rtag tag_num)],
107
-
mods: [Super, Shift, Control],
108
-
key: Num.to_str tag_num,
109
-
cmd: "set-view-tags",
110
-
args: [Num.to_str (tag_to_rtag tag_num)],
96
+
tag_str = Num.to_str tag
98
+
{ mode: "normal", mods: [Super], key: tag_str, cmd: "toggle-focused-tags", args: [tag_to_rtag tag] },
99
+
{ mode: "normal", mods: [Super, Shift], key: tag_str, cmd: "toggle-view-tags", args: [tag_to_rtag tag] },
100
+
{ mode: "normal", mods: [Super, Control], key: tag_str, cmd: "set-focused-tags", args: [tag_to_rtag tag] },
101
+
{ mode: "normal", mods: [Super, Shift, Control], key: tag_str, cmd: "set-view-tags", args: [tag_to_rtag tag] },
121
-
cmd: "set-focused-tags",
122
-
args: [Num.to_str (named_tag_to_rtag All)],
126
-
mods: [Super, Shift],
128
-
cmd: "set-view-tags",
129
-
args: [Num.to_str (named_tag_to_rtag All)],
107
+
{ mode: "normal", mods: [Super], key: "0", cmd: "set-focused-tags", args: [named_tag_to_rtag All] },
108
+
{ mode: "normal", mods: [Super, Shift], key: "0", cmd: "set-view-tags", args: [named_tag_to_rtag All] },
111
+
# Hide applications
112
+
{ mode: "normal", mods: [Super], key: "H", cmd: "set-view-tags", args: [named_tag_to_rtag Hide] },
113
+
{ mode: "normal", mods: [Super, Control], key: "H", cmd: "set-focused-tags", args: [named_tag_to_rtag Hide] },
116
+
special_tag_binds = |named_tag, key| [
117
+
{ mode: "special-tags", mods: [None], key: key, cmd: "toggle-focused-tags", args: [named_tag_to_rtag named_tag] },
118
+
{ mode: "special-tags", mods: [Shift], key: key, cmd: "toggle-view-tags", args: [named_tag_to_rtag named_tag] },
119
+
{ mode: "special-tags", mods: [Control], key: key, cmd: "set-focused-tags", args: [named_tag_to_rtag named_tag] },
120
+
{ mode: "special-tags", mods: [Shift, Control], key: key, cmd: "set-view-tags", args: [named_tag_to_rtag named_tag] },
···
{ mode: "normal", mods: [Super, Alt], key: "X", cmd: "focus-output", args: ["previous"] },
{ mode: "normal", mods: [Super, Control], key: "X", cmd: "send-to-output", args: ["next"] },
{ mode: "normal", mods: [Super, Control, Alt], key: "X", cmd: "send-to-output", args: ["previous"] },
152
-
mods: [Super, Shift, Control],
154
-
cmd: "send-to-output",
155
-
args: ["-current-tags", "next"],
159
-
mods: [Super, Shift, Control, Alt],
161
-
cmd: "send-to-output",
162
-
args: ["-current-tags", "previous"],
140
+
{ mode: "normal", mods: [Super, Shift, Control], key: "X", cmd: "send-to-output", args: ["-current-tags", "next"] },
141
+
{ mode: "normal", mods: [Super, Shift, Control, Alt], key: "X", cmd: "send-to-output", args: ["-current-tags", "previous"] },
{ mode: "normal", mods: [Super, Control], key: "Escape", cmd: "exit", args: [] },
···
{ mode: "normal", mods: [Super], key: "Down", cmd: "send-layout-cmd", args: ["rivertile", "main-location bottom"] },
{ mode: "normal", mods: [Super], key: "Right", cmd: "send-layout-cmd", args: ["rivertile", "main-location right"] },
{ mode: "normal", mods: [Super], key: "Bracketleft", cmd: "send-layout-cmd", args: ["rivertile", "main-count -1"] },
184
-
key: "Bracketright",
185
-
cmd: "send-layout-cmd",
186
-
args: ["rivertile", "main-count +1"],
190
-
mods: [Super, Control],
191
-
key: "Bracketleft",
192
-
cmd: "send-layout-cmd",
193
-
args: ["rivertile", "main-ratio -0.05"],
197
-
mods: [Super, Control],
198
-
key: "Bracketright",
199
-
cmd: "send-layout-cmd",
200
-
args: ["rivertile", "main-ratio +0.05"],
159
+
{ mode: "normal", mods: [Super], key: "Bracketright", cmd: "send-layout-cmd", args: ["rivertile", "main-count +1"] },
160
+
{ mode: "normal", mods: [Super, Control], key: "Bracketleft", cmd: "send-layout-cmd", args: ["rivertile", "main-ratio -0.05"] },
161
+
{ mode: "normal", mods: [Super, Control], key: "Bracketright", cmd: "send-layout-cmd", args: ["rivertile", "main-ratio +0.05"] },
{ mode: "normal", mods: [Super], key: "Space", cmd: "zoom", args: [] },
{ mode: "normal", mods: [Super], key: "Comma", cmd: "focus-view", args: ["previous"] },
{ mode: "normal", mods: [Super], key: "Period", cmd: "focus-view", args: ["next"] },
···
{ mode: "normal", mods: [Super], key: "G", cmd: "enter-mode", args: ["special-tags"] },
{ mode: "special-tags", mods: [None], key: "Escape", cmd: "enter-mode", args: ["normal"] },
218
-
mode: "special-tags",
221
-
cmd: "toggle-focused-tags",
222
-
args: [Num.to_str (named_tag_to_rtag KeePassXC)],
225
-
mode: "special-tags",
228
-
cmd: "toggle-view-tags",
229
-
args: [Num.to_str (named_tag_to_rtag KeePassXC)],
232
-
mode: "special-tags",
235
-
cmd: "set-focused-tags",
236
-
args: [Num.to_str (named_tag_to_rtag KeePassXC)],
239
-
mode: "special-tags",
240
-
mods: [Shift, Control],
242
-
cmd: "set-view-tags",
243
-
args: [Num.to_str (named_tag_to_rtag KeePassXC)],
248
-
mode: "special-tags",
251
-
cmd: "toggle-focused-tags",
252
-
args: [Num.to_str (named_tag_to_rtag Thunderbird)],
255
-
mode: "special-tags",
258
-
cmd: "toggle-view-tags",
259
-
args: [Num.to_str (named_tag_to_rtag Thunderbird)],
262
-
mode: "special-tags",
265
-
cmd: "set-focused-tags",
266
-
args: [Num.to_str (named_tag_to_rtag Thunderbird)],
269
-
mode: "special-tags",
270
-
mods: [Shift, Control],
272
-
cmd: "set-view-tags",
273
-
args: [Num.to_str (named_tag_to_rtag Thunderbird)],
278
-
mode: "special-tags",
281
-
cmd: "toggle-focused-tags",
282
-
args: [Num.to_str (named_tag_to_rtag Nautilus)],
285
-
mode: "special-tags",
288
-
cmd: "toggle-view-tags",
289
-
args: [Num.to_str (named_tag_to_rtag Nautilus)],
292
-
mode: "special-tags",
295
-
cmd: "set-focused-tags",
296
-
args: [Num.to_str (named_tag_to_rtag Nautilus)],
299
-
mode: "special-tags",
300
-
mods: [Shift, Control],
302
-
cmd: "set-view-tags",
303
-
args: [Num.to_str (named_tag_to_rtag Nautilus)],
307
-
tag_to_rtag = |num|
308
-
Num.shift_left_by 1 (num - 1)
···
195
+
|> Cmd.exec_exit_code!
Ok exit_code if exit_code == 0 -> Ok {}
···
208
+
autostart_apps_cmds =
···
242
+
|> List.concat (special_tag_binds Discord "D")
243
+
|> List.concat (special_tag_binds Games "G")
244
+
|> List.concat (special_tag_binds KeePassXC "K")
245
+
|> List.concat (special_tag_binds Nautilus "N")
246
+
|> List.concat (special_tag_binds Signal "M")
247
+
|> List.concat (special_tag_binds Steam "S")
248
+
|> List.concat (special_tag_binds Thunderbird "T")
|> List.map |{ mode, mods, key, cmd, args }|
["map", mode, Str.join_with (List.map mods mod_str) "+", key, cmd]
···
|> List.concat pointer_bind_cmds
|> List.concat keybind_cmds
260
+
|> List.concat autostart_apps_cmds