diff options
| -rw-r--r-- | johnlepikhin/home/files/xkb/symbols/my_ru | 6 | ||||
| -rw-r--r-- | johnlepikhin/home/files/xkb/symbols/my_us | 6 | ||||
| -rw-r--r-- | johnlepikhin/home/xkb.scm | 34 |
3 files changed, 29 insertions, 17 deletions
diff --git a/johnlepikhin/home/files/xkb/symbols/my_ru b/johnlepikhin/home/files/xkb/symbols/my_ru new file mode 100644 index 0000000..d02b442 --- /dev/null +++ b/johnlepikhin/home/files/xkb/symbols/my_ru @@ -0,0 +1,6 @@ +xkb_symbols "my_ru" { + include "pc+ru+inet(evdev)+capslock(menu)+compose(ralt)" + key <PRSC> { [ Insert ] }; + key <KPAD> { [ Prior ] }; + key <KPEN> { [ Next ] }; +}; diff --git a/johnlepikhin/home/files/xkb/symbols/my_us b/johnlepikhin/home/files/xkb/symbols/my_us new file mode 100644 index 0000000..a36d9cf --- /dev/null +++ b/johnlepikhin/home/files/xkb/symbols/my_us @@ -0,0 +1,6 @@ +xkb_symbols "my_us" { + include "pc+us+inet(evdev)+capslock(menu)+compose(ralt)" + key <PRSC> { [ Insert ] }; + key <KPAD> { [ Prior ] }; + key <KPEN> { [ Next ] }; +}; diff --git a/johnlepikhin/home/xkb.scm b/johnlepikhin/home/xkb.scm index cd7ec9a..b7813d5 100644 --- a/johnlepikhin/home/xkb.scm +++ b/johnlepikhin/home/xkb.scm @@ -21,6 +21,7 @@ #:use-module (gnu services configuration) #:use-module (gnu home services) #:use-module (gnu packages xorg) + #:use-module (johnlepikhin home xsession) #:use-module (srfi srfi-1) #:use-module (guix records) #:use-module (guix gexp) @@ -32,26 +33,21 @@ home-xkb-configuration?) (define (add-xkb-files config) - `((".config/xkb/symbols/my_us" - ,(mixed-text-file - "xkb-symbols-my_us" - #~(string-append - "xkb_symbols \"my_us\" { - include \"pc+us+inet(evdev)+capslock(menu)+compose(ralt)\" - key <PRSC> { [ Insert ] }; -};"))) - (".config/xkb/symbols/my_ru" - ,(mixed-text-file - "xkb-symbols-my_ru" - #~(string-append - "xkb_symbols \"my_ru\" { - include \"pc+ru+inet(evdev)+capslock(menu)+compose(ralt)\" - key <PRSC> { [ Insert ] }; -};"))))) + `((".config/xkb/symbols/my_us" ,(local-file "files/xkb/symbols/my_ru")) + (".config/xkb/symbols/my_ru" ,(local-file "files/xkb/symbols/my_ru")))) (define (add-xkb-package config) (list xkbcomp setxkbmap)) +(define (activation-command _) + (string-append "setxkbmap -symbols my_us -print | xkbcomp -I" (getenv "HOME") "/.config/xkb - $DISPLAY")) + +(define (home-xkb-activation config) + `(("files/.config/xresources" ,#~(system #$(activation-command #t))))) + +(define (add-xsession-component config) + (activation-command #t)) + (define home-xkb-service-type (service-type (name 'home-xkb) @@ -60,6 +56,10 @@ (service-extension home-files-service-type add-xkb-files) (service-extension - home-profile-service-type add-xkb-package))) + home-profile-service-type add-xkb-package) + (service-extension + home-run-on-change-service-type home-xkb-activation) + (service-extension + home-xsession-service-type add-xsession-component))) (compose concatenate) (description "Create @file{~/.config/xkb/*}"))) |
