Slack: Difference between revisions

imported>Patryk27
No edit summary
m Removed xdg.portal.gtkUsePortal option due to it no longer having any effect. (The feature was removed due to being unsupported and discouraged by GTK devs)
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{tip/unfree}}
[https://slack.com/ Slack] is a communication platform with a desktop application based on Electron.
[https://slack.com/ Slack] is a communication platform with a desktop application based on Electron.


Line 4: Line 6:


=== NixOS ===
=== NixOS ===
<syntaxHighlight lang="nix">
<syntaxHighlight lang="nix">
environment.systemPackages = with pkgs; [ slack ];
environment.systemPackages = with pkgs; [ slack ];
</syntaxHighlight>
=== Non-NixOS ===
<syntaxHighlight lang="console">
$ nix-env -iA nixos.slack
</syntaxHighlight>
</syntaxHighlight>


Line 19: Line 14:
=== Wayland ===
=== Wayland ===


If you're using recent nixpkgs (from 2022-01-27), you can enable native Wayland support by launching Slack as:
You can enable native Wayland support by launching Slack as:


<syntaxHighlight lang="console">
<syntaxHighlight lang="console">
Line 31: Line 26:
</syntaxHighlight>
</syntaxHighlight>


If that doesn't work for you, you might be using an older nixpkgs where the <code>NIXOS_OZONE_WL</code> option didn't exist yet - in that case, you can launch Slack via:
If you want to use screen-sharing, you'll have to enable <code>xdg-desktop-portal</code>, too:
 
<syntaxHighlight lang="console">
$ slack --ozone-platform=wayland --enable-features=UseOzonePlatform,WebRTCPipeWireCapturer
</syntaxHighlight>
 
... or, which is a bit more convenient, patch its derivation:
 
<syntaxHighlight lang="nix">
{ lib, pkgs, ... }:
let
  slack = pkgs.slack.overrideAttrs (old: {
    installPhase = old.installPhase + ''
      rm $out/bin/slack
 
      makeWrapper $out/lib/slack/slack $out/bin/slack \
        --prefix XDG_DATA_DIRS : $GSETTINGS_SCHEMAS_PATH \
        --prefix PATH : ${lib.makeBinPath [pkgs.xdg-utils]} \
        --add-flags "--ozone-platform=wayland --enable-features=UseOzonePlatform,WebRTCPipeWireCapturer"
    '';
  });
 
in
{
  environment.systemPackages = [ slack ];
}
</syntaxHighlight>
 
In all of the cases, if you want to use screen-sharing, you'll have to enable <code>xdg-desktop-portal</code>, too:


<syntaxHighlight lang="nix">
<syntaxhighlight lang="nix">
xdg = {
xdg = {
   portal = {
   portal = {
Line 69: Line 36:
       xdg-desktop-portal-gtk
       xdg-desktop-portal-gtk
     ];
     ];
    gtkUsePortal = true;
   };
   };
};
};
</syntaxhighlight>
==== Window decorations ====
If the above configuration leaves you without window decorations you may want to enable this feature as well:
<syntaxHighlight lang="console">
WaylandWindowDecorations
</syntaxHighlight>
</syntaxHighlight>
[[Category:Applications]]