diff options
author | David Runge <dave@sleepmap.de> | 2021-11-24 21:46:35 +0100 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2021-11-24 21:46:35 +0100 |
commit | b488a22b92dc0b365566c114df439181793426ae (patch) | |
tree | 3897b473a59d94ed1574d9cdf3fcd26e12beae8f | |
parent | 2b9d126c4789dc1d0341d94ef4e46bab9ee58e23 (diff) | |
download | dotfiles-b488a22b92dc0b365566c114df439181793426ae.tar.gz dotfiles-b488a22b92dc0b365566c114df439181793426ae.tar.bz2 dotfiles-b488a22b92dc0b365566c114df439181793426ae.tar.xz dotfiles-b488a22b92dc0b365566c114df439181793426ae.zip |
zsh: Start sway-session on tty1
.zprofile:
Remove custom less exports (they are better handled in aliases).
When on tty1, start sway.
-rw-r--r-- | .zprofile | 23 |
1 files changed, 10 insertions, 13 deletions
@@ -19,19 +19,6 @@ path=( $path ) -# -# Less -# - -# Set the default Less options. -# Mouse-wheel scrolling has been disabled by -X (disable screen clearing). -# Remove -X and -F (exit if the content fits on one screen) to enable it. -export LESS='-F -g -i -M -R -S -w -X -z-4' - -# Set the Less input preprocessor. -if (( $+commands[lesspipe.sh] )); then - export LESSOPEN='| /usr/bin/env lesspipe.sh %s 2>&-' -fi # # Temporary Files @@ -50,3 +37,13 @@ TMPPREFIX="${TMPDIR%/}/zsh" if [[ ! -d "$TMPPREFIX" ]]; then mkdir -p "$TMPPREFIX" 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 +fi |