d95b0a82e74e

Rotate
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 08 Aug 2018 14:53:06 +0000
parents 44bf69c2ddfc
children 291b07317431
branches/tags (none)
files stumpwmrc

Changes

--- a/stumpwmrc	Wed Aug 01 18:54:06 2018 +0000
+++ b/stumpwmrc	Wed Aug 08 14:53:06 2018 +0000
@@ -119,11 +119,17 @@
 (defun brightness ()
   (aref *brightness-values* *brightness-index*))
 
-(defcommand rotate-brightness () ()
+(defun rotate-brightness (delta)
   (setf *brightness-index*
-        (mod+ *brightness-index* 1 (length *brightness-values*)))
+        (mod+ *brightness-index* delta (length *brightness-values*)))
   (run-shell-command (format nil "xbacklight -set ~D" (brightness))))
 
+(defcommand rotate-brightness-up () ()
+  (rotate-brightness 1))
+
+(defcommand rotate-brightness-down () ()
+  (rotate-brightness -1))
+
 
 ;;;; Commands -----------------------------------------------------------------
 (defcommand sane-hsplit () ()
@@ -273,8 +279,8 @@
   ("H-'" "title"))
 
 (define-top-keys ;; screen
-  ("H-F5" "exec xbacklight -dec 10")
-  ("H-F6" "rotate-brightness")
+  ("H-F5" "rotate-brightness-down")
+  ("H-F6" "rotate-brightness-up")
   ("H-F7" "screen-single")
   ("H-F8" "screen-multi"))