mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-22 06:33:56 -05:00
sway: add virtual keyboard support for tablets
This commit is contained in:
parent
d0e9385946
commit
59b758355c
|
@ -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 {
|
||||
|
|
18
homeManagerModules/desktop/sway/virtKeyboard.nix
Normal file
18
homeManagerModules/desktop/sway/virtKeyboard.nix
Normal file
|
@ -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
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -7,6 +7,9 @@
|
|||
}: {
|
||||
home-manager.users.aly = {
|
||||
imports = [../../homeManagerModules ../../aly.nix];
|
||||
alyraffauf.desktop.sway.autoRotate = true;
|
||||
alyraffauf.desktop.sway = {
|
||||
autoRotate = true;
|
||||
virtKeyboard = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue