about summary refs log tree commit diff
path: root/users/tazjin/emacs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-03-23T20·30+0200
committertazjin <mail@tazj.in>2021-03-23T21·00+0000
commit580d8fc37cb577d5027a288ce017bc73dc5d5b72 (patch)
tree58b3c2fd4749097409728e8c68ad4352f9643a5c /users/tazjin/emacs
parent4057634a7a91ecc4a1aff3d7acd11b0d7b422027 (diff)
feat(tazjin/emacs): Configurable screen lock & brightness adjustment r/2322
Change-Id: I749ce827c7d53ecf8dec66c1f62481e6ef44791d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2645
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/tazjin/emacs')
-rw-r--r--users/tazjin/emacs/config/desktop.el25
1 files changed, 15 insertions, 10 deletions
diff --git a/users/tazjin/emacs/config/desktop.el b/users/tazjin/emacs/config/desktop.el
index cbbad7799047..a347133fae7b 100644
--- a/users/tazjin/emacs/config/desktop.el
+++ b/users/tazjin/emacs/config/desktop.el
@@ -12,6 +12,18 @@
 (require 'exwm-randr)
 (require 'exwm-systemtray)
 
+(defcustom tazjin--screen-lock-command "tazjin-screen-lock"
+  "Command to execute for locking the screen."
+  :group 'tazjin)
+
+(defcustom tazjin--backlight-increase-command "light -A 4"
+  "Command to increase screen brightness."
+  :group 'tazjin)
+
+(defcustom tazjin--backlight-decrease-command "light -U 4"
+  "Command to decrease screen brightness."
+  :group 'tazjin)
+
 (defun pactl (cmd)
   (shell-command (concat "pactl " cmd))
   (message "Volume command: %s" cmd))
@@ -22,12 +34,12 @@
 
 (defun brightness-up ()
   (interactive)
-  (shell-command "light -A 4")
+  (shell-command tazjin--backlight-increase-command)
   (message "Brightness increased"))
 
 (defun brightness-down ()
   (interactive)
-  (shell-command "light -U 4")
+  (shell-command tazjin--backlight-decrease-command)
   (message "Brightness decreased"))
 
 (defun set-xkb-layout (layout)
@@ -40,14 +52,7 @@
 (defun lock-screen ()
   (interactive)
   (set-xkb-layout "us")
-
-  ;; A sudoers configuration is in place that lets me execute this
-  ;; particular command without having to enter a password.
-  ;;
-  ;; The reason for things being set up this way is that I want
-  ;; xsecurelock.service to be started as a system-wide service that
-  ;; is tied to suspend.target.
-  (shell-command "/usr/bin/sudo /usr/bin/systemctl start xsecurelock.service"))
+  (shell-command tazjin--screen-lock-command))
 
 (defun create-window-name ()
   "Construct window names to be used for EXWM buffers by