From b92860a8fda602ed1278fcf9ec4fdd2f8408cfae Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Wed, 27 Sep 2023 13:58:34 +0200 Subject: [PATCH] Better keyboard switch script --- modules/hm/polybar.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/hm/polybar.nix b/modules/hm/polybar.nix index 8ab02ca..49a0999 100644 --- a/modules/hm/polybar.nix +++ b/modules/hm/polybar.nix @@ -21,7 +21,9 @@ let ''; keyboardStatus = pkgs.writeShellScript "keyboardStatus" '' PATH=$PATH:"${lib.makeBinPath [ pkgs.coreutils ]}" - if [[ `cat ~/.local/share/keyboard-switch.state` == "disabled" ]]; then echo 󰌐; else echo 󰌌; fi + STATE=~/.local/share/keyboard-switch.state + touch $STATE + if [[ `cat $STATE` == "disabled" ]]; then echo 󰌐; else echo 󰌌; fi ''; keyboardToggle = pkgs.writeShellScript "keyboardToggle" '' PATH=$PATH:"${lib.makeBinPath [ pkgs.keyboard-switch ]}"