Advertisement
renix1

Apple macbook white effect

Jan 12th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. #!/usr/bin/python3
  2. import os
  3. import time
  4.  
  5. values = [x / 100.0 for x in range(1, 101)]
  6.  
  7. def change_brightness(value):
  8.     os.system('brightness {}'.format(value))
  9.     time.sleep(0.006)
  10.  
  11. def reset_to_max():
  12.     change_brightness(1.0)
  13.  
  14. def increase():
  15.     for value in values:
  16.         change_brightness(value)
  17.  
  18. def reduce():
  19.     for value in reversed(values):
  20.         change_brightness(value)
  21.  
  22.  
  23. if __name__ == '__main__':
  24.     while 1:
  25.         try:
  26.             reset_to_max()
  27.             reduce()
  28.             increase()
  29.         except KeyboardInterrupt:
  30.             break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement