]> git.ekhem.eu.org Git - guix.git/commitdiff
[home] Bind keys to functions.
authorJakub Czajka <jakub@ekhem.eu.org>
Thu, 22 Dec 2022 19:59:44 +0000 (20:59 +0100)
committerJakub Czajka <jczajka@google.com>
Sun, 24 Dec 2023 18:53:07 +0000 (19:53 +0100)
`xbindkeysrc` dotfile file is sourced inside `.bash_profile`.

X11/.config/X11/xbindkeysrc [new file with mode: 0644]
bash/.bash_profile
conf/home/bash.scm

diff --git a/X11/.config/X11/xbindkeysrc b/X11/.config/X11/xbindkeysrc
new file mode 100644 (file)
index 0000000..31f74e4
--- /dev/null
@@ -0,0 +1,14 @@
+# Copyright (c) 2022 Jakub Czajka <jakub@ekhem.eu.org>
+# License: GPL-3.0 or later.
+
+"volume 5%+"
+  XF86AudioRaiseVolume
+
+"volume 5%-"
+  XF86AudioLowerVolume
+
+"sleep 0.5; xtrlock"
+  Mod4 + l
+
+"sleep 0.5; xtrlock & sudo /bin/zzz"
+  Mod4 + s
index c3a5c8124f54cbba3d2d42dee0d8296f29a90662..466810df1a513dc6967875964ddebf3de6c3dad5 100644 (file)
@@ -20,4 +20,8 @@ if [ -d ${_confdir}/profile.d/ ]; then
     unset _f
 fi
 
+if [ -f ${_confdir}/X11/xbindkeysrc ]; then
+    xbindkeys --file "${XDG_CONFIG_HOME}/X11/xbindkeysrc"
+fi
+
 unset _confdir
index 9efb1c77ed1fcf0c6dfc061b5db4e1da41650443..dfee317f64238cc2438c947af71a1d611406bc75 100644 (file)
@@ -4,9 +4,11 @@
 ;; bash.scm - custom bash configuration.
 
 (define-module (conf home bash)
+  #:use-module (conf home program)
   #:use-module (conf home symlink)
   #:use-module (gnu home services)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu services configuration)
   #:use-module (guix gexp)
   #:use-module (guix packages)
                 "bash/.config/profile.d/20-less.sh"
                 "bash/.config/profile.d/50-bash.sh")))
 
+(define xprofile-service
+  (service home-program-service-type
+          (home-program-configuration
+           (packages
+            (list xbindkeys))
+           (dotfiles
+            (list "X11/.config/X11/xbindkeysrc")))))
+
 (define bash-services
   (list bash-service
-       profile-service))
+       profile-service
+       xprofile-service))