# HG changeset patch # User Steve Losh # Date 1531751827 0 # Node ID b7c569c5f66b38ebe7ebd085e9d7e62bdec28419 # Parent 6d2fdb8941e988634a2710257e665fb4798170a9# Parent 1f7fd4683ec5bbd1025b54559ca129b2b1736044 Merge. diff -r 1f7fd4683ec5 -r b7c569c5f66b gitconfig --- a/gitconfig Sun Jul 15 15:38:15 2018 +0000 +++ b/gitconfig Mon Jul 16 14:37:07 2018 +0000 @@ -5,7 +5,7 @@ [core] pager = cat editor = nvim - excludesfile = /Users/sjl/.gitignore + excludesfile = /home/sjl/.gitignore [alias] tags = tag -l diff -r 1f7fd4683ec5 -r b7c569c5f66b stumpwmrc --- a/stumpwmrc Sun Jul 15 15:38:15 2018 +0000 +++ b/stumpwmrc Mon Jul 16 14:37:07 2018 +0000 @@ -17,11 +17,6 @@ ;;;; Utils -------------------------------------------------------------------- -(defun ensure-mode-line () - (when (not (stumpwm::head-mode-line (current-head))) - (toggle-mode-line (current-screen) (current-head)))) - - (defun string-contains (needle string) (and (search needle string :test #'char=) t)) @@ -38,6 +33,10 @@ (find ch bag :test #'char=)))) +(defun mod+ (n increment modulo) + (mod (+ n increment) modulo)) + + (defun volume () (-<> (run-shell-command "amixer sget Master" t) (string-grep "Front Left:" <> :first-only t) @@ -79,7 +78,7 @@ `(case *host* ,@clauses)) -;;;; Regroup ------------------------------------------------------------------- +;;;; Regroup ------------------------------------------------------------------ (defparameter *class-groups* '(("zoom" . "zoom") ("jetbrains-idea-ce" . "ij")) @@ -102,6 +101,19 @@ ;;;; Load --------------------------------------------------------------------- (load-module "pass") +;;;; Brightness --------------------------------------------------------------- +(defparameter *brightness-values* #(0 1 25 50 75 100)) +(defparameter *brightness-index* 2) + +(defun brightness () + (aref *brightness-values* *brightness-index*)) + +(defcommand rotate-brightness () () + (setf *brightness-index* + (mod+ *brightness-index* 1 (length *brightness-values*))) + (run-shell-command (format nil "xbacklight -set ~D" (brightness)))) + + ;;;; Commands ----------------------------------------------------------------- (defcommand sane-hsplit () () (hsplit) @@ -242,7 +254,7 @@ (define-top-keys ;; screen ("H-F5" "exec xbacklight -dec 10") - ("H-F6" "exec xbacklight -inc 10") + ("H-F6" "rotate-brightness") ("H-F7" "screen-single") ("H-F8" "screen-multi")) @@ -278,6 +290,10 @@ ;;;; Modeline ----------------------------------------------------------------- +(defun ensure-mode-line () + (when (not (stumpwm::head-mode-line (current-head))) + (toggle-mode-line (current-screen) (current-head)))) + (defun configure-modeline () (setf *time-modeline-string*