From 8cb2599e8bbd15d7d41d5c6185e1bdca32c3b25b Mon Sep 17 00:00:00 2001 From: Sweetbread Date: Wed, 4 Nov 2026 18:15:11 +0300 Subject: [PATCH] fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Install lucid --- host/Rias/modules/hyprland.nix | 35 +---------- modules/user/lucid/WidgetLayer.qml | 6 +- modules/user/lucid/idle-work.patch | 37 ++++++++++- modules/user/lucid/lucid-keybinds-rias.json | 68 +++++++++++++++++++++ user/sweetbread/modules/hyprland.nix | 19 +++--- user/sweetbread/modules/lucid.nix | 19 ++++-- 6 files changed, 130 insertions(+), 54 deletions(-) create mode 100644 modules/user/lucid/lucid-keybinds-rias.json diff --git a/host/Rias/modules/hyprland.nix b/host/Rias/modules/hyprland.nix index 8f44983..acb0a14 100644 --- a/host/Rias/modules/hyprland.nix +++ b/host/Rias/modules/hyprland.nix @@ -1,31 +1,4 @@ -{ pkgs, lib, ... }: -let - hyprLua = import ../../../modules/user/hyprland/lua.nix { inherit lib; }; - - monitor-switcher = pkgs.writers.writeBashBin "monitor_switcher" /*bash*/ '' - MODE=$1 - - case $MODE in - "tv") - hyprctl eval 'hl.monitor({ output = "DP-3", mode = "1920x1080@60", position = "3840x0", scale = 1 })' - hyprctl eval 'hl.monitor({ output = "HDMI-A-1", mode = "3840x2160@60", position = "0x0", scale = 1 })' - notify-send "TV mode" - ;; - - "mirror") - hyprctl eval 'hl.monitor({ output = "HDMI-A-1", mode = "3840x2160@60", position = "0x0", scale = 1 })' - hyprctl eval 'hl.monitor({ output = "DP-3", mode = "preferred", position = "auto", scale = 1, mirror = "HDMI-A-1" })' - notify-send "TV-only mode" - ;; - - "display"|*) - hyprctl eval 'hl.monitor({ output = "HDMI-A-1", disabled = true })' - hyprctl eval 'hl.monitor({ output = "DP-3", mode = "3440x1440@165", position = "0x0", scale = 1 })' - notify-send "Display mode" - ;; - esac - ''; -in { +{ ... }: { wayland.windowManager.hyprland.settings = { monitor = [ { @@ -40,11 +13,5 @@ in { } ]; - bind = [ - (hyprLua.bind "XF86Calculator" (hyprLua.exec "ghostty --title=pulsemixer -e pulsemixer")) - (hyprLua.bind "SUPER + F1" (hyprLua.exec "${lib.getExe monitor-switcher} tv")) - (hyprLua.bind "SUPER + F2" (hyprLua.exec "${lib.getExe monitor-switcher} mirror")) - (hyprLua.bind "SUPER + F3" (hyprLua.exec "${lib.getExe monitor-switcher}")) - ]; }; } diff --git a/modules/user/lucid/WidgetLayer.qml b/modules/user/lucid/WidgetLayer.qml index b2a5478..b2c06a3 100644 --- a/modules/user/lucid/WidgetLayer.qml +++ b/modules/user/lucid/WidgetLayer.qml @@ -26,12 +26,12 @@ Variants { readonly property var activeWorkspace: workspaceMonitor ? workspaceMonitor.activeWorkspace : null readonly property bool windowUp: { const workspace = layer.activeWorkspace; - if (!workspace) + if (!workspace || !workspace.toplevels) return false; - return Hyprland.toplevels.values.some((t) => { + return workspace.toplevels.values.some((t) => { const o = t.lastIpcObject || {}; - if (!o.workspace || o.workspace.id !== workspace.id || o.mapped === false || o.hidden === true) + if (o.mapped === false || o.hidden === true) return false; if (o.size && (o.size[0] <= 0 || o.size[1] <= 0)) diff --git a/modules/user/lucid/idle-work.patch b/modules/user/lucid/idle-work.patch index d3a9ebb..f4cd814 100644 --- a/modules/user/lucid/idle-work.patch +++ b/modules/user/lucid/idle-work.patch @@ -215,4 +215,39 @@ + running: w.preview && w.updatesEnabled && w.visible onTriggered: w.phase += 0.055 } - + +--- a/lucidprefs/ThemePage.qml ++++ b/lucidprefs/ThemePage.qml +@@ -770,6 +770,9 @@ + "key": "any", + "label": "Any window" + }, { ++ "key": "non-float", ++ "label": "Non-float" ++ }, { + "key": "fullscreen", + "label": "Fullscreen" + }, { + +--- a/LiveWall.qml ++++ b/LiveWall.qml +@@ -42,13 +42,18 @@ + const out = {}; + const mons = Hyprland.monitors.values; + for (let i = 0; i < mons.length; i++) { + const ws = mons[i].activeWorkspace; +- const windows = ws ? ws.toplevels.values.length : 0; ++ const windows = ws ? ws.toplevels.values : []; + let still = Lockscreen.locked || (root.gameMode && Prefs.liveGameMode === "pause"); + if (Prefs.livePauseUnder === "any") +- still = still || windows > 0; ++ still = still || windows.length > 0; ++ else if (Prefs.livePauseUnder === "non-float") ++ still = still || windows.some((t) => { ++ const o = t && t.lastIpcObject; ++ return o && o.mapped !== false && o.hidden !== true && o.floating !== true; ++ }); + else if (Prefs.livePauseUnder === "fullscreen") + still = still || (ws !== null && ws.hasFullscreen); + out[mons[i].name] = !still; + } diff --git a/modules/user/lucid/lucid-keybinds-rias.json b/modules/user/lucid/lucid-keybinds-rias.json new file mode 100644 index 0000000..656be02 --- /dev/null +++ b/modules/user/lucid/lucid-keybinds-rias.json @@ -0,0 +1,68 @@ +{ + "version": 1, + "binds": [ + { "id": "wallpaper-picker", "keys": "SUPER + W", "desc": "Wallpaper picker", "category": "Lucid", "type": "exec", "cmd": "hyprctl eval 'hl.config({ input = { follow_mouse = 2 } })' && qs ipc call launcher wallpaper" }, + { "id": "wallpaper-random", "keys": "SUPER + SHIFT + W", "desc": "Set a random wallpaper", "category": "Desktop", "type": "exec", "cmd": "wallpaper_changer" }, + { "id": "calculator-volume", "keys": "XF86Calculator", "desc": "Open volume mixer", "category": "Apps", "type": "exec", "cmd": "ghostty --title=pulsemixer -e pulsemixer" }, + { "id": "zoom-reset-scroll-up", "keys": "SUPER + SHIFT + mouse_up", "desc": "Reset cursor zoom", "category": "Accessibility", "type": "lua", "lua": "function() hl.config({ cursor = { zoom_factor = 1 } }) end" }, + { "id": "zoom-reset-scroll-down", "keys": "SUPER + SHIFT + mouse_down", "desc": "Reset cursor zoom", "category": "Accessibility", "type": "lua", "lua": "function() hl.config({ cursor = { zoom_factor = 1 } }) end" }, + { "id": "zoom-reset-minus", "keys": "SUPER + SHIFT + minus", "desc": "Reset cursor zoom", "category": "Accessibility", "type": "lua", "lua": "function() hl.config({ cursor = { zoom_factor = 1 } }) end" }, + { "id": "zoom-reset-kp-subtract", "keys": "SUPER + SHIFT + KP_SUBTRACT", "desc": "Reset cursor zoom", "category": "Accessibility", "type": "lua", "lua": "function() hl.config({ cursor = { zoom_factor = 1 } }) end" }, + { "id": "zoom-reset-zero", "keys": "SUPER + SHIFT + 0", "desc": "Reset cursor zoom", "category": "Accessibility", "type": "lua", "lua": "function() hl.config({ cursor = { zoom_factor = 1 } }) end" }, + { "id": "zoom-in-equal", "keys": "SUPER + equal", "desc": "Zoom in", "category": "Accessibility", "type": "lua", "lua": "function() local current = hl.get_config('cursor.zoom_factor'); hl.config({ cursor = { zoom_factor = current * 1.1 } }) end", "opts": { "repeating": true } }, + { "id": "zoom-out-minus", "keys": "SUPER + minus", "desc": "Zoom out", "category": "Accessibility", "type": "lua", "lua": "function() local current = hl.get_config('cursor.zoom_factor'); hl.config({ cursor = { zoom_factor = math.max(1, current * 0.9) } }) end", "opts": { "repeating": true } }, + { "id": "zoom-in-kp-add", "keys": "SUPER + KP_ADD", "desc": "Zoom in", "category": "Accessibility", "type": "lua", "lua": "function() local current = hl.get_config('cursor.zoom_factor'); hl.config({ cursor = { zoom_factor = current * 1.1 } }) end", "opts": { "repeating": true } }, + { "id": "zoom-out-kp-subtract", "keys": "SUPER + KP_SUBTRACT", "desc": "Zoom out", "category": "Accessibility", "type": "lua", "lua": "function() local current = hl.get_config('cursor.zoom_factor'); hl.config({ cursor = { zoom_factor = math.max(1, current * 0.9) } }) end", "opts": { "repeating": true } }, + { "id": "widgets-panel", "keys": "SUPER + SHIFT + G", "desc": "Toggle widgets panel", "category": "Lucid", "type": "exec", "cmd": "qs ipc call widgets panel" }, + { "id": "launcher", "keys": "SUPER + D", "desc": "App launcher", "category": "Lucid", "type": "exec", "cmd": "hyprctl eval 'hl.config({ input = { follow_mouse = 2 } })' && qs ipc call launcher toggle" }, + { "id": "clipse", "keys": "SUPER + V", "desc": "Clipboard manager", "category": "Apps", "type": "exec", "cmd": "ghostty --title=clipse -e clipse" }, + { "id": "clipboard", "keys": "SUPER + SHIFT + V", "desc": "Clipboard history", "category": "Lucid", "type": "exec", "cmd": "hyprctl eval 'hl.config({ input = { follow_mouse = 2 } })' && qs ipc call launcher clipboard" }, + { "id": "screenshot", "keys": "Print", "desc": "Region screenshot", "category": "Screenshots", "type": "exec", "cmd": "qs ipc call snap toggle" }, + { "id": "screenshot-full", "keys": "SUPER + Print", "desc": "Full screenshot", "category": "Screenshots", "type": "exec", "cmd": "qs ipc call screenshot full" }, + { "id": "screenshot-region", "keys": "CTRL + Print", "desc": "Region screenshot", "category": "Screenshots", "type": "exec", "cmd": "qs ipc call snap region" }, + { "id": "screenshot-window", "keys": "ALT + Print", "desc": "Window screenshot", "category": "Screenshots", "type": "exec", "cmd": "qs ipc call snap window" }, + { "id": "terminal", "keys": "SUPER + RETURN", "desc": "Terminal", "category": "Apps", "type": "exec", "cmd": "ghostty" }, + { "id": "close-window", "keys": "SUPER + Q", "desc": "Close window", "category": "Windows", "type": "lua", "lua": "hl.dsp.window.close()" }, + { "id": "exit-hyprland", "keys": "SUPER + M", "desc": "Exit Hyprland", "category": "Session", "type": "lua", "lua": "hl.dsp.exit()" }, + { "id": "file-manager", "keys": "SUPER + E", "desc": "File manager", "category": "Apps", "type": "exec", "cmd": "ghostty -e sh -c yazi" }, + { "id": "toggle-float", "keys": "SUPER + F", "desc": "Toggle floating window", "category": "Windows", "type": "lua", "lua": "hl.dsp.window.float({ action = 'toggle' })" }, + { "id": "toggle-pseudo", "keys": "SUPER + P", "desc": "Toggle pseudo-tile", "category": "Windows", "type": "lua", "lua": "hl.dsp.window.pseudo({ action = 'toggle' })" }, + { "id": "toggle-split", "keys": "SUPER + J", "desc": "Toggle split direction", "category": "Windows", "type": "lua", "lua": "hl.dsp.layout('togglesplit')" }, + { "id": "swap-split", "keys": "SUPER + K", "desc": "Swap split direction", "category": "Windows", "type": "lua", "lua": "hl.dsp.layout('swapsplit')" }, + { "id": "focus-left", "keys": "SUPER + LEFT", "desc": "Focus left", "category": "Windows", "type": "lua", "lua": "hl.dsp.focus({ direction = 'l' })" }, + { "id": "focus-right", "keys": "SUPER + RIGHT", "desc": "Focus right", "category": "Windows", "type": "lua", "lua": "hl.dsp.focus({ direction = 'r' })" }, + { "id": "focus-up", "keys": "SUPER + UP", "desc": "Focus up", "category": "Windows", "type": "lua", "lua": "hl.dsp.focus({ direction = 'u' })" }, + { "id": "focus-down", "keys": "SUPER + DOWN", "desc": "Focus down", "category": "Windows", "type": "lua", "lua": "hl.dsp.focus({ direction = 'd' })" }, + { "id": "swap-left", "keys": "SUPER + SHIFT + LEFT", "desc": "Move window left", "category": "Windows", "type": "lua", "lua": "hl.dsp.window.swap({ direction = 'l' })" }, + { "id": "swap-right", "keys": "SUPER + SHIFT + RIGHT", "desc": "Move window right", "category": "Windows", "type": "lua", "lua": "hl.dsp.window.swap({ direction = 'r' })" }, + { "id": "swap-up", "keys": "SUPER + SHIFT + UP", "desc": "Move window up", "category": "Windows", "type": "lua", "lua": "hl.dsp.window.swap({ direction = 'u' })" }, + { "id": "swap-down", "keys": "SUPER + SHIFT + DOWN", "desc": "Move window down", "category": "Windows", "type": "lua", "lua": "hl.dsp.window.swap({ direction = 'd' })" }, + { "id": "resize-left", "keys": "SUPER + CTRL + LEFT", "desc": "Resize window left", "category": "Windows", "type": "lua", "lua": "hl.dsp.window.resize({ x = -60, y = 0, relative = true })" }, + { "id": "resize-right", "keys": "SUPER + CTRL + RIGHT", "desc": "Resize window right", "category": "Windows", "type": "lua", "lua": "hl.dsp.window.resize({ x = 60, y = 0, relative = true })" }, + { "id": "resize-up", "keys": "SUPER + CTRL + UP", "desc": "Resize window up", "category": "Windows", "type": "lua", "lua": "hl.dsp.window.resize({ x = 0, y = -60, relative = true })" }, + { "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": "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' })" }, + { "id": "keyboard-brightness-up", "keys": "SUPER + F3", "desc": "Keyboard backlight up", "category": "Displays", "type": "exec", "cmd": "brightnessctl -d *::kbd_backlight set +33%" }, + { "id": "keyboard-brightness-down", "keys": "SUPER + F2", "desc": "Keyboard backlight down", "category": "Displays", "type": "exec", "cmd": "brightnessctl -d *::kbd_backlight set 33%-" }, + { "id": "audio-mute", "keys": "XF86AudioMute", "desc": "Toggle audio mute", "category": "Media", "type": "exec", "cmd": "pamixer -t" }, + { "id": "microphone-mute", "keys": "XF86AudioMicMute", "desc": "Toggle microphone mute", "category": "Media", "type": "exec", "cmd": "pamixer --default-source -m" }, + { "id": "play-pause", "keys": "XF86AudioPlay", "desc": "Play or pause media", "category": "Media", "type": "exec", "cmd": "playerctl play-pause" }, + { "id": "file-manager-media", "keys": "XF86Explorer", "desc": "File manager", "category": "Apps", "type": "exec", "cmd": "ghostty -e sh -c yazi" }, + { "id": "email", "keys": "XF86Mail", "desc": "Email", "category": "Apps", "type": "exec", "cmd": "thunderbird" }, + { "id": "browser", "keys": "XF86WWW", "desc": "Web browser", "category": "Apps", "type": "exec", "cmd": "google-chrome-stable" }, + { "id": "display-brightness-down", "keys": "XF86MonBrightnessDown", "desc": "Brightness down", "category": "Displays", "type": "exec", "cmd": "brightnessctl set 5%-" }, + { "id": "display-brightness-up", "keys": "XF86MonBrightnessUp", "desc": "Brightness up", "category": "Displays", "type": "exec", "cmd": "brightnessctl set +5%" }, + { "id": "volume-up", "keys": "XF86AudioRaiseVolume", "desc": "Volume up", "category": "Media", "type": "exec", "cmd": "pamixer -i 5", "opts": { "repeating": true } }, + { "id": "volume-down", "keys": "XF86AudioLowerVolume", "desc": "Volume down", "category": "Media", "type": "exec", "cmd": "pamixer -d 5", "opts": { "repeating": true } }, + { "id": "previous-seek", "keys": "XF86AudioPrev", "desc": "Seek backward", "category": "Media", "type": "exec", "cmd": "playerctl position 5-", "opts": { "click": true } }, + { "id": "next-seek", "keys": "XF86AudioNext", "desc": "Seek forward", "category": "Media", "type": "exec", "cmd": "playerctl position 5+", "opts": { "click": true } }, + { "id": "previous-track", "keys": "XF86AudioPrev", "desc": "Previous track", "category": "Media", "type": "exec", "cmd": "playerctl previous", "opts": { "long_press": true } }, + { "id": "next-track", "keys": "XF86AudioNext", "desc": "Next track", "category": "Media", "type": "exec", "cmd": "playerctl next", "opts": { "long_press": true } }, + { "id": "move-window-drag", "keys": "SUPER + mouse:272", "desc": "Move window with mouse", "category": "Windows", "type": "lua", "lua": "hl.dsp.window.drag()", "opts": { "mouse": true } }, + { "id": "resize-window-drag", "keys": "SUPER + mouse:273", "desc": "Resize window with mouse", "category": "Windows", "type": "lua", "lua": "hl.dsp.window.resize()", "opts": { "mouse": true } } + ] +} diff --git a/user/sweetbread/modules/hyprland.nix b/user/sweetbread/modules/hyprland.nix index 358001f..c406b5e 100644 --- a/user/sweetbread/modules/hyprland.nix +++ b/user/sweetbread/modules/hyprland.nix @@ -1,9 +1,7 @@ -{ pkgs, lib, config, osConfig, ... }: { - wayland.windowManager.hyprland = let +{ pkgs, lib, config, osConfig, ... }: +let colors = config.lib.stylix.colors; accent = colors.${config.stylix.accent}; - hyprLua = import ../../../modules/user/hyprland/lua.nix { inherit lib; }; - wallpaper_changer = pkgs.writers.writePython3Bin "wallpaper_changer" { libraries = [ pkgs.python3Packages.requests ]; flakeIgnore = [ "E111" "E121" "E241" "E501" "E701" "E731" ]; @@ -128,7 +126,10 @@ f"{folder}/{filename}", ], check=False) ''; - in { +in { + home.packages = [ wallpaper_changer ]; + + wayland.windowManager.hyprland = { settings = { config = { general = { @@ -150,8 +151,8 @@ blur = { enabled = true; - size = 8; - passes = 1; + size = 16; + passes = 2; new_optimizations = true; }; @@ -198,10 +199,6 @@ } ]; - bind = [ - (hyprLua.bind "SUPER + W" (hyprLua.execLauncher "qs ipc call launcher wallpaper")) - (hyprLua.bind "SUPER + SHIFT + W" (hyprLua.exec "${lib.getExe wallpaper_changer}")) - ]; }; }; } diff --git a/user/sweetbread/modules/lucid.nix b/user/sweetbread/modules/lucid.nix index 938f2cb..951effa 100644 --- a/user/sweetbread/modules/lucid.nix +++ b/user/sweetbread/modules/lucid.nix @@ -1,5 +1,7 @@ { config, lib, osConfig, pkgs, ... }: let + host = osConfig.networking.hostName; + isRias = host == "Rias"; liveDecoder = if builtins.elem osConfig.networking.hostName [ "Rias" "Eclipse" ] then "cuda" else "vaapi"; source = pkgs.fetchgit { url = "https://github.com/Sn3akyy1/lucid.git"; @@ -185,6 +187,9 @@ in { lucid_dir="${config.home.homeDirectory}/.config/lucid" $DRY_RUN_CMD mkdir -p "$lucid_dir/themes" + 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 $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 @@ -269,10 +274,14 @@ in { Install.WantedBy = [ "hyprland-session.target" ]; }; - wayland.windowManager.hyprland.settings = { - on = [ (hyprLua.onStart [ "systemctl --user start lucid.service" ]) ]; - bind = [ - (hyprLua.bind "SUPER + SHIFT + G" (hyprLua.exec "qs ipc call widgets panel")) - ]; + wayland.windowManager.hyprland = { + settings = { + on = [ (hyprLua.onStart [ "systemctl --user start lucid.service" ]) ]; + bind = lib.mkIf isRias (lib.mkForce []); + }; + 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"; + }; }; }