waybar: add virtual keyboard toggle based on hyprland tablet script (#140)
Some checks are pending
git-mirror / gitlab-sync (push) Waiting to run
nix-build / adjustor-build (push) Waiting to run
nix-build / clean-install-build (push) Waiting to run
nix-build / hhd-ui-build (push) Waiting to run
nix-build / rofi-bluetooth-build (push) Waiting to run
nix-build / fallarbor-build (push) Waiting to run
nix-build / lavaridge-build (push) Waiting to run
nix-build / mauville-build (push) Waiting to run
nix-build / pacifidlog-build (push) Waiting to run
nix-build / rustboro-build (push) Waiting to run
nix-build / slateport-build (push) Waiting to run
nix-check / fmt-check (push) Waiting to run
nix-check / eval-check (push) Waiting to run

* waybar: add toggle-virtual-keyboard button based on hyprland tablet mode script

* waybar: add css stylings
This commit is contained in:
Aly Raffauf 2024-10-21 00:37:19 -04:00 committed by GitHub
parent 692eba7990
commit 9526ee34f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -105,6 +105,25 @@ in {
tooltip-format = "Close the focused window."; tooltip-format = "Close the focused window.";
}; };
"custom/virtual-keyboard" = let
toggle-virtual-keyboard = pkgs.writeShellScript "toggle-virtual-keyboard" ''
STATE=`${lib.getExe pkgs.dconf} read /org/gnome/desktop/a11y/applications/screen-keyboard-enabled`
if [ $STATE -z ] || [ $STATE == "false" ]; then
if ! [ `pgrep -f ${lib.getExe' pkgs.squeekboard "squeekboard"}` ]; then
${lib.getExe' pkgs.squeekboard "squeekboard"} &
fi
${lib.getExe pkgs.dconf} write /org/gnome/desktop/a11y/applications/screen-keyboard-enabled true
elif [ $STATE == "true" ]; then
${lib.getExe pkgs.dconf} write /org/gnome/desktop/a11y/applications/screen-keyboard-enabled false
fi
'';
in {
on-click = ''${toggle-virtual-keyboard}'';
format = "󰌌";
tooltip-format = "Toggle the virtual keyboard.";
};
clock = { clock = {
format = "{:%I:%M%p}"; format = "{:%I:%M%p}";
interval = 60; interval = 60;
@ -235,7 +254,9 @@ in {
modules = modules =
["custom/menu"] ["custom/menu"]
++ lib.optional (cfg.desktop.hyprland.tabletMode.enable) ++ lib.optional (cfg.desktop.hyprland.tabletMode.enable)
"custom/app-close"; "custom/app-close"
++ lib.optional (cfg.desktop.hyprland.tabletMode.enable)
"custom/virtual-keyboard";
orientation = "horizontal"; orientation = "horizontal";
}; };
@ -276,6 +297,7 @@ in {
#custom-app-close, #custom-app-close,
#custom-logout, #custom-logout,
#custom-menu, #custom-menu,
#custom-virtual-keyboard,
#idle_inhibitor, #idle_inhibitor,
#mode, #mode,
#network, #network,