Discord: Difference between revisions
reformat a large chunk of this page to improve formatting |
m Add information about Wayland screen sharing with Discord Canary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 36: | Line 36: | ||
Enhances Discord desktop app with new features. Nixpkgs provides the installer via <code>pkgs.betterdiscordctl</code>. This can be added to your configuration, though users may prefer to instead run it one-off via the [[Nix]] cli.<syntaxhighlight lang="bash"> | Enhances Discord desktop app with new features. Nixpkgs provides the installer via <code>pkgs.betterdiscordctl</code>. This can be added to your configuration, though users may prefer to instead run it one-off via the [[Nix]] cli.<syntaxhighlight lang="bash"> | ||
$ nix-shell -p betterdiscordctl --command 'betterdiscordctl install' # nix-legacy | $ nix-shell -p betterdiscordctl --command 'betterdiscordctl install' # nix-legacy | ||
$ nix run nixpkgs#betterdiscordctl -- install # nix3 | $ nix run nixpkgs#betterdiscordctl -- install # nix3 | ||
$ nix-shell -p betterdiscordctl --command 'betterdiscordctl self-upgrade' # nix-legacy | $ nix-shell -p betterdiscordctl --command 'betterdiscordctl self-upgrade' # nix-legacy | ||
$ nix run nixpkgs#betterdiscordctl -- self-upgrade # nix3 | $ nix run nixpkgs#betterdiscordctl -- self-upgrade # nix3 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 79: | Line 79: | ||
== Troubleshooting == | == Troubleshooting == | ||
=== | === Screen sharing on Wayland === | ||
Discord | Since December 2024, Discord Canary supports screen sharing on Wayland. Alternatively, you can use the web version on a browser that supports screen sharing on Wayland, or an [[Discord#Unofficial Clients|unofficial client]] like ''Webcord'' or ''Vesktop'', both of which have fixed this issue in their own ways. | ||
{{Note|Remember to configure an [https://wiki.archlinux.org/title/XDG_Desktop_Portal#List_of_backends_and_interfaces XDG Desktop Portal] with screen cast capabilities!}} | {{Note|Remember to configure an [https://wiki.archlinux.org/title/XDG_Desktop_Portal#List_of_backends_and_interfaces XDG Desktop Portal] with screen cast capabilities!}} | ||
Line 103: | Line 103: | ||
}} | }} | ||
=== | === Krisp noise suppression === | ||
The Krisp noise suppression option will not work on NixOS because the Discord binary is patched before installation, and there is a DRM-style integrity check in the Krisp binary which prevents Krisp from working if the Discord binary is modified. See https://github.com/NixOS/nixpkgs/issues/195512 for details. | |||
==== Python Script Workaround ==== | |||
{{Warning|The usage of such modifications goes against Discord's [https://discord.com/terms Terms of Service] and Krisp's [https://krisp.ai/terms-of-use/ Terms of Use] and can result in your Discord account being terminated and/or being banned from using Krisp's services!}} | |||
One way to enable Krisp noise suppression is by patching the <code>discord_krisp.node</code> binary to bypass its DRM verification. Below is a Nix configuration that creates a Python script that patches the binary by modifying specific bytes to bypass the license check: <syntaxhighlight lang="nixos">{ pkgs, ... }: | |||
let | |||
krisp-patcher = | |||
pkgs.writers.writePython3Bin "krisp-patcher" | |||
pkgs. | { | ||
libraries = with pkgs.python3Packages; [ | |||
capstone | |||
pyelftools | |||
]; | |||
flakeIgnore = [ | |||
"E501" # line too long (82 > 79 characters) | |||
"F403" # 'from module import *' used; unable to detect undefined names | |||
"F405" # name may be undefined, or defined from star imports: module | |||
]; | |||
} | |||
( | |||
builtins.readFile ( | |||
pkgs.fetchurl { | |||
url = "https://pastebin.com/raw/8tQDsMVd"; | |||
sha256 = "sha256-IdXv0MfRG1/1pAAwHLS2+1NESFEz2uXrbSdvU9OvdJ8="; | |||
} | |||
) | |||
); | |||
in | |||
{ | |||
environment.systemPackages = [ | |||
krisp-patcher | |||
]; | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Note|As of version 0.0.76, the script works. But, future versions of Discord may break the script. Therefore, you should not rely on this script for long-term use. For the latest updates and more details, follow https://github.com/NixOS/nixpkgs/issues/195512.}} | |||
After adding this to your Nix configuration and rebuilding, make sure Discord is completely closed, and then run: | |||
<pre>$ krisp-patcher ~/.config/discord/0.0.76/modules/discord_krisp/discord_krisp.node</pre> | |||
Once you restart Discord and join a VC, you should see a sound wave icon to the left of the hangup icon. | |||
=== Text-to-Speech === | === Text-to-Speech === | ||
Line 135: | Line 152: | ||
(pkgs.discord.override { withTTS = true; }) | (pkgs.discord.override { withTTS = true; }) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Applications]] | [[Category:Applications]] | ||
[[Category:Gaming]] | [[Category:Gaming]] |