{ config, pkgs, lib, ... }:
let
thm = config.lib.base16.theme;
in
with config.deviceSpecific; {
home-manager.users.${config.mainuser}.programs.waybar = {
enable = true;
# style = builtins.readFile ./style.css;
systemd.enable = true;
systemd.target = "hyprland-session.target";
settings = {
mainBar = {
layer = "top";
position = "top";
# margin = "8 8 0 8";
modules-left = [
"hyprland/workspaces"
# "wireplumber"
] ++ lib.optionals isLaptop [
"battery"
"backlight"
];
modules-center = [ "hyprland/window" ];
modules-right = [
"tray"
"disk"
"cpu"
# "temperature"
"memory"
"clock"
];
backlight = {
device = "intel_backlight";
format = "{percent}% {icon}";
format-icons = [ "" "" "" "" "" "" "" ];
# min-length = 7;
};
battery = {
interval = 60;
states = {
warning = 30;
critical = 15;
};
format = "{icon} {capacity}%";
format-charging = " {capacity}%";
format-icons = [
" "
" "
" "
" "
" "
];
on-update = "$HOME/.config/waybar/scripts/check_battery.sh";
};
clock = {
format = "{:%a, %d %b, %H:%M}";
tooltip-format = "{calendar}";
calendar = {
mode = "month";
mode-mon-col = 3;
weeks-pos = "right";
on-scroll = 1;
format = {
months = "{}";
days = "{}";
weeks = "W{}";
weekdays = "{}";
today = "{}";
};
};
actions = {
on-click-right = "mode";
on-click-middle = "shift_reset";
on-scroll-up = "shift_up";
on-scroll-down = "shift_down";
};
};
cpu = {
interval = 4;
format = " {usage}%";
};
disk = {
interval = 60;
format = " {free}";
path = "/home";
};
"hyprland/window" = {
max-length = 64;
};
"hyprland/workspaces" = {
format = "{icon}";
on-click = "activate";
disable-scroll = true;
format-icons = {
"10" = "0";
"Messengers" = "Msg";
"Music" = "Mus";
};
};
memory = {
format = " {used}GiB";
interval = 4;
};
temperature = {
# "hwmon-path" = "/sys/class/hwmon/hwmon0/temp1_input";
critical-threshold = 80;
format = "\uf4f5 {temperatureC}°C";
format-critical = " {temperatureC}°C";
interval = 4;
};
tray = {
icon-size = 12;
spacing = 6;
};
wireplumber = {
scroll-step = 5;
format = "{icon} {volume}%";
format-muted = "\ueee8 Muted";
format-bluetooth = "\uf282 {volume}%";
on-click-right = "blueman-manager";
format-icons = [ "\uf026 " "\uf027 " "\uf028 " ];
on-click = "pavucontrol";
};
};
};
style = let
accent = "lavender";
in ''
@import "catppuccin.css";
* {
font-family:
"${thm.fonts.mono.family}",
feather;
font-weight: 500;
font-size: 11pt;
color: @text;
}
/* main waybar */
window#waybar {
padding: 0;
margin: 0;
/* background: rgba(26, 27, 38, 0.7); */
background: @base;
}
/* when hovering over modules */
tooltip {
background: @base;
border-radius: 5%;
}
#workspaces button {
padding: 2px;
}
/* Sets active workspace to have a solid line on the bottom */
#workspaces button.active {
border-bottom: 2px solid @${accent};
border-radius: 0;
margin-top: 2px;
transition: all 0.5s ease-in-out;
}
/* More workspace stuff for highlighting on hover */
#workspaces button.focused {
color: @subtext0;
}
#workspaces button.urgent {
color: #f7768e;
}
#workspaces button:hover {
background: @crust;
color: @text;
}
/* Sets background, padding, margins, and borders for (all) modules */
#workspaces,
#clock,
#window,
#temperature,
#disk,
#cpu,
#memory,
#network,
#wireplumber,
#tray,
#backlight,
#battery {
/* background: rgba(26, 27, 38, 0); */
background: @base;
padding: 0 10px;
border: 0;
}
#workspaces {
padding-right: 0px;
}
/* Hide window module when not focused on window or empty workspace */
window#waybar.empty #window {
padding: 0;
margin: 0;
opacity: 0;
}
/* Set up rounding to make these modules look like separate pills */
#tray {
color: @${accent};
border-radius: 12px;
margin-right: 4px;
}
#window {
border-radius: 12px;
}
/* close right side of bar */
#temperature {
border-radius: 12px 0 0 12px;
}
/* close left side of bar */
#battery {
border-radius: 0 12px 12px 0;
}
'';
};
}