sway: fix systemd variables

This commit is contained in:
Leonardo Eugênio 2022-09-23 21:25:05 -03:00
parent b361e7f352
commit ba18c4944b

View file

@ -38,6 +38,16 @@ let
systemctl --user start swayidle.service systemctl --user start swayidle.service
fi fi
''; '';
dbus-sway-environment = pkgs.writeTextFile {
name = "dbus-sway-environment";
destination = "/bin/dbus-sway-environment";
executable = true;
text = ''
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
'';
};
in { in {
config = { config = {
wayland.windowManager.sway = let wayland.windowManager.sway = let
@ -311,6 +321,7 @@ in {
}; };
extraConfig = '' extraConfig = ''
for_window [title=.*] inhibit_idle fullscreen for_window [title=.*] inhibit_idle fullscreen
exec ${dbus-sway-environment}/bin/dbus-sway-environment
''; '';
}; };
services.swayidle = { services.swayidle = {