From adb759f8887a33087ae9b26ef5e4649f840d4f11 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Mon, 15 Jan 2024 17:25:04 +0300 Subject: [PATCH] Make discord use Wayland --- BROKEN.md | 2 ++ modules/discord.nix | 14 +++++++++++--- modules/hyprland/default.nix | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/BROKEN.md b/BROKEN.md index c9cffa0..7c0992f 100644 --- a/BROKEN.md +++ b/BROKEN.md @@ -1,5 +1,7 @@ # Broken Stuff +- Discord does not use Wayland. + - QT theme doesn't work. - Nushell custom prompt title does not work, as it gets diff --git a/modules/discord.nix b/modules/discord.nix index e6ce427..91028a5 100644 --- a/modules/discord.nix +++ b/modules/discord.nix @@ -8,9 +8,17 @@ xdg.configFile."Vencord/settings/quickCss.css".text = theme.discordCss; }) -(desktopSystemPackages (with pkgs; [ - (discord.override { +(desktopHomePackages (with pkgs; [ + ((discord-canary.override { withOpenASAR = true; withVencord = true; - }) + }).overrideAttrs (old: with pkgs; { + libPath = old.libPath + ":${libglvnd}/lib"; + nativeBuildInputs = old.nativeBuildInputs ++ [ makeWrapper ]; + + postFixup = '' + wrapProgram $out/opt/DiscordCanary/DiscordCanary \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland}}" + ''; + })) ])) diff --git a/modules/hyprland/default.nix b/modules/hyprland/default.nix index 47ebc20..6461a37 100644 --- a/modules/hyprland/default.nix +++ b/modules/hyprland/default.nix @@ -103,7 +103,7 @@ bind = SUPER+ALT, RETURN, exec, kitty bind = SUPER , RETURN, exec, ghostty --gtk-single-instance=true bind = SUPER , W , exec, firefox - bind = SUPER , D , exec, discord + bind = SUPER , D , exec, discordcanary bind = SUPER , M , exec, thunderbird bind = SUPER , T , exec, thunar bind = SUPER , C , exec, hyprpicker --autocopy