aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.zprofile12
1 files changed, 7 insertions, 5 deletions
diff --git a/.zprofile b/.zprofile
index 3a4ed26..4ec678f 100644
--- a/.zprofile
+++ b/.zprofile
@@ -41,9 +41,11 @@ fi
[[ "$TTY" == /dev/tty* ]] || return 0
-export $(systemctl --user show-environment)
-if [[ -z $DISPLAY && "$TTY" == "/dev/tty1" ]]; then
- systemd-cat -t sway sway
- systemctl --user stop sway-session.target
- systemctl --user unset-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
+if command -v systemctl > /dev/null; then
+ export $(systemctl --user show-environment)
+ if [[ -z $DISPLAY && "$TTY" == "/dev/tty1" ]]; then
+ systemd-cat -t sway sway
+ systemctl --user stop sway-session.target
+ systemctl --user unset-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
+ fi
fi