commit 352785a5a7ce9b7973a5ab0f0cfa6a8104c6d366 parent 8af62ecd9c7e44a77a11541b558fe1ca069a6e14 Author: pyratebeard <root@pyratebeard.net> Date: Fri, 24 Nov 2023 21:33:46 +0000 fix welcome skipping (don't exit dumbass) :skull: Diffstat:
M | zsh/.zsh/welcome.zsh | | | 49 | +++++++++++++++++++++++++------------------------ |
1 file changed, 25 insertions(+), 24 deletions(-)
diff --git a/zsh/.zsh/welcome.zsh b/zsh/.zsh/welcome.zsh @@ -1,29 +1,30 @@ # WELCOME ## don't run this if over ssh (i.e. a server) -[[ -v SSH_TTY ]] && exit 0 - -PTS=$(ps -U $USER | awk '{ print $2 }' | grep "pts/" | uniq | wc -l) - -audio_vol() { - _master="Master" - _usb="Dell USB Audio" +if [[ ! -v SSH_TTY ]] ; then - if amixer | grep "$_master" >/dev/null ; then - amixer sset "$_master" 40% >/dev/null - elif amixer | grep "$_usb" >/dev/null ; then - amixer sset "$_usb" 25% >/dev/null + PTS=$(ps -U $USER | awk '{ print $2 }' | grep "pts/" | uniq | wc -l) + + audio_vol() { + _master="Master" + _usb="Dell USB Audio" + + if amixer | grep "$_master" >/dev/null ; then + amixer sset "$_master" 40% >/dev/null + elif amixer | grep "$_usb" >/dev/null ; then + amixer sset "$_usb" 25% >/dev/null + fi + } + + script() { + audio_vol + [[ $(ps -ef | grep xbindkeys | grep -v grep | wc -l) -eq 0 ]] && xbindkeys + tmux new -s main + } + + tmux list-sessions >/dev/null 2>&1 || script + # run on first tmux pane + if [[ $TMUX_PANE == "%0" ]] && [[ ! -v VIMRUNTIME ]]; then + $HOME/bin/ahoy fi -} - -script() { - audio_vol - [[ $(ps -ef | grep xbindkeys | grep -v grep | wc -l) -eq 0 ]] && xbindkeys - tmux new -s main -} - -tmux list-sessions >/dev/null 2>&1 || script -# run on first tmux pane -if [[ $TMUX_PANE == "%0" ]] && [[ ! -v VIMRUNTIME ]]; then - $HOME/bin/ahoy + #cat ~/tmp/logo5 fi -#cat ~/tmp/logo5