{ pkgs, config, lib, ... }: let inherit (lib) mkIf mkEnableOption; cfg = config.home.programs.waybar; in { options = { home.programs.waybar.enable = mkEnableOption "Enables waybar"; }; config = mkIf cfg.enable { systemd.user.services.waybar = { Unit.StartLimitBurst = 30; }; programs.waybar = { enable = true; package = pkgs.waybar; systemd.enable = true; # style = ./style.css; settings = [ { height = 25; output = ["DP-3"]; modules-left = [ "group/system" ]; modules-center = [ "hyprland/workspaces" ]; modules-right = [ "custom/progress" "custom/systemd" # "custom/mail" "group/tray" "pulseaudio" "backlight" "battery" "clock" "custom/dunst" ]; "hyprland/workspaces" = { format = "{icon}"; format-icons = { "default" = ""; "active" = ""; "empty" = ""; "persistent" = ""; }; disable-scroll = true; rotate = 0; all-outputs = false; active-only = false; on-click = "activate"; persistent-workspaces = { "*" = 3; }; }; "group/tray" = { orientation = "inherit"; drawer = { transition-left-to-right = false; transistion-duration = 250; click-to-reveal = true; }; modules = [ "custom/trayicon" "tray" ]; }; "group/system" = { orientation = "inherit"; drawer = { transistion-left-to-right = true; transition-duration = 250; click-to-reveal = true; }; modules = [ "custom/logo" "cpu" "memory" "disk" "network" ]; }; "custom/trayicon" = { format = "󰅁"; tooltip = false; }; "custom/logo" = { format = " "; tooltip = false; }; "custom/mako" = { exec = "mako.sh"; on-click = "mako-toggle.sh"; restart-interval = 1; tooltip = false; }; "custom/progress" = { exec = "waybar-progress.sh"; return-type = "json"; interval = 1; }; "custom/systemd" = { exec = "waybar-systemd.sh"; return-type = "json"; interval = 10; }; "custom/dunst" = { exec = "dunst.sh"; on-click = "dunstctl set-paused toggle"; restart-interval = 1; tooltip = false; }; "custom/swaync" = { tooltip = false; format = "{} {icon} "; format-icons = { "notification" = "󰂚"; "none" = "󰂚"; "dnd-notification" = "󱏧"; "dnd-none" = "󱏧"; "inhibited-notification" = "󰂚"; "inhibited-none" = "󰂚"; "dnd-inhibited-notification" = "󱏧"; "dnd-inhibited-none" = "󱏧"; }; return-type = "json"; exec-if = "which swaync-client"; exec = "swaync-client -swb"; on-click = "sleep 0.1 && swaync-client -t -sw"; on-click-right = "swaync-client -d -sw"; escape = true; }; # "custom/mail" = { # format-icons = { # icon = ""; # }; # format = "{icon}{}"; # exec = "${app}/bin/waybar-mail"; # return-type = "json"; # }; # "custom/recording" = { # exec = "${app}/bin/waybar-recording"; # return-type = "json"; # signal = 3; # interval = "once"; # }; tray = { icon-size = 12; rotate = 0; spacing = 5; }; clock = { format = " {:%a, %d %b %H:%M}"; rotate = 0; on-click = "calcurse-toggle.sh"; on-click-right = "calsync.sh"; tooltip = false; }; cpu = { format = " {usage}%"; states = { warning = 70; critical = 90; }; }; disk = { format = " {percentage_free}%"; states = { warning = 70; critical = 90; }; }; memory = { format = " {}%"; states = { warning = 70; critical = 90; }; }; backlight = { format = "{icon} {percent}%"; format-icons = [""]; tooltip = false; }; battery = { states = { warning = 30; critical = 15; }; format = "{icon} {capacity}%"; format-charging = " {capacity}%"; format-icons = ["" "" "" "" ""]; }; network = { interval = 2; format-wifi = " {essid}"; format-ethernet = " {ifname}"; format-linked = " {ifname}"; format-disconnected = " "; tooltip-format = "{ifname}: {ipaddr}/{cidr}\n {bandwidthDownBits}\n {bandwidthUpBits}"; }; pulseaudio = { format = "{icon} {volume}% {format_source}"; on-scroll-up = "volume-control.sh --inc"; on-scroll-down = "volume-control.sh --dec"; format-bluetooth = "{icon} {volume}% {format_source}"; format-bluetooth-muted = " {icon} {format_source}"; format-muted = " {format_source}"; format-source = " {volume}%"; format-source-muted = ""; format-icons = { headphone = ""; hands-free = ""; headset = ""; phone = ""; portable = ""; car = ""; default = ["" "" ""]; }; on-click = lib.getExe pkgs.pavucontrol; on-click-middle = lib.getExe pkgs.helvum; }; } ]; }; }; }