diff --git a/host/Eclipse/modules/hyprland.nix b/host/Eclipse/modules/hyprland.nix index f771b98..04941f6 100644 --- a/host/Eclipse/modules/hyprland.nix +++ b/host/Eclipse/modules/hyprland.nix @@ -31,6 +31,8 @@ in { mode = "2560x1440@100"; position = "0x0"; scale = 1; + cm = "srgb"; + supports_hdr = -1; } { output = "HDMI-A-1"; diff --git a/host/Rias/modules/hyprland.nix b/host/Rias/modules/hyprland.nix index acb0a14..64862a5 100644 --- a/host/Rias/modules/hyprland.nix +++ b/host/Rias/modules/hyprland.nix @@ -6,6 +6,8 @@ mode = "3440x1440@165"; position = "auto-right"; scale = 1; + cm = "srgb"; + supports_hdr = -1; } { output = "HDMI-A-1"; diff --git a/modules/user/hyprland.nix b/modules/user/hyprland.nix index 56d5e8c..95afabe 100644 --- a/modules/user/hyprland.nix +++ b/modules/user/hyprland.nix @@ -105,7 +105,10 @@ in { { _args = [ "XDG_SCREENSHOTS_DIR" "~/screens" ]; } ]; - gesture = [ + # Lucid's Rias integration loads support/hypr/modules/gestures.lua, + # which defines this workspace swipe (and a four-finger variant). + # Avoid registering the same 3-finger gesture twice in Hyprland. + gesture = lib.optionals (hostname != "Rias") [ { fingers = 3; direction = "horizontal"; diff --git a/modules/user/lucid/lucid-keybinds-rias.json b/modules/user/lucid/lucid-keybinds-rias.json index 656be02..bd33194 100644 --- a/modules/user/lucid/lucid-keybinds-rias.json +++ b/modules/user/lucid/lucid-keybinds-rias.json @@ -43,6 +43,12 @@ { "id": "resize-down", "keys": "SUPER + CTRL + DOWN", "desc": "Resize window down", "category": "Windows", "type": "lua", "lua": "hl.dsp.window.resize({ x = 0, y = 60, relative = true })" }, { "id": "workspace-focus", "keys": "SUPER + {key}", "desc": "Focus workspace {n}", "category": "Workspaces", "type": "lua", "lua": "hl.dsp.focus({ workspace = {n} })", "each": "workspace" }, { "id": "workspace-move", "keys": "SUPER + SHIFT + {key}", "desc": "Move window to workspace {n}", "category": "Workspaces", "type": "lua", "lua": "hl.dsp.window.move({ workspace = {n}, follow = false })", "each": "workspace" }, + { "id": "scratchpad", "keys": "SUPER + SHIFT + S", "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 + SHIFT + M", "desc": "Toggle Music workspace", "category": "Workspaces", "type": "lua", "lua": "specials.toggle('music')" }, + { "id": "special-comms", "keys": "SUPER + SHIFT + D", "desc": "Toggle Comms workspace", "category": "Workspaces", "type": "lua", "lua": "specials.toggle('comms')" }, + { "id": "special-todo", "keys": "SUPER + SHIFT + R", "desc": "Toggle To-do workspace", "category": "Workspaces", "type": "lua", "lua": "specials.toggle('todo')" }, + { "id": "special-sysmon", "keys": "CTRL + SHIFT + ESCAPE", "desc": "Toggle system monitor workspace", "category": "Workspaces", "type": "lua", "lua": "specials.toggle('sysmon')" }, { "id": "fullscreen", "keys": "SUPER + SHIFT + F", "desc": "Toggle fullscreen", "category": "Windows", "type": "lua", "lua": "hl.dsp.window.fullscreen({ action = 'toggle', mode = 'fullscreen' })" }, { "id": "workspace-next-scroll", "keys": "SUPER + mouse_down", "desc": "Next workspace", "category": "Workspaces", "type": "lua", "lua": "hl.dsp.focus({ workspace = 'e-1' })" }, { "id": "workspace-previous-scroll", "keys": "SUPER + mouse_up", "desc": "Previous workspace", "category": "Workspaces", "type": "lua", "lua": "hl.dsp.focus({ workspace = 'e+1' })" }, diff --git a/modules/user/lucid/lucid-monitors-rias.lua b/modules/user/lucid/lucid-monitors-rias.lua new file mode 100644 index 0000000..e4868ea --- /dev/null +++ b/modules/user/lucid/lucid-monitors-rias.lua @@ -0,0 +1,9 @@ +-- Initial Rias display layout; Home Manager seeds this only while the +-- user-owned Lucid monitor list is empty. +return { + monitors = { + { output = "DP-3", mode = "3440x1440@165", position = "auto-right", scale = "1" }, + { output = "HDMI-A-1", disabled = true }, + }, + workspaces = {}, +} diff --git a/user/sweetbread/modules/lucid.nix b/user/sweetbread/modules/lucid.nix index 951effa..fca119e 100644 --- a/user/sweetbread/modules/lucid.nix +++ b/user/sweetbread/modules/lucid.nix @@ -190,6 +190,11 @@ in { if [ "${host}" = Rias ] && [ ! -s "$lucid_dir/keybinds.json" ]; then $DRY_RUN_CMD install -m644 ${../../../modules/user/lucid/lucid-keybinds-rias.json} "$lucid_dir/keybinds.json" fi + monitor_file="${config.home.homeDirectory}/.config/hypr/lucid-monitors.lua" + if [ "${host}" = Rias ] && { [ ! -s "$monitor_file" ] || ! grep -qE 'output[[:space:]]*=' "$monitor_file"; } && \ + ! grep -qE 'workspace[[:space:]]*=' "$monitor_file" 2>/dev/null; then + $DRY_RUN_CMD install -m644 ${../../../modules/user/lucid/lucid-monitors-rias.lua} "$monitor_file" + fi $DRY_RUN_CMD ${pkgs.rsync}/bin/rsync -rltp --chmod=Du+rwx,Fu+rw --ignore-existing \ "${source}/support/lucid/themes/" "$lucid_dir/themes/" for script in palette-edit.py lucid_palette.py add-theme.py scheme-gallery.py gen-light-palette.py; do @@ -279,9 +284,58 @@ in { on = [ (hyprLua.onStart [ "systemctl --user start lucid.service" ]) ]; bind = lib.mkIf isRias (lib.mkForce []); }; + # Home Manager autoloads these before its generated settings. Lucid's + # stateful UI modules are installed too, then required after the Nix base + # config below so saved UI choices take effect without losing that base. extraLuaFiles = lib.mkIf isRias { "modules/binds.lua" = builtins.toPath "${source}/support/hypr/modules/binds.lua"; "modules/json.lua" = builtins.toPath "${source}/support/hypr/modules/json.lua"; + "modules/decorations.lua" = builtins.toPath "${source}/support/hypr/modules/decorations.lua"; + "modules/gestures.lua" = builtins.toPath "${source}/support/hypr/modules/gestures.lua"; + "modules/input.lua" = builtins.toPath "${source}/support/hypr/modules/input.lua"; + "modules/layout.lua" = builtins.toPath "${source}/support/hypr/modules/layout.lua"; + "modules/layerrules.lua" = builtins.toPath "${source}/support/hypr/modules/layerrules.lua"; + "modules/lumen.lua" = builtins.toPath "${source}/support/hypr/modules/lumen.lua"; + "modules/misc.lua" = builtins.toPath "${source}/support/hypr/modules/misc.lua"; + "modules/plugins.lua" = builtins.toPath "${source}/support/hypr/modules/plugins.lua"; + "modules/windowrules.lua" = builtins.toPath "${source}/support/hypr/modules/windowrules.lua"; + "modules/glass.lua" = { + content = builtins.toPath "${source}/support/hypr/modules/glass.lua"; + autoLoad = false; + }; + "modules/monitors.lua" = { + content = builtins.toPath "${source}/support/hypr/modules/monitors.lua"; + autoLoad = false; + }; + "modules/settings.lua" = { + content = builtins.toPath "${source}/support/hypr/modules/settings.lua"; + autoLoad = false; + }; + "modules/specials.lua" = { + content = builtins.toPath "${source}/support/hypr/modules/specials.lua"; + autoLoad = false; + }; + "modules/startup.lua" = { + content = builtins.toPath "${source}/support/hypr/modules/startup.lua"; + autoLoad = false; + }; }; + # Nix owns session startup and environment exports; don't load Lucid's + # generic autostart/env defaults on top of the existing host setup. + extraConfig = lib.mkIf isRias '' + local config_home = os.getenv("XDG_CONFIG_HOME") or ${builtins.toJSON config.xdg.configHome} + package.path = config_home .. "/hypr/?.lua;" .. config_home .. "/hypr/?/init.lua;" .. package.path + require("modules.specials") + require("modules.monitors") + local lucid_monitor_apply = LucidMonitors.apply + LucidMonitors.apply = function(...) + lucid_monitor_apply(...) + hl.monitor({ output = "DP-3", cm = "srgb", supports_hdr = -1 }) + end + LucidMonitors.apply() + require("modules.settings") + require("modules.glass") + require("modules.startup") + ''; }; }