make the split dispatchers in hyprland config optional

I haven't tested this aside from `nix flake check` I hope this works
This commit is contained in:
jacekpoz 2024-04-03 22:40:54 +02:00
parent 4696174cb7
commit 48e5e05f35
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -12,6 +12,8 @@
isAmdGpuPresent = elem "amdgpu" config.boot.initrd.kernelModules; isAmdGpuPresent = elem "amdgpu" config.boot.initrd.kernelModules;
smwPresent = elem inputs.split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces cfg.extraPlugins;
inherit (inputs.nixpkgs-wayland.packages.${pkgs.system}) foot wl-clipboard swww wlsunset; inherit (inputs.nixpkgs-wayland.packages.${pkgs.system}) foot wl-clipboard swww wlsunset;
inherit (inputs.anyrun.packages.${pkgs.system}) anyrun; inherit (inputs.anyrun.packages.${pkgs.system}) anyrun;
hyprcontrib = inputs.hyprcontrib.packages.${pkgs.system}; hyprcontrib = inputs.hyprcontrib.packages.${pkgs.system};
@ -282,26 +284,26 @@ in {
"$mainMod CONTROL, R, bringactivetotop" "$mainMod CONTROL, R, bringactivetotop"
"$mainMod, P, pin" "$mainMod, P, pin"
# workspaces # workspaces
"$mainMod, 1, split-workspace, 1" "$mainMod, 1, ${if smwPresent then "split-" else ""}workspace, 1"
"$mainMod, 2, split-workspace, 2" "$mainMod, 2, ${if smwPresent then "split-" else ""}workspace, 2"
"$mainMod, 3, split-workspace, 3" "$mainMod, 3, ${if smwPresent then "split-" else ""}workspace, 3"
"$mainMod, 4, split-workspace, 4" "$mainMod, 4, ${if smwPresent then "split-" else ""}workspace, 4"
"$mainMod, 5, split-workspace, 5" "$mainMod, 5, ${if smwPresent then "split-" else ""}workspace, 5"
"$mainMod, 6, split-workspace, 6" "$mainMod, 6, ${if smwPresent then "split-" else ""}workspace, 6"
"$mainMod, 7, split-workspace, 7" "$mainMod, 7, ${if smwPresent then "split-" else ""}workspace, 7"
"$mainMod, 8, split-workspace, 8" "$mainMod, 8, ${if smwPresent then "split-" else ""}workspace, 8"
"$mainMod, 9, split-workspace, 9" "$mainMod, 9, ${if smwPresent then "split-" else ""}workspace, 9"
"$mainMod, 0, split-workspace, 10" "$mainMod, 0, ${if smwPresent then "split-" else ""}workspace, 10"
"$mainMod SHIFT, 1, split-movetoworkspacesilent, 1" "$mainMod SHIFT, 1, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 1"
"$mainMod SHIFT, 2, split-movetoworkspacesilent, 2" "$mainMod SHIFT, 2, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 2"
"$mainMod SHIFT, 3, split-movetoworkspacesilent, 3" "$mainMod SHIFT, 3, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 3"
"$mainMod SHIFT, 4, split-movetoworkspacesilent, 4" "$mainMod SHIFT, 4, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 4"
"$mainMod SHIFT, 5, split-movetoworkspacesilent, 5" "$mainMod SHIFT, 5, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 5"
"$mainMod SHIFT, 6, split-movetoworkspacesilent, 6" "$mainMod SHIFT, 6, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 6"
"$mainMod SHIFT, 7, split-movetoworkspacesilent, 7" "$mainMod SHIFT, 7, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 7"
"$mainMod SHIFT, 8, split-movetoworkspacesilent, 8" "$mainMod SHIFT, 8, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 8"
"$mainMod SHIFT, 9, split-movetoworkspacesilent, 9" "$mainMod SHIFT, 9, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 9"
"$mainMod SHIFT, 0, split-movetoworkspacesilent, 10" "$mainMod SHIFT, 0, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 10"
# screenshots # screenshots
"$mainMod, S, exec, ${hyprcontrib.grimblast}/bin/grimblast save area - | ${pkgs.coreutils-full}/bin/tee \"$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')\" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send \"Screenshot taken\"" "$mainMod, S, exec, ${hyprcontrib.grimblast}/bin/grimblast save area - | ${pkgs.coreutils-full}/bin/tee \"$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')\" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send \"Screenshot taken\""
"$mainMod SHIFT, S, exec, ${hyprcontrib.grimblast}/bin/grimblast save area - | ${shadower}/bin/shadower | ${pkgs.coreutils-full}/bin/tee \"$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')\" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send \"Screenshot taken (shadower)\"" "$mainMod SHIFT, S, exec, ${hyprcontrib.grimblast}/bin/grimblast save area - | ${shadower}/bin/shadower | ${pkgs.coreutils-full}/bin/tee \"$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')\" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send \"Screenshot taken (shadower)\""