diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-10-23 11:10:48 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-10-23 11:10:48 +0200 |
commit | e8ca2914556f5256badc186444a278a7dee48b22 (patch) | |
tree | eaa094a41324d9919064b4452c57f93f20976cb1 /config/essentials/zsh/.zshrc | |
parent | ffba2961d1eb398aa906b8218ed3cc1e9586e45e (diff) |
use case statement to select desktop manager
Diffstat (limited to 'config/essentials/zsh/.zshrc')
-rw-r--r-- | config/essentials/zsh/.zshrc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 7fa61c7..3f2d7f4 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -1,15 +1,14 @@ #!/bin/zsh -if [[ "/dev/tty1" = "$TTY" || "/dev/tty2" = "$TTY" ]] && [[ "$(id -u)" -ne 0 ]] +if [ "$(id -u)" -ne 0 ] then - clear - if [ "/dev/tty1" = "$TTY" ] - then - exec startw > /dev/null 2>&1 - else - exec startx > /dev/null 2>&1 - fi - exit + [ "${TTY%%tty*}" = '/dev/' ] && clear + case "${TTY#/dev/tty}" in + 1) exec startdwl > /dev/null 2>&1 ;; + 2) exec startx > /dev/null 2>&1 ;; + 3) exec startw > /dev/null 2>&1 ;; + *) false ;; + esac && exit fi autoload -U select-word-style |