welcome.zsh (712B)
1 # WELCOME 2 ## don't run this if over ssh (i.e. a server) 3 if [[ ! -v SSH_TTY ]] ; then 4 5 PTS=$(ps -U $USER | awk '{ print $2 }' | grep "pts/" | uniq | wc -l) 6 7 audio_vol() { 8 _master="Master" 9 _usb="Dell USB Audio" 10 11 if amixer | grep "$_master" >/dev/null ; then 12 amixer sset "$_master" 40% >/dev/null 13 elif amixer | grep "$_usb" >/dev/null ; then 14 amixer sset "$_usb" 25% >/dev/null 15 fi 16 } 17 18 script() { 19 audio_vol 20 [[ $(ps -ef | grep xbindkeys | grep -v grep | wc -l) -eq 0 ]] && xbindkeys 21 tmux new -s main 22 } 23 24 tmux list-sessions >/dev/null 2>&1 || script 25 # run on first tmux pane 26 if [[ $TMUX_PANE == "%0" ]] && [[ ! -v VIMRUNTIME ]]; then 27 $HOME/.local/bin/ahoy 28 fi 29 #cat ~/tmp/logo5 30 fi