Advertisement
j0h

ColourClocKeyboard

j0h
Jan 9th, 2015
467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.33 KB | None | 0 0
  1. #!/bin/bash
  2. #Use my keyboard as a clock
  3. #https://github.com/tuxmark5/ApexCtl/issues
  4. #set -vx
  5. zed=`date +"%H"`  
  6. echo $zed
  7.  
  8. off="000000"
  9. white="FFFFFF"
  10. orange="FF8000"
  11. yellow="FFFF00"
  12. lime="80FF00"
  13. green="00FF00"
  14. teal="00FF80"
  15. turquoise="00FFFF"
  16. sky="0080FF"
  17. blue="0000FF"
  18. purple="7F00FF"
  19. fuschia="FF00FF"
  20. lavender="FF007F"
  21. red="FF0000"
  22.  
  23.  
  24.   case $zed in
  25.   0[0-3])
  26.   #purple bluw logo
  27.   apexctl colors -n 551A8B:8 -s 551A8B:8 -e 551A8B:8  -w 551A8B:8 -l 0000FF:8
  28.   ;;
  29.   0[4-9])
  30.   #too early for this
  31.   sudo apexctl colors -n $off:8 -s $off:8 -e $off:8  -w $off:8 -l $off:8
  32.   ;;
  33.   10-12)
  34.   #still too early for this
  35.   apexctl colors -n $off:8 -s $off:8 -e $off:8  -w $off:8 -l $red:8
  36.   ;;
  37.   13)
  38.   apexctl colors -n $white:8 -s $white:8 -e $white:8  -w $white:8 -l $white:8
  39.   ;;
  40.   14)
  41.   apexctl colors -n $orange:8 -s $orange:8 -e $orange:8  -w $orange:8 -l $orange:8
  42.   ;;
  43.   15)
  44.   apexctl colors -n $yellow:8 -s $yellow:8 -e $yellow:8  -w $yellow:8 -l $yellow:8
  45.   ;;
  46.   16)
  47.   apexctl colors -n $lime:8 -s $lime:8 -e $lime:8  -w $lime:8 -l $lime:8
  48.   ;;
  49.   17)
  50.   apexctl colors -n $green:8 -s $green:8 -e $green:8  -w $green:8 -l $green:8
  51.   ;;
  52.   18)
  53.   apexctl colors -n $teal:8 -s $teal:8 -e $teal:8  -w $teal:8 -l $teal:8
  54.   ;;
  55.   19)
  56.   apexctl colors -n $purple:8 -s $purple:8 -e $purple:8  -w $purple:8 -l $purple:8
  57.   ;;
  58.   20)
  59.   apexctl colors -n $fuschia:8 -s $fuschia:8 -e $fuschia:8  -w $fuschia:8 -l $fuschia:8
  60.   ;;
  61.   21-23)  
  62.   apexctl colors -n $red:8 -s $red:8 -e $red:8  -w $red:8 -l $blue:8
  63.   ;;
  64.    *)
  65.    echo "Dude What?"
  66.    ;;
  67.  esac
  68.  
  69. flashyLogo(){
  70.           for i in `seq 1 6`
  71.           do
  72.               apexctl colors -l FFFF00:8
  73.               sleep 0.2
  74.               apexctl colors -l FF00FF:8
  75.               sleep 0.2
  76.               apexctl colors -l 0000FF:8
  77.               sleep 0.2
  78.               apexctl colors -l 00FFFF:8
  79.               sleep 0.2
  80.               apexctl colors -l FF0000:8
  81.          
  82.           done
  83.     }
  84.  
  85. fade(){
  86.     blue="0000FF"
  87.     colour=$blue
  88.     apexctl colors -n $colour:8 -s $colour:8 -e $colour:8  -w $colour:8 -l $colour:8
  89.    
  90. for k in `seq 0 3`
  91.     do     
  92.         for i in `seq 8 -2 2`
  93.             do
  94.                 sudo apexctl colors -n $colour:$i -s $colour:$i -e $colour:$i  -w $colour:$i -l $colour:$i
  95.                 sleep 0.1
  96.             done
  97.  
  98.         for i in `seq 2  8`
  99.             do
  100.                 sudo apexctl colors -n $colour:$i -s $colour:$i -e $colour:$i  -w $colour:$i -l $colour:$i
  101.                 sleep 0.1
  102.             done
  103.     done
  104.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement