{ config, pkgs, ... }:
let
inherit (config.var.theme.bar) position;
inherit (config.var.theme) rounding border-size gaps-in gaps-out;
in {
home.packages = with pkgs; [ playerctl ];
programs.waybar = {
enable = true;
systemd = {
enable = true;
target = "hyprland-session";
};
settings = [{
layer = "top";
position = position;
modules-left = [
"idle_inhibitor"
"power-profile-daemon"
"backlight"
"pulseaudio"
"hyprland/workspaces"
"hyprland/window"
];
modules-center = [ "mpris" ];
modules-right = [
"battery#1"
"battery#2"
"cpu"
"memory"
"temperature"
"clock"
"privacy"
"tray"
];
clock = {
"format" = "{:%d %B %H:%M} ";
"format-alt" = "{:%A, %d %B %Y (%R)} ";
"tooltip-format" = "{calendar}";
"calendar" = {
"mode" = "year";
"mode-mon-col" = 3;
"weeks-pos" = "right";
"on-scroll" = 1;
"format" = {
"months" = "{}";
"days" = "{}";
"weeks" = "W{}";
"weekdays" = "{}";
"today" = "{}";
};
};
actions = {
"on-click-right" = "mode";
"on-scroll-up" = "shift_up";
"on-scroll-down" = "shift_down";
};
};
tray = { spacing = gaps-in; };
cpu = { format = " {usage}"; };
memory = { format = " {}"; };
idle_inhibitor = {
format = "{icon}";
format-icons = {
activated = "";
deactivated = "";
};
};
network = {
format = "{ifname}";
format-wifi = "{essid} ({signalStrength}%) ";
format-ethernet = "{ipaddr}/{cidr} ";
format-disconnected = "";
tooltip-format = "{ifname} via {gwaddr} ";
tooltip-format-wifi = "{essid} ({signalStrength}%) ";
tooltip-format-ethernet = "{ifname} ";
tooltip-format-disconnected = "Disconnected";
max-length = 50;
};
temperature = { format = "{temperatureC} "; };
backlight = {
device = "intel_backlight";
format = "{icon}";
format-icons = [ "" "" "" "" "" "" "" "" "" ];
};
"battery#1" = {
bat = "BAT0";
interval = 90;
states = {
warning = 30;
critical = 15;
};
format = "{capacity}";
max-length = 2;
};
"battery#2" = {
bat = "BAT1";
interval = 90;
states = {
warning = 30;
critical = 15;
};
format = "{capacity} {icon}";
format-icons = [ "" "" "" "" "" ];
max-length = 25;
};
"hyprland/window" = {
format = "{}";
rewrite = {
"(.*) — Mozilla Firefox" = " $1";
"(.*) - kitty" = " [$1]";
};
separate-outputs = true;
};
"hyprland/workspaces" = {
format = "{name}";
format-icons = {
"2" = "";
"3" = "";
"9" = "";
"active" = "";
"default" = "";
};
# "persistent-workspaces" = {
# "eDP-1" = [ 1 2 3 4 5 ];
# "DP-3" = [ 6 7 8 9 0 ];
# };
};
mpris = {
"format" = "{player_icon} {dynamic}";
"format-paused" = "{status_icon} {dynamic}";
"player-icons" = {
"default" = "";
"mpv" = "";
};
"dynamic-len" = 30;
"status-icons" = { "paused" = ""; };
"ignored-players" = [ "firefox" ];
};
privacy = {
"icon-spacing" = 4;
"icon-size" = 18;
"transition-duration" = 250;
"modules" = [
{
"type" = "screenshare";
"tooltip" = true;
"tooltip-icon-size" = 24;
}
{
"type" = "audio-out";
"tooltip" = true;
"tooltip-icon-size" = 24;
}
{
"type" = "audio-in";
"tooltip" = true;
"tooltip-icon-size" = 24;
}
];
};
pulseaudio = {
"format" = "{volume}%{icon}";
"format-bluetooth" = "{volume}%{icon}";
"format-muted" = "";
"format-icons" = {
"headphone" = "";
"phone" = "";
"portable" = "";
"car" = "";
"default" = [ "" "" ];
};
"scroll-step" = 1;
"on-click" = "pavucontrol";
"ignored-sinks" = [ "Easy Effects Sink" ];
};
"pulseaudio/slider" = {
"min" = 0;
"max" = 100;
"orientation" = "horizontal";
};
}];
style = ''
* { border: none; border-radius: 0; }
label.module { padding: 0 ${toString gaps-out}px; }
#workspaces button {
padding-top: ${toString border-size}px;
border-bottom: ${toString border-size}px solid transparent;
}
#workspaces button.focused,
#workspaces button.active {
border-bottom: ${toString border-size}px solid @base09;
}
label#battery.1 { padding-right: 0; }
label#battery.2 { padding-left: ${toString gaps-in}px; }
#privacy, #tray { padding: 0 ${toString gaps-in}px; }
#pulseaudio-slider slider {
min-height: 0px;
min-width: 0px;
opacity: 0;
background-image: none;
border: none;
box-shadow: none;
}
#pulseaudio-slider trough {
min-height: 5px;
min-width: 80px;
border-radius: ${toString rounding}px;
}
#pulseaudio-slider highlight {
min-width: 10px;
border-radius: ${toString rounding}px;
}
'';
};
}