--- 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]
--- 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"))