From 2c218306b9773244ada6193796cb95fbe6d135fd Mon Sep 17 00:00:00 2001 From: DashieTM Date: Fri, 10 Oct 2025 19:29:14 +0200 Subject: [PATCH] chore(wm): Fix hyprland keybinds --- base/common_hardware.nix | 2 ++ lib/wm.nix | 6 +++--- modules/programs/hypr/hyprland.nix | 22 +++++++++++----------- modules/programs/niri.nix | 7 +++++-- modules/programs/printing.nix | 4 ++++ modules/programs/virtmanager.nix | 2 -- 6 files changed, 25 insertions(+), 18 deletions(-) diff --git a/base/common_hardware.nix b/base/common_hardware.nix index 56a6dc6..8df238a 100644 --- a/base/common_hardware.nix +++ b/base/common_hardware.nix @@ -164,6 +164,8 @@ in { "vboxusers" "video" "audio" + "scanner" + "lp" ]; packages = with pkgs; [ home-manager diff --git a/lib/wm.nix b/lib/wm.nix index 1352623..3b5819d 100644 --- a/lib/wm.nix +++ b/lib/wm.nix @@ -1,4 +1,4 @@ -{lib, ...}: let +let browserName = config: if (builtins.isString config.mods.homePackages.browser) then config.mods.homePackages.browser @@ -247,8 +247,8 @@ in { else {} ) - (mkBindWithDesc ["Mod"] "S" "spawn-sh" [''grim -g \"$(slurp)\" - | wl-copy''] "Take Screenshot") - (mkBindWithDesc ["Mod" "Shift"] "S" "spawn-sh" [''grim -g \"$(slurp)\" - | satty -f -''] "Take Screenshot and edit") + (mkBindWithDesc ["Mod"] "S" "spawn-sh" [''grim -g "$(slurp)" - | wl-copy''] "Take Screenshot") + (mkBindWithDesc ["Mod" "Shift"] "S" "spawn-sh" [''grim -g "$(slurp)" - | satty -f -''] "Take Screenshot and edit") ( if config.mods.scripts.audioControl diff --git a/modules/programs/hypr/hyprland.nix b/modules/programs/hypr/hyprland.nix index f6ee377..f32bc74 100644 --- a/modules/programs/hypr/hyprland.nix +++ b/modules/programs/hypr/hyprland.nix @@ -6,7 +6,7 @@ pkgs, ... }: let - defaultWmConf = import ../../../lib/wm.nix {inherit lib;}; + defaultWmConf = import ../../../lib/wm.nix; in { options.mods.hypr.hyprland = { enable = lib.mkOption { @@ -137,7 +137,7 @@ in { if args != [] then (lib.strings.concatStringsSep " " args) else ""; - shouldRepeat = bind: bind ? meta && bind.meta ? hyprland && bind.meta.hyprland ? repeat && bind.meta.hyprland.repeat; + shouldRepeat = bind: bind ? meta && bind.meta ? hyprland && bind.meta.hyprland ? repeat && bind.meta.hyprland.repeat == true; defaultBinds = cfg: if cfg.mods.wm.useDefaultBinds @@ -148,7 +148,7 @@ in { binds = cfg.mods.wm.binds ++ defaultBinds cfg; in binds - |> builtins.filter (bind: bind ? command && shouldRepeat bind && !hasInvalidCustomCommand bind) + |> builtins.filter (bind: bind ? command && shouldRepeat bind && !(hasInvalidCustomCommand bind)) |> builtins.map ( bind: "${mkMods bind},${bind.key},${mkCommand bind}" ); @@ -156,7 +156,7 @@ in { binds = cfg.mods.wm.binds ++ defaultBinds cfg; in binds - |> builtins.filter (bind: bind ? command && !(shouldRepeat bind) && !hasInvalidCustomCommand bind) + |> builtins.filter (bind: bind ? command && !(shouldRepeat bind) && !(hasInvalidCustomCommand bind)) |> builtins.map ( bind: "${mkMods bind},${bind.key},${mkCommand bind}" ); @@ -338,13 +338,13 @@ in { "noanim, selection" ]; - workspace = mkDashDefault (mkWorkspace config.mods.wm.workspaces); - monitor = mkDashDefault (mkMonitors config.mods.wm.monitors); - env = mkDashDefault (mkEnv config); - bind = mkDashDefault (mkBinds config); - binde = mkDashDefault (mkEBinds config); - windowrule = mkDashDefault (mkWindowRule config); - exec-once = mkDashDefault (mkAutoStart config); + workspace = mkWorkspace config.mods.wm.workspaces; + monitor = mkMonitors config.mods.wm.monitors; + env = mkEnv config; + bind = mkBinds config; + binde = mkEBinds config; + windowrule = mkWindowRule config; + exec-once = mkAutoStart config; plugin = config.mods.hypr.hyprland.pluginConfig; } config.mods.hypr.hyprland.customConfig diff --git a/modules/programs/niri.nix b/modules/programs/niri.nix index a973774..0531829 100644 --- a/modules/programs/niri.nix +++ b/modules/programs/niri.nix @@ -6,7 +6,7 @@ pkgs, ... }: let - defaultWmConf = import ../../lib/wm.nix {inherit lib;}; + defaultWmConf = import ../../lib/wm.nix; in { options.mods.niri = { enable = lib.mkOption { @@ -66,7 +66,10 @@ in { |> lib.strings.concatStringsSep ""; mkNiriArg = args: if args != [] - then "\"${(lib.strings.concatStringsSep " " args)}\"" + then let + concatCommand = lib.strings.concatStringsSep " " args; + validCommand = builtins.replaceStrings [''"''] [''\"''] concatCommand; + in "\"${validCommand}\"" else ""; mkNiriCommand = bind: let args = bind.args or []; diff --git a/modules/programs/printing.nix b/modules/programs/printing.nix index 848ffef..98bbe4f 100644 --- a/modules/programs/printing.nix +++ b/modules/programs/printing.nix @@ -16,6 +16,10 @@ config = lib.mkIf config.mods.printing.enable ( lib.optionalAttrs (options ? services.printing) { # Enable CUPS to print documents. + environment.systemPackages = with pkgs; [ + simple-scan + ]; + hardware.sane.enable = true; services = { printing = { enable = true; diff --git a/modules/programs/virtmanager.nix b/modules/programs/virtmanager.nix index bf81b93..de38848 100644 --- a/modules/programs/virtmanager.nix +++ b/modules/programs/virtmanager.nix @@ -44,8 +44,6 @@ in { qemu = { package = mkDashDefault pkgs.qemu_kvm; swtpm.enable = mkDashDefault true; - ovmf.enable = mkDashDefault true; - ovmf.packages = [pkgs.OVMFFull.fd]; }; }; spiceUSBRedirection.enable = mkDashDefault true;