Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.74 KB | None | 0 0
  1. #! /bin/bash
  2. function on()
  3. {
  4.     if [ $lq -gt 74 ]; then
  5.     echo '${image ~/Conky/Blue2/images/nm-100.png -p 200,0 -s 30x30}'
  6.     fi
  7.     if [ $lq -lt 75 ] && [ $lq -gt 49 ]; then
  8.     echo '${image ~/Conky/Blue2/images/nm-75.png -p 200,0 -s 30x30}'
  9.     fi
  10.     if [ $lq -lt 50 ] && [ $lq -gt 25 ]; then
  11.     echo '${image ~/Conky/Blue2/images/nm-50.png -p 200,0 -s 30x30}'
  12.     fi
  13.     if [ $lq -lt 25 ] && [ $lq -gt 5 ]; then
  14.     echo '${image ~/Conky/Blue2/images/nm-25.png -p 200,0 -s 30x30}'
  15.     fi
  16. }
  17. function off()
  18. {
  19. echo '${image ~/Conky/Blue2/images/nm-00.png -p 200,0 -s 30x30}'
  20. }
  21.  
  22. lq=$(iwconfig wlan0|grep 'Link Quality='|grep '='|grep --max-count=1 -o '\=\([0-9]\+\)'|grep --max-count=1 -o '\([0-9]\+\)')
  23.  
  24. if [ $lq -lt 5 ]
  25. then
  26.     off
  27. else
  28.     on
  29. fi
  30.  
  31. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement