welcome.zsh (746B)
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 sudo mount -a 21 [[ $(ps -ef | grep xbindkeys | grep -v grep | wc -l) -eq 0 ]] && xbindkeys -f $XDG_CONFIG_HOME/xbindkeys/.xbindkeysrc 22 [ ! -f /tmp/tmux.lock ] && { 23 ~src/warez/tmuxp/bin/tmuxp load ~/.config/tmux/main.yaml && \ 24 touch /tmp/tmux.lock 25 } 26 } 27 28 tmux list-sessions >/dev/null 2>&1 || script 29 fi