···
-
app [main!] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.19.0/Hj-J_zxz7V9YurCSTFcFdu6cQJie4guzsPMUi5kBYUk.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
named_tag_to_rtag = |tag_name|
···
-
KeePassXC -> tag_to_rtag 10
-
Nautilus -> tag_to_rtag 11
-
Thunderbird -> tag_to_rtag 12
-
All -> (Num.shift_left_by 1 32) - 1
-
home = Env.decode! "HOME" ?? "/"
-
"systemctl --user start river-session-pre.target",
-
"systemctl --user start river-session.target",
-
"rivertile -outer-padding 0 -view-padding 0 -main-ratio 0.5",
-
Str.replace_each "swaybg -i $HOME/pic/wallpapers/dark/evie-s-Pb1KFv4tauY-unsplash.jpg -m fill" "$HOME" home,
{ option: "border-color-focused", args: ["0x93a1a1"] },
{ option: "border-color-unfocused", args: ["0x586e75"] },
{ option: "focus-follows-cursor", args: ["normal"] },
{ option: "set-cursor-warp", args: ["on-output-change"] },
{ option: "xcursor-theme", args: ["Adwaita", "24"] },
-
"pointer-1356-3570-Sony_Interactive_Entertainment_DualSense_Edge_Wireless_Controller_Touchpad",
{ id: "org.gnome.Nautilus", title: "", action: "float", args: [] },
-
{ id: "org.gnome.Nautilus", title: "", action: "tags", args: [Num.to_str (named_tag_to_rtag Nautilus)] },
-
{ id: "org.gnome.Nautilus", title: "", action: "float", args: [] },
{ id: "org.keepassxc.KeePassXC", title: "", action: "float", args: [] },
-
id: "org.keepassxc.KeePassXC",
-
title: "KeyChain.kdbx [Locked] - KeePassXC",
-
args: [Num.to_str (named_tag_to_rtag KeePassXC)],
-
{ id: "org.mozilla.Thunderbird", title: "", action: "tags", args: [Num.to_str (named_tag_to_rtag Thunderbird)] },
···
List.range { start: At(1), end: At(9) }
-
key: Num.to_str tag_num,
-
cmd: "toggle-focused-tags",
-
args: [Num.to_str (tag_to_rtag tag_num)],
-
key: Num.to_str tag_num,
-
cmd: "toggle-view-tags",
-
args: [Num.to_str (tag_to_rtag tag_num)],
-
mods: [Super, Control],
-
key: Num.to_str tag_num,
-
cmd: "set-focused-tags",
-
args: [Num.to_str (tag_to_rtag tag_num)],
-
mods: [Super, Shift, Control],
-
key: Num.to_str tag_num,
-
args: [Num.to_str (tag_to_rtag tag_num)],
-
cmd: "set-focused-tags",
-
args: [Num.to_str (named_tag_to_rtag All)],
-
args: [Num.to_str (named_tag_to_rtag All)],
···
{ 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"] },
-
mods: [Super, Shift, Control],
-
args: ["-current-tags", "next"],
-
mods: [Super, Shift, Control, Alt],
-
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"] },
-
cmd: "send-layout-cmd",
-
args: ["rivertile", "main-count +1"],
-
mods: [Super, Control],
-
cmd: "send-layout-cmd",
-
args: ["rivertile", "main-ratio -0.05"],
-
mods: [Super, Control],
-
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"] },
-
cmd: "toggle-focused-tags",
-
args: [Num.to_str (named_tag_to_rtag KeePassXC)],
-
cmd: "toggle-view-tags",
-
args: [Num.to_str (named_tag_to_rtag KeePassXC)],
-
cmd: "set-focused-tags",
-
args: [Num.to_str (named_tag_to_rtag KeePassXC)],
-
mods: [Shift, Control],
-
args: [Num.to_str (named_tag_to_rtag KeePassXC)],
-
cmd: "toggle-focused-tags",
-
args: [Num.to_str (named_tag_to_rtag Thunderbird)],
-
cmd: "toggle-view-tags",
-
args: [Num.to_str (named_tag_to_rtag Thunderbird)],
-
cmd: "set-focused-tags",
-
args: [Num.to_str (named_tag_to_rtag Thunderbird)],
-
mods: [Shift, Control],
-
args: [Num.to_str (named_tag_to_rtag Thunderbird)],
-
cmd: "toggle-focused-tags",
-
args: [Num.to_str (named_tag_to_rtag Nautilus)],
-
cmd: "toggle-view-tags",
-
args: [Num.to_str (named_tag_to_rtag Nautilus)],
-
cmd: "set-focused-tags",
-
args: [Num.to_str (named_tag_to_rtag Nautilus)],
-
mods: [Shift, Control],
-
args: [Num.to_str (named_tag_to_rtag Nautilus)],
-
Num.shift_left_by 1 (num - 1)
···
Ok exit_code if exit_code == 0 -> Ok {}
···
···
|> 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
···
+
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
+
Num.shift_left_by 1 (num - 1)
named_tag_to_rtag = |tag_name|
···
+
Discord -> tag_to_rtag 10
+
Games -> tag_to_rtag 11
+
KeePassXC -> tag_to_rtag 13
+
Nautilus -> tag_to_rtag 14
+
Signal -> tag_to_rtag 15
+
Steam -> tag_to_rtag 16
+
Thunderbird -> tag_to_rtag 17
+
All -> Num.to_str ((Num.shift_left_by 1 32) - 1)
+
"systemctl --user start river-session-pre.target",
+
"systemctl --user start river-session.target",
+
"xrandr --output HDMI-A-5 --primary",
+
"rivertile -outer-padding 0 -view-padding 0 -main-ratio 0.5",
+
"swaybg -i /media/nextcloud/wallpapers/dark/evie-s-Pb1KFv4tauY-unsplash.jpg -m fill",
+
"org.mozilla.Thunderbird",
+
{ option: "allow-tearing", args: ["enabled"] },
{ option: "border-color-focused", args: ["0x93a1a1"] },
{ option: "border-color-unfocused", args: ["0x586e75"] },
+
{ 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"] },
+
{ option: "input", args: ["pointer-1356-3570-Sony_Interactive_Entertainment_DualSense_Edge_Wireless_Controller_Touchpad", "events", "disabled"] },
+
{ option: "input", args: ["pointer-4660-22136-extest_fake_device", "map-to-output", "HDMI-A-5"] },
+
{ id: "discord", title: "", action: "output", args: ["AOC 2460G4 0x0000075E"] },
+
{ id: "discord", title: "", action: "tags", args: [named_tag_to_rtag Discord] },
{ id: "org.gnome.Nautilus", title: "", action: "float", args: [] },
+
{ id: "org.gnome.Nautilus", title: "", action: "tags", args: [named_tag_to_rtag Nautilus] },
+
{ id: "org.keepassxc.KeePassXC", title: "", action: "csd", args: [] },
{ id: "org.keepassxc.KeePassXC", title: "", action: "float", args: [] },
+
{ id: "org.keepassxc.KeePassXC", title: "KeyChain.kdbx [Locked] - KeePassXC", action: "output", args: ["LG Electronics LG HDR WFHD 0x0000B11B"] },
+
{ id: "org.keepassxc.KeePassXC", title: "KeyChain.kdbx [Locked] - KeePassXC", action: "tags", args: [named_tag_to_rtag KeePassXC] },
+
{ id: "org.mozilla.Thunderbird", title: "", action: "output", args: ["LG Electronics LG HDR WFHD 0x0000B11B"] },
+
{ id: "org.mozilla.Thunderbird", title: "", action: "tags", args: [named_tag_to_rtag Thunderbird] },
+
{ id: "signal", title: "", action: "output", args: ["AOC 2460G4 0x0000075E"] },
+
{ id: "signal", title: "", action: "tags", args: [named_tag_to_rtag Signal] },
+
{ id: "steam", title: "", action: "output", args: ["LG Electronics LG HDR WFHD 0x0000B11B"] },
+
{ id: "steam", title: "", action: "tags", args: [named_tag_to_rtag Steam] },
+
{ id: "steam_app_*", title: "", action: "output", args: ["LG Electronics LG HDR WFHD 0x0000B11B"] },
+
{ id: "steam_app_*", title: "", action: "tags", args: [named_tag_to_rtag Games] },
···
List.range { start: At(1), end: At(9) }
+
tag_str = Num.to_str tag
+
{ mode: "normal", mods: [Super], key: tag_str, cmd: "toggle-focused-tags", args: [tag_to_rtag tag] },
+
{ mode: "normal", mods: [Super, Shift], key: tag_str, cmd: "toggle-view-tags", args: [tag_to_rtag tag] },
+
{ mode: "normal", mods: [Super, Control], key: tag_str, cmd: "set-focused-tags", args: [tag_to_rtag tag] },
+
{ mode: "normal", mods: [Super, Shift, Control], key: tag_str, cmd: "set-view-tags", args: [tag_to_rtag tag] },
+
{ mode: "normal", mods: [Super], key: "0", cmd: "set-focused-tags", args: [named_tag_to_rtag All] },
+
{ mode: "normal", mods: [Super, Shift], key: "0", cmd: "set-view-tags", args: [named_tag_to_rtag All] },
+
{ mode: "normal", mods: [Super], key: "H", cmd: "set-view-tags", args: [named_tag_to_rtag Hide] },
+
{ mode: "normal", mods: [Super, Control], key: "H", cmd: "set-focused-tags", args: [named_tag_to_rtag Hide] },
+
special_tag_binds = |named_tag, key| [
+
{ mode: "special-tags", mods: [None], key: key, cmd: "toggle-focused-tags", args: [named_tag_to_rtag named_tag] },
+
{ mode: "special-tags", mods: [Shift], key: key, cmd: "toggle-view-tags", args: [named_tag_to_rtag named_tag] },
+
{ mode: "special-tags", mods: [Control], key: key, cmd: "set-focused-tags", args: [named_tag_to_rtag named_tag] },
+
{ 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"] },
+
{ mode: "normal", mods: [Super, Shift, Control], key: "X", cmd: "send-to-output", args: ["-current-tags", "next"] },
+
{ 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"] },
+
{ mode: "normal", mods: [Super], key: "Bracketright", cmd: "send-layout-cmd", args: ["rivertile", "main-count +1"] },
+
{ mode: "normal", mods: [Super, Control], key: "Bracketleft", cmd: "send-layout-cmd", args: ["rivertile", "main-ratio -0.05"] },
+
{ 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"] },
···
Ok exit_code if exit_code == 0 -> Ok {}
···
···
+
|> List.concat (special_tag_binds Discord "D")
+
|> List.concat (special_tag_binds Games "G")
+
|> List.concat (special_tag_binds KeePassXC "K")
+
|> List.concat (special_tag_binds Nautilus "N")
+
|> List.concat (special_tag_binds Signal "M")
+
|> List.concat (special_tag_binds Steam "S")
+
|> 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
+
|> List.concat autostart_apps_cmds