69 lines
2.1 KiB
Nix
69 lines
2.1 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
cfg = config.ptw.programs.waybar;
|
|
in {
|
|
options.ptw.programs.waybar = {
|
|
enable = lib.mkEnableOption "Enable and configure waybar using HomeManager";
|
|
output = lib.mkOption {
|
|
type = lib.types.str;
|
|
example = "DP-2";
|
|
description = "The output waybar should appear on";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
home-manager.users."${config.ptw.system.singleUser}" = {
|
|
xdg.configFile."waybar/style.css".source = lib.mkForce ./style.css;
|
|
programs.waybar = {
|
|
enable = true;
|
|
style = builtins.readFile ./style.css;
|
|
settings = [
|
|
{
|
|
output = [ "${cfg.output}" ];
|
|
layer = "bottom";
|
|
position = "left";
|
|
gtk-layer-shell = true;
|
|
|
|
modules-left = [ "custom/applauncher" "sway/workspaces" "sway/mode" ];
|
|
modules-center = [ "clock" ];
|
|
modules-right = [ "tray" "idle_inhibitor" "pulseaudio" "custom/notifications" "custom/menu" ];
|
|
|
|
modules = {
|
|
"idle_inhibitor" = {
|
|
format = "{icon}";
|
|
format-icons = {
|
|
activated = "";
|
|
deactivated = "";
|
|
};
|
|
};
|
|
"sway/workspaces" = {
|
|
disable-scroll = true;
|
|
all-outputs = true;
|
|
};
|
|
"custom/applauncher" = {
|
|
format = " ";
|
|
on-click = "${pkgs.nwg-launchers}/bin/nwggrid -client";
|
|
tooltip = "false";
|
|
};
|
|
"custom/notifications" = {
|
|
format = " ";
|
|
on-click = "${pkgs.swaync}/bin/swaync-client --toggle-panel";
|
|
tooltip = "false";
|
|
};
|
|
"custom/menu" = {
|
|
format = " ";
|
|
on-click = "${pkgs.wlogout}/bin/wlogout";
|
|
tooltip = "false";
|
|
};
|
|
"pulseaudio" = {
|
|
#on-click = "${pkgs.myxer}/bin/myxer";
|
|
};
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|