From ba6a326b4f2c547f84f4653b3bd51f83c5b84a59 Mon Sep 17 00:00:00 2001 From: Jakub Czajka Date: Thu, 22 Dec 2022 20:59:44 +0100 Subject: [PATCH] [home] Bind keys to functions. `xbindkeysrc` dotfile file is sourced inside `.bash_profile`. --- X11/.config/X11/xbindkeysrc | 14 ++++++++++++++ bash/.bash_profile | 4 ++++ conf/home/bash.scm | 13 ++++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 X11/.config/X11/xbindkeysrc diff --git a/X11/.config/X11/xbindkeysrc b/X11/.config/X11/xbindkeysrc new file mode 100644 index 0000000..31f74e4 --- /dev/null +++ b/X11/.config/X11/xbindkeysrc @@ -0,0 +1,14 @@ +# Copyright (c) 2022 Jakub Czajka +# 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 diff --git a/bash/.bash_profile b/bash/.bash_profile index c3a5c81..466810d 100644 --- a/bash/.bash_profile +++ b/bash/.bash_profile @@ -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 diff --git a/conf/home/bash.scm b/conf/home/bash.scm index 9efb1c7..dfee317 100644 --- a/conf/home/bash.scm +++ b/conf/home/bash.scm @@ -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) @@ -58,6 +60,15 @@ "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)) -- 2.39.5