291b07317431

Merge.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sat, 11 Aug 2018 18:14:18 +0000
parents f14a899254c7 (current diff) d95b0a82e74e (diff)
children 5eb1639b017e
branches/tags (none)
files

Changes

--- a/stumpwmrc	Sat Aug 11 18:14:10 2018 +0000
+++ b/stumpwmrc	Sat Aug 11 18:14:18 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"))