From 262481ac2739d5bbee5ed005da39e4fc6149b42e Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Tue, 30 Jul 2024 16:51:41 -0400 Subject: [PATCH] hyprland: simplify and remove unused tablet options (#68) --- homeManagerModules/apps/waybar/default.nix | 2 +- .../desktop/hyprland/settings.nix | 2 +- homeManagerModules/options.nix | 20 +------------------ hosts/petalburg/home.nix | 2 +- 4 files changed, 4 insertions(+), 22 deletions(-) diff --git a/homeManagerModules/apps/waybar/default.nix b/homeManagerModules/apps/waybar/default.nix index a911c1f6..97270bc9 100644 --- a/homeManagerModules/apps/waybar/default.nix +++ b/homeManagerModules/apps/waybar/default.nix @@ -18,7 +18,7 @@ ["hyprland/workspaces" "hyprland/submap"] ++ lib.optionals (config.ar.home.desktop.sway.enable) ["sway/workspaces" "sway/scratchpad" "sway/mode"] - ++ lib.optionals (config.ar.home.desktop.hyprland.tabletMode.menuButton) + ++ lib.optionals (config.ar.home.desktop.hyprland.tabletMode.enable) ["custom/menu" "custom/hyprland-close"]; modules-center = ["clock"]; diff --git a/homeManagerModules/desktop/hyprland/settings.nix b/homeManagerModules/desktop/hyprland/settings.nix index 2cf65925..5921e167 100644 --- a/homeManagerModules/desktop/hyprland/settings.nix +++ b/homeManagerModules/desktop/hyprland/settings.nix @@ -75,7 +75,7 @@ in { ",xf86audioprev,exec,${helpers.media.prev}" ",xf86audionext,exec,${helpers.media.next}" ] - ++ builtins.map (switch: ",switch:${switch},exec,${scripts.tablet}") cfg.desktop.hyprland.tabletMode.tabletSwitches + ++ builtins.map (switch: ",switch:${switch},exec,${scripts.tablet}") cfg.desktop.hyprland.tabletMode.switches ++ lib.lists.optionals (cfg.desktop.hyprland.laptopMonitors != []) [ ",switch:on:Lid Switch,exec,${scripts.clamshell} on" diff --git a/homeManagerModules/options.nix b/homeManagerModules/options.nix index b0caa9c0..76d214b0 100644 --- a/homeManagerModules/options.nix +++ b/homeManagerModules/options.nix @@ -162,29 +162,11 @@ in { tabletMode = { enable = lib.mkEnableOption "Tablet mode for hyprland."; - autoRotate = lib.mkOption { - description = "Whether to autorotate screen."; - default = cfg.desktop.hyprland.tabletMode.enable; - type = lib.types.bool; - }; - - menuButton = lib.mkOption { - description = "Whether to add menu button for waybar."; - default = cfg.desktop.hyprland.tabletMode.enable; - type = lib.types.bool; - }; - - tabletSwitches = lib.mkOption { + switches = lib.mkOption { description = "Switches to activate tablet mode when toggled."; default = []; type = lib.types.listOf lib.types.str; }; - - virtKeyboard = lib.mkOption { - description = "Whether to enable dynamic virtual keyboard."; - default = cfg.desktop.hyprland.tabletMode.enable; - type = lib.types.bool; - }; }; }; diff --git a/hosts/petalburg/home.nix b/hosts/petalburg/home.nix index 2d10efee..dd969705 100644 --- a/hosts/petalburg/home.nix +++ b/hosts/petalburg/home.nix @@ -48,7 +48,7 @@ tabletMode = { enable = true; - tabletSwitches = ["Lenovo Yoga Tablet Mode Control switch"]; + switches = ["Lenovo Yoga Tablet Mode Control switch"]; }; }; }