Sway: Difference between revisions
→Using greeter: fixing package path + formatting |
dimming, screen sharing, inhibit idle |
||
Line 160: | Line 160: | ||
=== Cursor is missing icons or too tiny on HiDPI displays === | === Cursor is missing icons or too tiny on HiDPI displays === | ||
==== With programs.sway ==== | |||
<syntaxhighlight lang="nix> | |||
{ | |||
programs.sway.extraPackages = with pkgs; [ | |||
adwaita-icon-theme # mouse cursor and icons | |||
gnome-themes-extra # dark adwaita theme | |||
... | |||
]; | |||
} | |||
</syntaxhighlight> | |||
In ~/.config/sway/config | |||
<syntaxhighlight> | |||
seat "*" xcursor_theme Adwaita 32 | |||
</syntaxhighlight> | |||
==== With Home Manager ==== | |||
Using [[Home Manager]] try configuring a general mouse cursor size and theme. The reason that your cursor might be missing in some applications, is because <code>XCURSOR_THEME</code>is missing, which will cause applications relying on <code>XWAYLAND</code> to misbehave. Setting <code>sway.enable = true</code>, combined with the <code>name</code>, <code>package</code> and size will set the correct environment variables, which sway will then use. | Using [[Home Manager]] try configuring a general mouse cursor size and theme. The reason that your cursor might be missing in some applications, is because <code>XCURSOR_THEME</code>is missing, which will cause applications relying on <code>XWAYLAND</code> to misbehave. Setting <code>sway.enable = true</code>, combined with the <code>name</code>, <code>package</code> and size will set the correct environment variables, which sway will then use. | ||
Line 292: | Line 310: | ||
}; | }; | ||
}; | }; | ||
</syntaxhighlight> | |||
=== Screen sharing with Firefox, Chromium === | |||
<syntaxhighlight lang="nix"> | |||
{ pkgs, ... }: | |||
{ | |||
# xdg portal + pipewire = screensharing | |||
xdg.portal = { | |||
enable = true; | |||
wlr.enable = true; | |||
}; | |||
services.pipewire = { | |||
enable = true; | |||
alsa.enable = true; | |||
pulse.enable = true; | |||
}; | |||
} | |||
</syntaxhighlight> | |||
=== Screen dimming with wl-gammarelay-rs === | |||
Add <code>wl-gammarelay-rs</code> to programs.sway.extraPackages, then add the following to sway config: | |||
<syntaxhighlight> | |||
# start daemon | |||
exec wl-gammarelay-rs | |||
# bind shortcut to reset brightness | |||
bindsym $mod+Control+0 exec busctl --user set-property rs.wl-gammarelay / rs.wl.gammarelay Brightness d 1 | |||
# bind shortcut to dim screen for a particular output | |||
bindsym $mod+Control+Underscore exec busctl --user set-property rs.wl-gammarelay /outputs/DP_1 rs.wl.gammarelay Brightness d 0.5 | |||
</syntaxhighlight> | |||
=== Inhibit swayidle/suspend when fullscreen === | |||
Add to sway config: | |||
<syntaxhighlight> | |||
# When you use `for_window` the command you give is not executed | |||
# immediately. It is stored in a list and the command is executed | |||
# every time a window opens or changes (eg. title) in a way that | |||
# matches the criteria. | |||
# inhibit idle for fullscreen apps | |||
for_window [app_id="^.*"] inhibit_idle fullscreen | |||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Window managers]] | [[Category:Window managers]] | ||
[[Category:Applications]] | [[Category:Applications]] |