From 6c9618a95cebefe4a28400812b7c0e56e488fe7f Mon Sep 17 00:00:00 2001 From: oddlama Date: Mon, 4 Dec 2023 22:30:09 +0100 Subject: [PATCH] feat(i3): properly hand off env variables to systemd so portals will know about them --- users/myuser/graphical/i3.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/users/myuser/graphical/i3.nix b/users/myuser/graphical/i3.nix index 0842406..56471b0 100644 --- a/users/myuser/graphical/i3.nix +++ b/users/myuser/graphical/i3.nix @@ -16,7 +16,7 @@ bindWithModifier = mapAttrs' (k: nameValuePair (cfg.modifier + "+" + k)); cfg = config.xsession.windowManager.i3.config; - i3-per-workspace-layout = pkgs.rustPlatform.buildRustPackage rec { + i3-per-workspace-layout = pkgs.rustPlatform.buildRustPackage { pname = "i3-per-workspace-layout"; version = "1.0.0"; @@ -31,7 +31,7 @@ }; }; - sway-overfocus = pkgs.rustPlatform.buildRustPackage rec { + sway-overfocus = pkgs.rustPlatform.buildRustPackage { pname = "sway-overfocus"; version = "1.0.0"; @@ -202,7 +202,7 @@ in { }; in [ { - command = "${pkgs.systemd}/bin/systemctl --user import-environment DISPLAY; ${pkgs.systemd}/bin/systemctl --user start i3-session.target"; + command = "${pkgs.systemd}/bin/systemctl --user start i3-session.target"; always = false; notification = false; } @@ -288,10 +288,11 @@ in { if test -z "$DBUS_SESSION_BUS_ADDRESS"; then eval $(dbus-launch --exit-with-session --sh-syntax) fi - systemctl --user import-environment DISPLAY XAUTHORITY + export DESKTOP_SESSION=i3 + systemctl --user import-environment PATH DISPLAY XAUTHORITY DESKTOP_SESSION XDG_CONFIG_DIRS XDG_DATA_DIRS XDG_RUNTIME_DIR XDG_SESSION_ID DBUS_SESSION_BUS_ADDRESS if command -v dbus-update-activation-environment >/dev/null 2>&1; then - dbus-update-activation-environment DISPLAY XAUTHORITY + dbus-update-activation-environment --systemd --all fi autorandr -c