diff options
author | Vikas Kushwaha <dev@vikas.rocks> | 2024-11-21 13:30:52 +0530 |
---|---|---|
committer | Vikas Kushwaha <dev@vikas.rocks> | 2024-11-21 13:30:52 +0530 |
commit | 5c916d69d457101326803eb076a746060e3618cf (patch) | |
tree | d6fce3256eede1c1bf78fb6a1be75b9cc4b84cee /.config/zsh/zprofile |
Moved from github
Diffstat (limited to '.config/zsh/zprofile')
-rw-r--r-- | .config/zsh/zprofile | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/.config/zsh/zprofile b/.config/zsh/zprofile new file mode 100644 index 0000000..46c5217 --- /dev/null +++ b/.config/zsh/zprofile @@ -0,0 +1,21 @@ +#!/bin/zsh +. ~/.profile + +[ -n "$TMUX" ] || [ -n "$TERMUX_VERSION" ] || [ "$SSH_CONNECTION" ] && + return + +on_ac_power="$(cat /sys/class/power_supply/ACAD/online)" +[ "$on_ac_power" = 0 ] && brightnessctl set 5% || brightnessctl set 20% + +case "$TTY" in + /dev/tty1) + [ "$on_ac_power" = 1 ] && { + echo "Waiting for nvidia card to load up..." + until [ -e /dev/dri/card0 ]; do; sleep 0.1; done + } + command -V startx >/dev/null && { pgrep startx || startx } + ;; + /dev/tty3) tmux new -s master ;; + /dev/tty[2-5]) tmux new -s "${TTY#/dev/}" ;; + # /dev/pts/*) exec tmux new -s "${TTY#/dev/}" ;; +esac |