# HG changeset patch # User Steve Losh # Date 1531149368 14400 # Node ID 74e54dee9e41352e852d6a91a7f17f251d8b3308 # Parent 4b486c5a8a541d32101eaff5bf2c29c2d14e4450# Parent c27fb01fc92f28d8bac9f6caeb73f26132b62b76 Merge diff -r c27fb01fc92f -r 74e54dee9e41 mutt/offlineimaplinux.py --- a/mutt/offlineimaplinux.py Sat Jul 07 20:27:24 2018 +0000 +++ b/mutt/offlineimaplinux.py Mon Jul 09 11:16:08 2018 -0400 @@ -2,8 +2,8 @@ import subprocess -def get_keychain_pass(account=None): - command = "pass-work '%s'" % account - output = subprocess.check_output(command, shell=True, stderr=subprocess.STDOUT) +def get_keychain_pass(account=None, command='pass'): + full_command = "%s '%s'" % (command, account) + output = subprocess.check_output(full_command, shell=True, stderr=subprocess.STDOUT) return output.splitlines()[0] diff -r c27fb01fc92f -r 74e54dee9e41 stumpwmrc --- a/stumpwmrc Sat Jul 07 20:27:24 2018 +0000 +++ b/stumpwmrc Mon Jul 09 11:16:08 2018 -0400 @@ -37,6 +37,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) @@ -78,7 +82,7 @@ `(case *host* ,@clauses)) -;;;; Regroup ------------------------------------------------------------------- +;;;; Regroup ------------------------------------------------------------------ (defparameter *class-groups* '(("zoom" . "zoom") ("jetbrains-idea-ce" . "ij")) @@ -101,6 +105,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) @@ -241,7 +258,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"))