ricod1996

Untitled

Feb 27th, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.66 KB | None | 0 0
  1. #!/bin/bash
  2. #start or kill, and check is on trayer
  3.  
  4. CheckIfTrayerIsOn=$(ps -A | grep trayer)
  5. case $1 in
  6.     start)
  7.         if [$CheckIfTrayerIsOn -eq ""]
  8.         then
  9.             case $2 in
  10.                 2)
  11.                     width=4
  12.                     ;;
  13.                 #You may want to add more options but that's up to you
  14.                 *)
  15.                     width=2
  16.                     ;;
  17.             esac
  18.             trayer --edge bottom --align right --width $width & exit
  19.         else
  20.             exit
  21.         fi
  22.         ;;
  23.     stop)
  24.         pkill trayer
  25.         ;;
  26.     *)
  27.         echo "Don't forget the input"
  28.         exit 1
  29. esac
Advertisement
Add Comment
Please, Sign In to add comment