1
1
Fork 0
nixos/options/custom/desktops/hyprland/plugins.nix
Myned 6cde225c08
hyprland: use uwsm to isolate exec scope
Signed-off-by: Myned <dev@bjork.tech>
2025-02-15 15:59:54 -06:00

82 lines
2.7 KiB
Nix

{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.custom.desktops.hyprland.plugins;
hyprctl = getExe' config.programs.hyprland.package "hyprctl";
uwsm = getExe pkgs.uwsm;
command = command: "${uwsm} app -- ${command}";
in {
options.custom.desktops.hyprland.plugins = {
enable = mkOption {default = false;};
hyprbars = mkOption {default = true;};
hyprscroller = mkOption {default = true;};
};
config = mkIf cfg.enable {
home-manager.sharedModules = [
{
wayland.windowManager.hyprland = {
# https://wiki.hyprland.org/Plugins/Using-Plugins
plugins = with pkgs.hyprlandPlugins;
optionals cfg.hyprbars [
# https://github.com/hyprwm/hyprland-plugins/tree/main/hyprbars
hyprbars
]
++ optionals cfg.hyprscroller [
# https://github.com/dawsers/hyprscroller
hyprscroller
];
settings.plugin = {
# https://github.com/hyprwm/hyprland-plugins/tree/main/hyprbars#config
hyprbars = mkIf cfg.hyprbars {
bar_button_padding = 10;
bar_color = "rgb(002b36)";
bar_height = 30;
bar_padding = 10;
bar_precedence_over_border = true; # Render borders around hyprbars
bar_text_align = "left";
bar_text_font = config.custom.settings.fonts.monospace;
bar_text_size = 11;
#// bar_title_enabled = false;
"col.text" = "rgb(93a1a1)";
# https://github.com/hyprwm/hyprland-plugins/tree/main/hyprbars#buttons-config
#?? hyprbars-button = COLOR, SIZE, ICON, EXEC
hyprbars-button = [
"rgb(dc322f), 16,, ${command "${hyprctl} dispatch killactive"}" # Close
"rgb(d33682), 16,, ${command "${hyprctl} dispatch fullscreen 1"}" # Maximize
"rgb(6c71c4), 16,, ${command minimize}" # Minimize
];
};
# https://github.com/dawsers/hyprscroller?tab=readme-ov-file#options
scroller = mkIf cfg.hyprscroller {
"col.selection_border" = "rgb(d33682)";
center_row_if_space_available = true;
column_default_width =
if config.custom.ultrawide
then "threeeighths"
else "onethird";
column_widths =
if config.custom.ultrawide
then "onefourth threeeighths onehalf fiveeighths threequarters one"
else "onethird onehalf twothirds one";
cyclesize_wrap = false;
focus_wrap = false;
};
};
};
}
];
};
}