startXflux.sh 831 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. # Script to automatically start xflux
  3. # http://stereopsis.com/flux/
  4. # Place in /home/$USER/.kde4/Autostart to automatically start xflux on user login.
  5. # Usage: /usr/local/bin/xflux [-z zipcode | -l latitude] [-g longitude] [-k colortemp (default 3400)] [-nofork]
  6. # protip: Say where you are (use -z or -l).
  7. isStarted=`ps -U $USER |grep [x]flux` # проверяем запущен ли xflux пользователем $USER
  8. idXflux=${isStarted::5} # присваиваем name первый символ переменной isStarted
  9. if [ -z ${isStarted::5} ]
  10. then /usr/bin/xflux -l 52.4452778 -g 30.9841667
  11. else
  12. {
  13. kill -9 $idXflux
  14. /usr/bin/xflux -l 52.4452778 -g 30.9841667
  15. isStarted=`ps -U $USER |grep [x]flux`
  16. echo "$USER started xflux with id =${isStarted::5}"
  17. }
  18. fi