sway: remove tablet mode

This commit is contained in:
Aly Raffauf 2024-06-04 14:33:27 -04:00
parent 321641391e
commit bd1b97a191
3 changed files with 3 additions and 58 deletions

View file

@ -1,13 +0,0 @@
{
pkgs,
lib,
config,
...
}: {
config = lib.mkIf config.alyraffauf.desktop.sway.tabletMode.autoRotate {
home.packages = with pkgs; [rot8];
wayland.windowManager.sway.config.startup = [
{command = "${lib.getExe pkgs.rot8}";}
];
};
}

View file

@ -5,7 +5,7 @@
inputs, inputs,
... ...
}: { }: {
imports = [./autoRotate.nix ./randomWallpaper.nix ./redShift.nix ./virtKeyboard.nix]; imports = [./randomWallpaper.nix ./redShift.nix];
options = { options = {
alyraffauf.desktop.sway = { alyraffauf.desktop.sway = {
@ -26,24 +26,6 @@
default = config.alyraffauf.desktop.sway.enable; default = config.alyraffauf.desktop.sway.enable;
type = lib.types.bool; type = lib.types.bool;
}; };
tabletMode = {
enable = lib.mkEnableOption "Tablet mode for sway.";
autoRotate = lib.mkOption {
description = "Whether to autorotate screen.";
default = config.alyraffauf.desktop.sway.tabletMode.enable;
type = lib.types.bool;
};
menuButton = lib.mkOption {
description = "Whether to add menu button for waybar.";
default = config.alyraffauf.desktop.sway.tabletMode.enable;
type = lib.types.bool;
};
virtKeyboard = lib.mkOption {
description = "Whether to enable dynamic virtual keyboard.";
default = config.alyraffauf.desktop.sway.tabletMode.enable;
type = lib.types.bool;
};
};
}; };
}; };
@ -57,19 +39,13 @@
programs.waybar = { programs.waybar = {
settings = { settings = {
mainBar = { mainBar = {
modules-left = modules-left = ["sway/workspaces" "sway/scratchpad" "sway/mode"];
if config.alyraffauf.desktop.sway.tabletMode.menuButton
then ["custom/menu" "custom/sway-close" "sway/workspaces" "sway/scratchpad" "sway/mode"]
else ["sway/workspaces" "sway/scratchpad" "sway/mode"];
}; };
}; };
}; };
wayland.windowManager.sway.enable = true; wayland.windowManager.sway.enable = true;
wayland.windowManager.sway.package = wayland.windowManager.sway.package = pkgs.swayfx;
if config.alyraffauf.desktop.sway.tabletMode.enable
then pkgs.sway
else pkgs.swayfx;
wayland.windowManager.sway.wrapperFeatures.gtk = true; wayland.windowManager.sway.wrapperFeatures.gtk = true;
wayland.windowManager.sway.checkConfig = false; wayland.windowManager.sway.checkConfig = false;

View file

@ -1,18 +0,0 @@
{
pkgs,
lib,
config,
...
}: {
config = lib.mkIf config.alyraffauf.desktop.sway.tabletMode.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
'';
};
}