{ config, lib, pkgs, ... }: let cfg = config.ptw.programs.waybar; in { options.ptw.programs.waybar = { enable = lib.mkEnableOption "Enable and configure waybar using HomeManager"; }; config = lib.mkIf cfg.enable { home-manager.users."${config.ptw.system.singleUser}" = { xdg.configFile."waybar/style.css".source = ./style.css; programs.waybar = { enable = true; style = builtins.readFile ./style.css; settings = [ { output = [ "DP-2" ]; 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.stable.myxer}/bin/myxer"; }; }; } ]; }; }; }; }