toggle-keyboard: New package.

This commit is contained in:
Adrian Kuschelyagi Malacoda 2021-10-07 15:44:43 -05:00
parent 3799873323
commit 2970b6a63f
3 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,8 @@
!/bin/sh
KEYBOARD_ENABLED=$(gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled)
if [ "$KEYBOARD_ENABLED" = "true" ]; then
KEYBOARD_ENABLED="false"
else
KEYBOARD_ENABLED="true"
fi
gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled $KEYBOARD_ENABLED

View File

@ -0,0 +1,5 @@
[Desktop Entry]
Name=Toggle Keyboard
Type=Application
Exec=@EXEC@
Categories=Utility;

View File

@ -0,0 +1,34 @@
(define-module (mason packages toggle-keyboard)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix build-system copy)
#:use-module (guix utils)
#:use-module (guix gexp))
(define-public toggle-keyboard
(package
(name "toggle-keyboard")
(version "0.0.1")
(home-page "https://forge.monarch-pass.net/malacoda/mason")
(source
(local-file "scripts/toggle-keyboard" #:recursive? #t))
(build-system copy-build-system)
(arguments
'(#:install-plan
'(("toggle-keyboard" "bin/")
("toggle-keyboard.desktop" "share/applications/"))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'configure
(lambda* (#:key inputs outputs #:allow-other-keys)
(substitute* (list "toggle-keyboard.desktop")
(("@EXEC@")
(string-append (assoc-ref outputs "out")
"/bin/toggle-keyboard")))
#t)))))
(synopsis "Toggle keyboard")
(description
"Toggle keyboard")
(license license:gpl3+)))
toggle-keyboard