From a62764d54146e173b5f5858741658bfce8c17856 Mon Sep 17 00:00:00 2001 From: Jacob Bachmann Date: Sat, 27 Jan 2024 22:41:09 +0100 Subject: [PATCH] feat(sway): setup env on startup --- modules/xdg-portal.nix | 5 ++++- users/gandalf/modules/gui/sway/default.nix | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/xdg-portal.nix b/modules/xdg-portal.nix index ac1ad0c..463bc71 100644 --- a/modules/xdg-portal.nix +++ b/modules/xdg-portal.nix @@ -3,7 +3,10 @@ enable = true; wlr.enable = true; # gtk portal needed to make gtk apps happy - # extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + # extraPortals = [ + # pkgs.xdg-desktop-portal-wlr + # pkgs.xdg-desktop-portal-gtk + # ]; # upper has been replaced by following config.common.default = "*"; }; diff --git a/users/gandalf/modules/gui/sway/default.nix b/users/gandalf/modules/gui/sway/default.nix index f997e84..0505c13 100644 --- a/users/gandalf/modules/gui/sway/default.nix +++ b/users/gandalf/modules/gui/sway/default.nix @@ -81,8 +81,12 @@ in menu = "${pkgs.wofi}/bin/wofi"; startup = with pkgs; [ # TODO activate with systemd prbly requires a graphical.target? + { command = "exec systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP"; } + { command = "${dbus}/bin/dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway"; } + { command = "systemctl --user stop xdg-desktop-portal xdg-desktop-portal-wlr"; } + { command = "systemctl --user start xdg-desktop-portal xdg-desktop-portal-wlr"; } # { command = "${dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK"; } - { command = "${dbus}/bin/dbus-update-activation-environment --all"; } + # { command = "${dbus}/bin/dbus-update-activation-environment --all"; } { command = "${kanshi}/bin/kanshi"; } { command = "${networkmanagerapplet}/bin/nm-applet"; } { command = "${blueman}/bin/blueman-applet"; }