diff --git a/modules/user/lucid/lucid-glass-impreza.lua b/host/Impreza/modules/lucid/lucid-glass-impreza.lua similarity index 100% rename from modules/user/lucid/lucid-glass-impreza.lua rename to host/Impreza/modules/lucid/lucid-glass-impreza.lua diff --git a/modules/user/lucid/lucid-prefs-impreza.json b/host/Impreza/modules/lucid/lucid-prefs-impreza.json similarity index 100% rename from modules/user/lucid/lucid-prefs-impreza.json rename to host/Impreza/modules/lucid/lucid-prefs-impreza.json diff --git a/modules/user/lucid/lucid-settings-impreza.lua b/host/Impreza/modules/lucid/lucid-settings-impreza.lua similarity index 100% rename from modules/user/lucid/lucid-settings-impreza.lua rename to host/Impreza/modules/lucid/lucid-settings-impreza.lua diff --git a/modules/user/lucid/lucid-widgets-impreza.json b/host/Impreza/modules/lucid/lucid-widgets-impreza.json similarity index 100% rename from modules/user/lucid/lucid-widgets-impreza.json rename to host/Impreza/modules/lucid/lucid-widgets-impreza.json diff --git a/modules/user/lucid/lucid-widgets-rias.json b/host/Rias/modules/lucid/lucid-widgets-rias.json similarity index 100% rename from modules/user/lucid/lucid-widgets-rias.json rename to host/Rias/modules/lucid/lucid-widgets-rias.json diff --git a/modules/user/lucid/default.nix b/modules/user/lucid/default.nix index 031fb5f..605b1b5 100644 --- a/modules/user/lucid/default.nix +++ b/modules/user/lucid/default.nix @@ -2,12 +2,16 @@ let host = osConfig.networking.hostName; isChest = config.home.username == "chest"; + isSweetbread = config.home.username == "sweetbread"; isRias = host == "Rias"; + sweetbreadLucid = ../../../user/sweetbread/modules/lucid; + riasLucid = ../../../host/Rias/modules/lucid; + imprezaLucid = ../../../host/Impreza/modules/lucid; specialBindIds = [ "scratchpad" "scratchpad-stash" "special-music" "special-comms" "special-todo" "special-sysmon" "daemons-workspace" ]; specialSeed = pkgs.writeText "lucid-special-bindings.json" (builtins.toJSON { version = 1; binds = builtins.filter (entry: builtins.elem entry.id specialBindIds) - (builtins.fromJSON (builtins.readFile ./lucid-keybinds-rias.json)).binds; + (builtins.fromJSON (builtins.readFile ./lucid-keybind-catalog.json)).binds; }); chestBindingsScript = pkgs.writeText "lucid-chest-bindings.py" '' import hashlib @@ -56,7 +60,7 @@ json.dump({"version": 1, "binds": result + specials}, open(output, "w"), indent= ''; chestSeed = pkgs.runCommand "lucid-chest-bindings.json" { nativeBuildInputs = [ pkgs.python3 ]; } '' python3 ${chestBindingsScript} ${lib.escapeShellArg (builtins.toJSON config.lucidHyprlandBinds)} \ - ${./lucid-keybinds-rias.json} ${specialSeed} "$out" + ${./lucid-keybind-catalog.json} ${specialSeed} "$out" ''; staticBindKeys = map (entry: builtins.elemAt entry._args 0) config.wayland.windowManager.hyprland.settings.bind; nonRiasBinds = pkgs.runCommand "lucid-nix-binds.lua" { nativeBuildInputs = [ pkgs.python3 ]; } '' @@ -357,10 +361,10 @@ dock_path.write_text(dock) wallpaperDir = "${config.home.homeDirectory}/Wallpapers"; wallpaperScript = "${config.home.homeDirectory}/.config/hypr/scripts/wallpaper/set-wallpaper.sh"; widgetLayout = if osConfig.networking.hostName == "Rias" - then ./lucid-widgets-rias.json - else if isChest && host == "Impreza" then ./lucid-widgets-impreza.json + then riasLucid + "/lucid-widgets-rias.json" + else if isChest && host == "Impreza" then imprezaLucid + "/lucid-widgets-impreza.json" else null; - bindSeed = if config.home.username == "sweetbread" then ./lucid-keybinds-rias.json + bindSeed = if isSweetbread then sweetbreadLucid + "/lucid-keybinds.json" else chestSeed; specialCustomValue = builtins.toJSON [ { key = "daemons"; @@ -370,7 +374,7 @@ dock_path.write_text(dock) apps = ""; } ]; genericPrefsSeed = pkgs.writeText "lucid-default-prefs.json" (builtins.toJSON ( - (builtins.fromJSON (builtins.readFile ./lucid-prefs.json)) // { + (builtins.fromJSON (builtins.readFile (sweetbreadLucid + "/lucid-prefs.json"))) // { specialCustom = if isRias then "[]" else specialCustomValue; } )); @@ -378,8 +382,8 @@ dock_path.write_text(dock) ${pkgs.jq}/bin/jq --arg specialCustom ${lib.escapeShellArg specialCustomValue} \ '.specialCustom = $specialCustom' ${source}/defaults/prefs.json > "$out" ''; - prefsSeed = if config.home.username == "sweetbread" then genericPrefsSeed - else if isChest && host == "Impreza" then ./lucid-prefs-impreza.json + prefsSeed = if isSweetbread then genericPrefsSeed + else if isChest && host == "Impreza" then imprezaLucid + "/lucid-prefs-impreza.json" else chestPrefsSeed; defaultWallpaper = "${wallpaperDir}/bluehour.jpg"; hyprLua = import ../hyprland/lua.nix { inherit lib; }; @@ -700,11 +704,11 @@ in { $DRY_RUN_CMD install -m644 ${shellFile} "$target/shell.qml" $DRY_RUN_CMD install -m644 ${./LucidBar.qml} "$target/LucidBar.qml" $DRY_RUN_CMD install -m644 ${./Vaultwarden.qml} "$target/Vaultwarden.qml" - ${lib.optionalString (!isChest) '' - $DRY_RUN_CMD install -m644 ${./Agenda.qml} "$target/Agenda.qml" - $DRY_RUN_CMD install -m644 ${./CalendarSource.qml} "$target/CalendarSource.qml" - $DRY_RUN_CMD install -m644 ${./ClockCalendar.qml} "$target/lucidbar/ClockCalendar.qml" - $DRY_RUN_CMD install -m644 ${./thunderbird-calendar.py} "$target/thunderbird-calendar.py" + ${lib.optionalString isSweetbread '' + $DRY_RUN_CMD install -m644 ${sweetbreadLucid}/Agenda.qml "$target/Agenda.qml" + $DRY_RUN_CMD install -m644 ${sweetbreadLucid}/CalendarSource.qml "$target/CalendarSource.qml" + $DRY_RUN_CMD install -m644 ${sweetbreadLucid}/ClockCalendar.qml "$target/lucidbar/ClockCalendar.qml" + $DRY_RUN_CMD install -m644 ${sweetbreadLucid}/thunderbird-calendar.py "$target/thunderbird-calendar.py" ''} $DRY_RUN_CMD install -m644 ${./WidgetLayer.qml} "$target/lucidwidgets/WidgetLayer.qml" $DRY_RUN_CMD install -m644 ${./WidgetsPage.qml} "$target/lucidprefs/WidgetsPage.qml" @@ -760,11 +764,11 @@ in { ''} ${lib.optionalString (isChest && host == "Impreza") '' if [ ! -e "${config.home.homeDirectory}/.config/hypr/lucid-settings.lua" ]; then - $DRY_RUN_CMD install -m644 ${./lucid-settings-impreza.lua} \ + $DRY_RUN_CMD install -m644 ${imprezaLucid}/lucid-settings-impreza.lua \ "${config.home.homeDirectory}/.config/hypr/lucid-settings.lua" fi if [ ! -e "${config.home.homeDirectory}/.config/hypr/lucid-glass.lua" ]; then - $DRY_RUN_CMD install -m644 ${./lucid-glass-impreza.lua} \ + $DRY_RUN_CMD install -m644 ${imprezaLucid}/lucid-glass-impreza.lua \ "${config.home.homeDirectory}/.config/hypr/lucid-glass.lua" fi ''} diff --git a/modules/user/lucid/lucid-keybind-catalog.json b/modules/user/lucid/lucid-keybind-catalog.json new file mode 100644 index 0000000..76280ee --- /dev/null +++ b/modules/user/lucid/lucid-keybind-catalog.json @@ -0,0 +1,483 @@ +{ + "version": 1, + "binds": [ + { + "id": "wallpaper-picker", + "keys": "SUPER + W", + "desc": "Wallpaper picker", + "category": "Lucid" + }, + { + "id": "wallpaper-random", + "keys": "SUPER + SHIFT + W", + "desc": "Set a random wallpaper", + "category": "Desktop" + }, + { + "id": "calculator-volume", + "keys": "XF86Calculator", + "desc": "Open volume mixer", + "category": "Apps" + }, + { + "id": "zoom-reset-scroll-up", + "keys": "SUPER + SHIFT + mouse_up", + "desc": "Reset cursor zoom", + "category": "Accessibility" + }, + { + "id": "zoom-reset-scroll-down", + "keys": "SUPER + SHIFT + mouse_down", + "desc": "Reset cursor zoom", + "category": "Accessibility" + }, + { + "id": "zoom-reset-minus", + "keys": "SUPER + SHIFT + minus", + "desc": "Reset cursor zoom", + "category": "Accessibility" + }, + { + "id": "zoom-reset-kp-subtract", + "keys": "SUPER + SHIFT + KP_SUBTRACT", + "desc": "Reset cursor zoom", + "category": "Accessibility" + }, + { + "id": "zoom-reset-zero", + "keys": "SUPER + SHIFT + 0", + "desc": "Reset cursor zoom", + "category": "Accessibility" + }, + { + "id": "zoom-in-equal", + "keys": "SUPER + equal", + "desc": "Zoom in", + "category": "Accessibility", + "opts": { + "repeating": true + } + }, + { + "id": "zoom-out-minus", + "keys": "SUPER + minus", + "desc": "Zoom out", + "category": "Accessibility", + "opts": { + "repeating": true + } + }, + { + "id": "zoom-in-kp-add", + "keys": "SUPER + KP_ADD", + "desc": "Zoom in", + "category": "Accessibility", + "opts": { + "repeating": true + } + }, + { + "id": "zoom-out-kp-subtract", + "keys": "SUPER + KP_SUBTRACT", + "desc": "Zoom out", + "category": "Accessibility", + "opts": { + "repeating": true + } + }, + { + "id": "widgets-panel", + "keys": "SUPER + SHIFT + G", + "desc": "Toggle widgets panel", + "category": "Lucid" + }, + { + "id": "launcher", + "keys": "SUPER + D", + "desc": "App launcher", + "category": "Lucid" + }, + { + "id": "vaultwarden-password", + "keys": "SUPER + X", + "desc": "Type a password from Vaultwarden", + "category": "Apps" + }, + { + "id": "clipse", + "keys": "SUPER + V", + "desc": "Clipboard manager", + "category": "Apps" + }, + { + "id": "clipboard", + "keys": "SUPER + SHIFT + V", + "desc": "Clipboard history", + "category": "Lucid" + }, + { + "id": "screenshot", + "keys": "Print", + "desc": "Full screenshot", + "category": "Screenshots" + }, + { + "id": "screenshot-full", + "keys": "SUPER + Print", + "desc": "Full screenshot", + "category": "Screenshots" + }, + { + "id": "screenshot-region", + "keys": "CTRL + Print", + "desc": "Region screenshot", + "category": "Screenshots" + }, + { + "id": "screenshot-window", + "keys": "ALT + Print", + "desc": "Window screenshot", + "category": "Screenshots" + }, + { + "id": "terminal", + "keys": "SUPER + RETURN", + "desc": "Terminal", + "category": "Apps" + }, + { + "id": "close-window", + "keys": "SUPER + Q", + "desc": "Close window", + "category": "Windows" + }, + { + "id": "exit-hyprland", + "keys": "SUPER + M", + "desc": "Exit Hyprland", + "category": "Session" + }, + { + "id": "file-manager", + "keys": "SUPER + E", + "desc": "File manager", + "category": "Apps" + }, + { + "id": "toggle-float", + "keys": "SUPER + F", + "desc": "Toggle floating window", + "category": "Windows" + }, + { + "id": "toggle-pseudo", + "keys": "SUPER + P", + "desc": "Toggle pseudo-tile", + "category": "Windows" + }, + { + "id": "toggle-split", + "keys": "SUPER + J", + "desc": "Toggle split direction", + "category": "Windows" + }, + { + "id": "swap-split", + "keys": "SUPER + K", + "desc": "Swap split direction", + "category": "Windows" + }, + { + "id": "focus-left", + "keys": "SUPER + LEFT", + "desc": "Focus left", + "category": "Windows" + }, + { + "id": "focus-right", + "keys": "SUPER + RIGHT", + "desc": "Focus right", + "category": "Windows" + }, + { + "id": "focus-up", + "keys": "SUPER + UP", + "desc": "Focus up", + "category": "Windows" + }, + { + "id": "focus-down", + "keys": "SUPER + DOWN", + "desc": "Focus down", + "category": "Windows" + }, + { + "id": "swap-left", + "keys": "SUPER + SHIFT + LEFT", + "desc": "Move window left", + "category": "Windows" + }, + { + "id": "swap-right", + "keys": "SUPER + SHIFT + RIGHT", + "desc": "Move window right", + "category": "Windows" + }, + { + "id": "swap-up", + "keys": "SUPER + SHIFT + UP", + "desc": "Move window up", + "category": "Windows" + }, + { + "id": "swap-down", + "keys": "SUPER + SHIFT + DOWN", + "desc": "Move window down", + "category": "Windows" + }, + { + "id": "resize-left", + "keys": "SUPER + CTRL + LEFT", + "desc": "Resize window left", + "category": "Windows" + }, + { + "id": "resize-right", + "keys": "SUPER + CTRL + RIGHT", + "desc": "Resize window right", + "category": "Windows" + }, + { + "id": "resize-up", + "keys": "SUPER + CTRL + UP", + "desc": "Resize window up", + "category": "Windows" + }, + { + "id": "resize-down", + "keys": "SUPER + CTRL + DOWN", + "desc": "Resize window down", + "category": "Windows" + }, + { + "id": "workspace-focus", + "keys": "SUPER + {key}", + "desc": "Focus workspace {n}", + "category": "Workspaces", + "each": "workspace" + }, + { + "id": "workspace-move", + "keys": "SUPER + SHIFT + {key}", + "desc": "Move window to workspace {n}", + "category": "Workspaces", + "each": "workspace" + }, + { + "id": "scratchpad", + "keys": "SUPER + ALT + P", + "desc": "Toggle scratchpad", + "category": "Workspaces", + "type": "lua", + "lua": "specials.scratchpad()" + }, + { + "id": "scratchpad-stash", + "keys": "SUPER + ALT + S", + "desc": "Stash or restore the focused window", + "category": "Workspaces", + "type": "lua", + "lua": "specials.stash()" + }, + { + "id": "special-music", + "keys": "SUPER + ALT + M", + "desc": "Toggle Music workspace", + "category": "Workspaces", + "type": "lua", + "lua": "specials.toggle('music')" + }, + { + "id": "special-comms", + "keys": "SUPER + ALT + C", + "desc": "Toggle Comms workspace", + "category": "Workspaces", + "type": "lua", + "lua": "specials.toggle('comms')" + }, + { + "id": "special-todo", + "keys": "SUPER + ALT + T", + "desc": "Toggle To-do workspace", + "category": "Workspaces", + "type": "lua", + "lua": "specials.toggle('todo')" + }, + { + "id": "special-sysmon", + "keys": "SUPER + ALT + B", + "desc": "Toggle system monitor workspace", + "category": "Workspaces", + "type": "lua", + "lua": "specials.toggle('sysmon')" + }, + { + "id": "daemons-workspace", + "keys": "SUPER + ALT + D", + "desc": "Daemons workspace", + "category": "Workspaces", + "type": "lua", + "lua": "specials.toggle('daemons')" + }, + { + "id": "fullscreen", + "keys": "SUPER + SHIFT + F", + "desc": "Toggle fullscreen", + "category": "Windows" + }, + { + "id": "workspace-next-scroll", + "keys": "SUPER + mouse_down", + "desc": "Next workspace", + "category": "Workspaces" + }, + { + "id": "workspace-previous-scroll", + "keys": "SUPER + mouse_up", + "desc": "Previous workspace", + "category": "Workspaces" + }, + { + "id": "keyboard-brightness-up", + "keys": "SUPER + F3", + "desc": "Keyboard backlight up", + "category": "Displays" + }, + { + "id": "keyboard-brightness-down", + "keys": "SUPER + F2", + "desc": "Keyboard backlight down", + "category": "Displays" + }, + { + "id": "audio-mute", + "keys": "XF86AudioMute", + "desc": "Toggle audio mute", + "category": "Media" + }, + { + "id": "microphone-mute", + "keys": "XF86AudioMicMute", + "desc": "Toggle microphone mute", + "category": "Media" + }, + { + "id": "play-pause", + "keys": "XF86AudioPlay", + "desc": "Play or pause media", + "category": "Media" + }, + { + "id": "file-manager-media", + "keys": "XF86Explorer", + "desc": "File manager", + "category": "Apps" + }, + { + "id": "email", + "keys": "XF86Mail", + "desc": "Email", + "category": "Apps" + }, + { + "id": "browser", + "keys": "XF86WWW", + "desc": "Web browser", + "category": "Apps" + }, + { + "id": "display-brightness-down", + "keys": "XF86MonBrightnessDown", + "desc": "Brightness down", + "category": "Displays" + }, + { + "id": "display-brightness-up", + "keys": "XF86MonBrightnessUp", + "desc": "Brightness up", + "category": "Displays" + }, + { + "id": "volume-up", + "keys": "XF86AudioRaiseVolume", + "desc": "Volume up", + "category": "Media", + "opts": { + "repeating": true + } + }, + { + "id": "volume-down", + "keys": "XF86AudioLowerVolume", + "desc": "Volume down", + "category": "Media", + "opts": { + "repeating": true + } + }, + { + "id": "previous-seek", + "keys": "XF86AudioPrev", + "desc": "Seek backward", + "category": "Media", + "opts": { + "click": true + } + }, + { + "id": "next-seek", + "keys": "XF86AudioNext", + "desc": "Seek forward", + "category": "Media", + "opts": { + "click": true + } + }, + { + "id": "previous-track", + "keys": "XF86AudioPrev", + "desc": "Previous track", + "category": "Media", + "opts": { + "long_press": true + } + }, + { + "id": "next-track", + "keys": "XF86AudioNext", + "desc": "Next track", + "category": "Media", + "opts": { + "long_press": true + } + }, + { + "id": "move-window-drag", + "keys": "SUPER + mouse:272", + "desc": "Move window with mouse", + "category": "Windows", + "opts": { + "mouse": true + } + }, + { + "id": "resize-window-drag", + "keys": "SUPER + mouse:273", + "desc": "Resize window with mouse", + "category": "Windows", + "opts": { + "mouse": true + } + } + ] +} diff --git a/modules/user/lucid/Agenda.qml b/user/sweetbread/modules/lucid/Agenda.qml similarity index 100% rename from modules/user/lucid/Agenda.qml rename to user/sweetbread/modules/lucid/Agenda.qml diff --git a/modules/user/lucid/CalendarSource.qml b/user/sweetbread/modules/lucid/CalendarSource.qml similarity index 100% rename from modules/user/lucid/CalendarSource.qml rename to user/sweetbread/modules/lucid/CalendarSource.qml diff --git a/modules/user/lucid/ClockCalendar.qml b/user/sweetbread/modules/lucid/ClockCalendar.qml similarity index 100% rename from modules/user/lucid/ClockCalendar.qml rename to user/sweetbread/modules/lucid/ClockCalendar.qml diff --git a/modules/user/lucid/lucid-keybinds-rias.json b/user/sweetbread/modules/lucid/lucid-keybinds.json similarity index 100% rename from modules/user/lucid/lucid-keybinds-rias.json rename to user/sweetbread/modules/lucid/lucid-keybinds.json diff --git a/modules/user/lucid/lucid-prefs.json b/user/sweetbread/modules/lucid/lucid-prefs.json similarity index 100% rename from modules/user/lucid/lucid-prefs.json rename to user/sweetbread/modules/lucid/lucid-prefs.json diff --git a/modules/user/lucid/thunderbird-calendar.py b/user/sweetbread/modules/lucid/thunderbird-calendar.py similarity index 100% rename from modules/user/lucid/thunderbird-calendar.py rename to user/sweetbread/modules/lucid/thunderbird-calendar.py