mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-22 06:33:56 -05:00
waybar/sway: added tablet mode toggle for virtkeyboard, autorotate, and waybar menu button
This commit is contained in:
parent
59b758355c
commit
3a2e9b70ce
|
@ -64,6 +64,7 @@
|
|||
#wireplumber,
|
||||
#inhibitor,
|
||||
#custom-logout,
|
||||
#custom-menu,
|
||||
#tray {
|
||||
padding: 0 7.5px;
|
||||
margin: 0 5px;
|
||||
|
@ -87,6 +88,7 @@
|
|||
#scratchpad,
|
||||
#tray,
|
||||
#clock,
|
||||
#custom-menu,
|
||||
#hardware {
|
||||
border-radius: 10;
|
||||
background: rgba ${
|
||||
|
@ -98,7 +100,7 @@
|
|||
padding: 0px 10px 0px 10px;
|
||||
}
|
||||
|
||||
#clock {
|
||||
#clock, #custom-menu {
|
||||
padding: 0px 20px 0px 20px;
|
||||
}
|
||||
|
||||
|
@ -232,6 +234,10 @@
|
|||
"on-click" = "${lib.getExe pkgs.wlogout}";
|
||||
"format" = "";
|
||||
};
|
||||
"custom/menu" = {
|
||||
"on-click" = "${lib.getExe pkgs.nwg-drawer} -mt 5";
|
||||
"format" = "";
|
||||
};
|
||||
"power-profiles-daemon" = {
|
||||
"format" = "{icon}";
|
||||
"tooltip-format" = ''
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
config,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf config.alyraffauf.desktop.sway.autoRotate {
|
||||
config = lib.mkIf config.alyraffauf.desktop.sway.tabletMode.autoRotate {
|
||||
home.packages = with pkgs; [rot8];
|
||||
wayland.windowManager.sway.config.startup = [
|
||||
{command = "${lib.getExe pkgs.rot8}";}
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
imports = [./autoRotate.nix ./randomWallpaper.nix ./virtKeyboard.nix];
|
||||
options = {
|
||||
alyraffauf.desktop.sway.enable = lib.mkEnableOption "Sway with extra apps.";
|
||||
alyraffauf.desktop.sway.autoRotate = lib.mkOption {
|
||||
description = "Whether to autorotate screen.";
|
||||
default = false;
|
||||
alyraffauf.desktop.sway.randomWallpaper = lib.mkOption {
|
||||
description = "Whether to enable random wallpaper script.";
|
||||
default = true;
|
||||
type = lib.types.bool;
|
||||
};
|
||||
alyraffauf.desktop.sway.autoSuspend = lib.mkOption {
|
||||
|
@ -18,15 +18,23 @@
|
|||
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;
|
||||
alyraffauf.desktop.sway.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;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -54,7 +62,10 @@
|
|||
programs.waybar = {
|
||||
settings = {
|
||||
mainBar = {
|
||||
modules-left = ["sway/workspaces" "sway/scratchpad" "sway/mode"];
|
||||
modules-left =
|
||||
if config.alyraffauf.desktop.sway.tabletMode.menuButton
|
||||
then ["custom/menu" "sway/workspaces" "sway/scratchpad" "sway/mode"]
|
||||
else ["sway/workspaces" "sway/scratchpad" "sway/mode"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
config,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf config.alyraffauf.desktop.sway.virtKeyboard {
|
||||
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"}";}
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
home-manager.users.aly = {
|
||||
imports = [../../homeManagerModules ../../aly.nix];
|
||||
alyraffauf.desktop.sway = {
|
||||
autoRotate = true;
|
||||
virtKeyboard = true;
|
||||
tabletMode.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue