diff --git a/homeManagerModules/desktop/sway/default.nix b/homeManagerModules/desktop/sway/default.nix index 652a1238..d4d037a3 100644 --- a/homeManagerModules/desktop/sway/default.nix +++ b/homeManagerModules/desktop/sway/default.nix @@ -5,24 +5,29 @@ osConfig, ... }: { - imports = [./autoRotate.nix ./randomWallpaper.nix]; + imports = [./autoRotate.nix ./randomWallpaper.nix ./virtKeyboard.nix]; options = { alyraffauf.desktop.sway.enable = lib.mkEnableOption "Sway with extra apps."; - alyraffauf.desktop.sway.autoSuspend = lib.mkOption { - description = "Whether to autosuspend on idle."; - default = true; - type = lib.types.bool; - }; alyraffauf.desktop.sway.autoRotate = lib.mkOption { description = "Whether to autorotate screen."; default = false; type = lib.types.bool; }; + alyraffauf.desktop.sway.autoSuspend = lib.mkOption { + description = "Whether to autosuspend on idle."; + default = true; + type = lib.types.bool; + }; alyraffauf.desktop.sway.randomWallpaper = lib.mkOption { description = "Whether to enable random wallpaper script."; default = true; type = lib.types.bool; }; + alyraffauf.desktop.sway.virtKeyboard = lib.mkOption { + description = "Whether to enable dynamic virtual keyboard for convertibles."; + default = false; + type = lib.types.bool; + }; }; config = lib.mkIf config.alyraffauf.desktop.sway.enable { diff --git a/homeManagerModules/desktop/sway/virtKeyboard.nix b/homeManagerModules/desktop/sway/virtKeyboard.nix new file mode 100644 index 00000000..df191989 --- /dev/null +++ b/homeManagerModules/desktop/sway/virtKeyboard.nix @@ -0,0 +1,18 @@ +{ + pkgs, + lib, + config, + ... +}: { + config = lib.mkIf config.alyraffauf.desktop.sway.virtKeyboard { + home.packages = with pkgs; [squeekboard]; + wayland.windowManager.sway.config.startup = [ + {command = "${lib.getExe' pkgs.squeekboard "squeekboard"}";} + ]; + + wayland.windowManager.sway.extraConfig = '' + bindswitch --reload --locked tablet:on exec ${lib.getExe pkgs.dconf} write /org/gnome/desktop/a11y/applications/screen-keyboard-enabled true + bindswitch --reload --locked tablet:off exec ${lib.getExe pkgs.dconf} write /org/gnome/desktop/a11y/applications/screen-keyboard-enabled false + ''; + }; +} diff --git a/hosts/petalburg/home.nix b/hosts/petalburg/home.nix index e66e732c..447c3604 100644 --- a/hosts/petalburg/home.nix +++ b/hosts/petalburg/home.nix @@ -7,6 +7,9 @@ }: { home-manager.users.aly = { imports = [../../homeManagerModules ../../aly.nix]; - alyraffauf.desktop.sway.autoRotate = true; + alyraffauf.desktop.sway = { + autoRotate = true; + virtKeyboard = true; + }; }; }