1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-11 07:10:39 +02:00

feat(i3): properly hand off env variables to systemd so portals will know about them

This commit is contained in:
oddlama 2023-12-04 22:30:09 +01:00
parent c2aa20c3b8
commit 6c9618a95c
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A

View file

@ -16,7 +16,7 @@
bindWithModifier = mapAttrs' (k: nameValuePair (cfg.modifier + "+" + k)); bindWithModifier = mapAttrs' (k: nameValuePair (cfg.modifier + "+" + k));
cfg = config.xsession.windowManager.i3.config; 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"; pname = "i3-per-workspace-layout";
version = "1.0.0"; version = "1.0.0";
@ -31,7 +31,7 @@
}; };
}; };
sway-overfocus = pkgs.rustPlatform.buildRustPackage rec { sway-overfocus = pkgs.rustPlatform.buildRustPackage {
pname = "sway-overfocus"; pname = "sway-overfocus";
version = "1.0.0"; version = "1.0.0";
@ -202,7 +202,7 @@ in {
}; };
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; always = false;
notification = false; notification = false;
} }
@ -288,10 +288,11 @@ in {
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval $(dbus-launch --exit-with-session --sh-syntax) eval $(dbus-launch --exit-with-session --sh-syntax)
fi 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 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 fi
autorandr -c autorandr -c