From 1e3808b4c11725206bc881ba82cd692d1069265c Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sun, 26 Jan 2025 21:48:17 -0500 Subject: [PATCH] feat(desktop): add global bind for discord --- .../desktop/environment/modules/packages.nix | 46 +++++++++++-------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/modules/desktop/environment/modules/packages.nix b/modules/desktop/environment/modules/packages.nix index 3629aeb7..40d9468f 100644 --- a/modules/desktop/environment/modules/packages.nix +++ b/modules/desktop/environment/modules/packages.nix @@ -73,6 +73,19 @@ in { enable = true; discord = { + package = + if isNvidia + then + pkgs.discord.overrideAttrs { + postFixup = '' + wrapProgramShell $out/bin/Discord \ + --set XDG_SESSION_TYPE "x11" \ + --unset NIXOS_OZONE_WL \ + --unset WAYLAND_DISPLAY + ''; + } + else pkgs.discord; + vencord.unstable = true; openASAR.enable = false; @@ -169,27 +182,14 @@ in { ; # force XWayland for stylus input - obsidian = pkgs.obsidian.overrideAttrs (o: { - installPhase = '' - runHook preInstall - mkdir -p $out/bin - - makeWrapper ${pkgs.electron}/bin/electron $out/bin/obsidian \ - --add-flags $out/share/obsidian/app.asar \ - --set XDG_SESSION_TYPE "x11" \ - --set NIXOS_OZONE_WL "0" - - install -m 444 -D resources/app.asar $out/share/obsidian/app.asar - install -m 444 -D resources/obsidian.asar $out/share/obsidian/obsidian.asar - install -m 444 -D "${o.desktopItem}/share/applications/"* \ - -t $out/share/applications/ - for size in 16 24 32 48 64 128 256 512; do - mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps - magick -background none ${o.icon} -resize "$size"x"$size" $out/share/icons/hicolor/"$size"x"$size"/apps/obsidian.png - done - runHook postInstall + obsidian = pkgs.obsidian.overrideAttrs { + postFixup = '' + makeWrapper $out/bin/obsidian \ + --set XDG_SESSION_TYPE "x11" \ + --unset NIXOS_OZONE_WL \ + --unset WAYLAND_DISPLAY ''; - }); + }; # tools inherit @@ -298,6 +298,12 @@ in { dispatcher = "togglespecialworkspace"; command = "spot"; } + + { + key = "mouse:277"; + dispatcher = "pass"; + command = "class:^(discord)$"; + } ]; }; };