mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-22 12:23:56 -05:00
hyprland: add tablet mode with virtkeyboard and menu/close waybar buttons
This commit is contained in:
parent
5f8fcbd29b
commit
2b5353c455
|
@ -85,6 +85,7 @@
|
||||||
#clock,
|
#clock,
|
||||||
#custom-menu,
|
#custom-menu,
|
||||||
#custom-sway-close,
|
#custom-sway-close,
|
||||||
|
#custom-hyprland-close,
|
||||||
#hardware {
|
#hardware {
|
||||||
border-radius: 10;
|
border-radius: 10;
|
||||||
background: rgba ${
|
background: rgba ${
|
||||||
|
@ -96,7 +97,7 @@
|
||||||
padding: 0px 10px 0px 10px;
|
padding: 0px 10px 0px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#clock, #custom-menu, #custom-sway-close {
|
#clock, #custom-menu, #custom-sway-close, #custom-hyprland-close {
|
||||||
padding: 0px 20px 0px 20px;
|
padding: 0px 20px 0px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,6 +166,10 @@
|
||||||
"on-click" = ''${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} kill'';
|
"on-click" = ''${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} kill'';
|
||||||
"format" = "";
|
"format" = "";
|
||||||
};
|
};
|
||||||
|
"custom/hyprland-close" = {
|
||||||
|
"on-click" = ''${lib.getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch killactive'';
|
||||||
|
"format" = "";
|
||||||
|
};
|
||||||
"river/window" = {
|
"river/window" = {
|
||||||
"max-length" = 100;
|
"max-length" = 100;
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
inputs,
|
inputs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = [./randomWallpaper.nix ./redShift.nix];
|
imports = [./randomWallpaper.nix ./redShift.nix ./virtKeyboard.nix];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
alyraffauf.desktop.hyprland.enable =
|
alyraffauf.desktop.hyprland.enable =
|
||||||
|
@ -26,6 +26,24 @@
|
||||||
default = true;
|
default = true;
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
};
|
};
|
||||||
|
alyraffauf.desktop.hyprland.tabletMode = {
|
||||||
|
enable = lib.mkEnableOption "Tablet mode for Hyprland.";
|
||||||
|
autoRotate = lib.mkOption {
|
||||||
|
description = "Whether to autorotate screen.";
|
||||||
|
default = config.alyraffauf.desktop.hyprland.tabletMode.enable;
|
||||||
|
type = lib.types.bool;
|
||||||
|
};
|
||||||
|
menuButton = lib.mkOption {
|
||||||
|
description = "Whether to add menu button for waybar.";
|
||||||
|
default = config.alyraffauf.desktop.hyprland.tabletMode.enable;
|
||||||
|
type = lib.types.bool;
|
||||||
|
};
|
||||||
|
virtKeyboard = lib.mkOption {
|
||||||
|
description = "Whether to enable dynamic virtual keyboard.";
|
||||||
|
default = config.alyraffauf.desktop.hyprland.tabletMode.enable;
|
||||||
|
type = lib.types.bool;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.alyraffauf.desktop.hyprland.enable {
|
config = lib.mkIf config.alyraffauf.desktop.hyprland.enable {
|
||||||
|
@ -57,9 +75,14 @@
|
||||||
extraPortals = [inputs.nixpkgsUnstable.legacyPackages."${pkgs.system}".xdg-desktop-portal-hyprland];
|
extraPortals = [inputs.nixpkgsUnstable.legacyPackages."${pkgs.system}".xdg-desktop-portal-hyprland];
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.waybar.settings = {
|
programs.waybar = {
|
||||||
mainBar = {
|
settings = {
|
||||||
modules-left = ["hyprland/workspaces" "hyprland/submap"];
|
mainBar = {
|
||||||
|
modules-left =
|
||||||
|
if config.alyraffauf.desktop.hyprland.tabletMode.menuButton
|
||||||
|
then ["hyprland/workspaces" "custom/menu" "custom/hyprland-close" "hyprland/submap"]
|
||||||
|
else ["hyprland/workspaces" "hyprland/submap"];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
16
homeManagerModules/desktop/hyprland/virtKeyboard.nix
Normal file
16
homeManagerModules/desktop/hyprland/virtKeyboard.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
config = lib.mkIf config.alyraffauf.desktop.hyprland.tabletMode.virtKeyboard {
|
||||||
|
home.packages = with pkgs; [squeekboard];
|
||||||
|
|
||||||
|
wayland.windowManager.hyprland.extraConfig = ''
|
||||||
|
exec-once = ${lib.getExe' pkgs.squeekboard "squeekboard"}
|
||||||
|
bindl=,switch:on:Lenovo Yoga Tablet Mode Control switch,exec,${lib.getExe pkgs.dconf} write /org/gnome/desktop/a11y/applications/screen-keyboard-enabled true
|
||||||
|
bindl=,switch:off:Lenovo Yoga Tablet Mode Control switch,exec,${lib.getExe pkgs.dconf} write /org/gnome/desktop/a11y/applications/screen-keyboard-enabled false
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue