From c2e17a44810b116bbcf81ac8712525308352d1b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20K=C3=A4nner?= Date: Wed, 13 Mar 2024 10:59:13 +0100 Subject: [PATCH] 196 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * --- modules/home-manager/sway.nix | 47 +++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/modules/home-manager/sway.nix b/modules/home-manager/sway.nix index 25371c7..94bba53 100644 --- a/modules/home-manager/sway.nix +++ b/modules/home-manager/sway.nix @@ -3,7 +3,38 @@ pkgs, lib, ... -}: { +}: let + schema = "org.gnome.desktop.a11y.applications"; + key = "screen-keyboard-enabled"; + squeekboard_toggle = pkgs.writeTextFile { + name = "squeekboard_toggle"; + destination = "/bin/toggle_squeekboard"; + executable = true; + text = '' + #!${pkgs.dash}/bin/dash + if ["$(gsettings get ${schema} ${key})" == "'true'"]; then + gsettings set ${schema} ${key} false + else + gsettings set ${schema} ${key} true + fi + ''; + }; + squeekboard_format = pkgs.writeTextFile { + name = "squeekboard_format"; + destination = "/bin/queekboard_format"; + executable = true; + text = '' + #!${pkgs.dash}/bin/dash + if ["$(gsettings get ${schema} ${key})" == "'true'"]; then + echo 󰌌 + echo enabled + else + echo 󰌐 + echo disabled + fi + ''; + }; +in { home.packages = with pkgs; [ waybar # status bar swaylock # screen locking @@ -266,17 +297,11 @@ }; "custom/squeekboard" = let - schema = "org.gnome.desktop.a11y.applications"; - key = "screen-keyboard-enabled"; in { - format = "󰌌"; - on-click = '' - if ["$(gsettings get ${schema} ${key})" == "'true'"]; then - gsettings set ${schema} ${key} false - else - gsettings set ${schema} ${key} true - fi - ''; + format = "{}"; + exec = "${squeekboard_format}/bin/squeekboard_format"; + exec-on-event = true; + on-click = "${squeekboard_toggle}/bin/toggle_squeekboard"; }; "sway/language" = {