{ config, pkgs, accentColour ? "base07", ... }: { systemd.user.targets.tray.Unit = { Description = "Home Manager System Tray"; Requires = ["graphical-session-pre.target"]; }; programs.waybar = { enable = true; systemd = { enable = true; target = "hyprland-session.target"; }; settings.main = { layer = "top"; position = "top"; # Layout "modules-left" = ["hyprland/window" "mpris"]; "modules-center" = ["hyprland/workspaces"]; "modules-right" = [ "custom/notification" "pulseaudio" "network" "bluetooth" "clock#calendar" "clock" "backlight" "battery" "custom/weather" "tray" ]; # Module config "hyprland/window" = { "format" = "{title}"; "rewrite" = { "(Alacritty.*)" = " $1"; "(btm)" = "Resource Usage [$1]"; "(cava)" = "Music Visualiser [$1]"; }; "separate-outputs" = true; }; "hyprland/workspaces" = { format = "{icon}"; format-icons = { default = " "; active = " "; }; show-special = false; persistent-workspaces = { "1" = []; "2" = []; "3" = []; "4" = []; "5" = []; "6" = []; "7" = []; "8" = []; "9" = []; }; }; mpris = { "format" = " {player}"; "tooltip-format" = "{player_icon} ({player}) {dynamic}"; "interval" = 1; "dynamic-order" = ["album" "artist" "title" "position" "length"]; "status-icons" = { "playing" = " "; "paused" = " "; "stopped" = " "; }; "ignored-players" = []; }; pulseaudio = { scroll-step = 5; format = "{format_source} {icon} {volume}%"; format-muted = "{format_source}  "; format-source = " "; format-source-muted = " "; format-icons = { car = " "; default = [" " " " " "]; hands-free = " "; headset = " "; phone = " "; portable = " "; headphone = " "; }; on-click = "${pkgs.pavucontrol}/bin/pavucontrol"; on-click-right = "${pkgs.pamixer}/bin/pamixer -t"; on-scroll-up = "${pkgs.pamixer}/bin/pamixer -i 5"; on-scroll-down = "${pkgs.pamixer}/bin/pamixer -d 5"; }; network = { format-wifi = " "; format-ethernet = " "; tooltip-format = "{essid} ({signalStrength}%)"; }; bluetooth = { format = " "; tooltip-format = "{status} | {device_alias}"; on-click = "${pkgs.bluez}/bin/bluetoothctl power on"; on-click-right = "${pkgs.bluez}/bin/bluetoothctl power off"; }; "clock#calendar" = { format = "{: %Y-%m-%d}"; tooltip-format = "{calendar}"; calendar = { mode = "month"; mode-mon-col = 3; weeks-pos = "left"; on-scroll = 1; on-click-right = "mode"; format = { months = "{}"; days = "{}"; weeks = "W{}"; weekdays = "{}"; today = "{}"; }; }; actions = { on-click-right = "mode"; on-scroll-up = "shift_up"; on-scroll-down = "shift_down"; }; }; clock = {format = "{: %R}";}; backlight = { format = "{icon}"; tooltip-format = "{percent}%"; format-icons = [" " " " " " " " " " " " " " " " " "]; }; battery = { states = { warning = 30; critical = 20; }; format = "{icon}"; format-charging = " "; format-plugged = " "; tooltip-format = "{capacity}% {time}"; format-icons = [" " " " " " " " " "]; }; "custom/notification" = let swaync = pkgs.swaynotificationcenter; in { "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}/bin/swaync-client"; "exec" = "${swaync}/bin/swaync-client -swb"; "on-click" = "${swaync}/bin/swaync-client -t -sw"; "on-click-right" = "${swaync}/bin/swaync-client -d -sw"; "escape" = true; }; "custom/weather" = { "format" = "{}°"; "tooltip" = true; "interval" = 900; # Every 15 minutes "exec" = "${pkgs.wttrbar}/bin/wttrbar --location Didcot --hide-conditions"; "return-type" = "json"; }; tray = { icon-size = config.stylix.fonts.sizes.desktop; show-passive-items = true; spacing = 5; }; }; style = with config.stylix; with config.lib.stylix.colors.withHashtag; let accent = config.lib.stylix.colors.withHashtag.${accentColour}; in '' * { all: unset; font-size: ${toString fonts.sizes.desktop}px; font-family: "${fonts.monospace.name}"; } window { background: transparent; } window > box { color: ${base05}; background: alpha(${base00}, 0.5); margin: 10px 10px 0px; padding: 0px; border: 1px solid ${accent}; border-radius: 10px; } tooltip { color: ${base05}; /* Temp set alpha to 1.0 until I can sort out blurls issue */ background: alpha(${base00}, 1); border: 1px solid ${accent}; border-radius: 10px; padding: 5px; margin: 0px; } #workspaces, #window, #mpris, #pulseaudio, #network, #bluetooth, #backlight, #battery, #clock, #custom-notification, #custom-weather, #tray { margin: 0px; padding: 1px 5px; } #workspaces, #window, #mpris, #tray, #backlight, #battery, #custom-weather { color: ${base05}; } #workspaces button { background: transparent; color: ${base05}; margin: 0px; padding: 0px 5px; } #workspaces button.empty { color: ${base03}; } #workspaces button.active { color: ${accent}; } #workspaces button.urgent { color: ${base09}; } #custom-notification { color: ${base08}; } #pulseaudio { color: ${base09}; } #network { color: ${base0A}; } #bluetooth { color: ${base0B}; } #clock.calendar { color: ${base0C}; } #clock { color: ${base0D}; } ''; }; }