From 5c916d69d457101326803eb076a746060e3618cf Mon Sep 17 00:00:00 2001 From: Vikas Kushwaha Date: Thu, 21 Nov 2024 13:30:52 +0530 Subject: Moved from github --- .config/zsh/zprofile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .config/zsh/zprofile (limited to '.config/zsh/zprofile') 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 -- cgit v1.2.3