This repository has been archived on 2026-03-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
nixos/home/hyprland/waybar/default.nix
Torjus Håkestad a69e129c77 waybar: use catppuccin module, add GTK theme
Switch waybar from manual fetchFromGitHub theme to catppuccin/nix module.
Add catppuccin macchiato GTK theme to fix unreadable tray context menus.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 23:54:03 +01:00

255 lines
6.2 KiB
Nix

{
pkgs,
lib,
osConfig,
...
}:
let
arrhist = pkgs.stdenv.mkDerivation {
name = "arrhist";
propagatedBuildInputs = [
(pkgs.python3.withPackages (pythonPackages: with pythonPackages; [ requests ]))
];
src = ./arrhist.py;
dontUnpack = true;
installPhase = "install -Dm755 ${./arrhist.py} $out/bin/arrhist";
};
cfg = osConfig.host.capabilities;
withArrhist = cfg.enableArrhist;
withBattery = cfg.hasBattery;
in
{
sops.secrets."sonarr_base_url" = { };
sops.secrets."sonarr_api_key" = { };
sops.secrets."radarr_base_url" = { };
sops.secrets."radarr_api_key" = { };
catppuccin.waybar = {
enable = true;
flavor = "macchiato";
};
programs.waybar = {
enable = true;
systemd = {
enable = true; # disable it,autostart it in hyprland conf
target = "graphical-session.target";
};
style = ''
* {
border: none;
font-family: "JetbrainsMono Nerd Font";
font-size: 15px;
transition-property: background-color;
transition-duration: 0.5s;
color: @text;
border-radius: 10px;
min-height: 10px;
}
window#waybar {
background-color: @surface2;
border-radius: 0px;
}
window#waybar.hidden {
opacity: 0.2;
}
#window {
margin-top: 6px;
padding-left: 10px;
padding-right: 10px;
border-radius: 0px;
transition: none;
color: transparent;
background-color: @surface2;
}
@keyframes blink_red {
to {
background-color: @red;
}
}
.warning,
.critical,
.urgent {
animation-name: blink_red;
animation-duration: 1s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#workspaces {
padding-left: 12px;
padding-right: 12px;
background-color: @base;
}
#workspaces button {
padding-left: 12px;
padding-right: 12px;
}
#workspaces button.active {
background-color: @surface2;
}
#workspaces button.urgent {
color: alpha(@red, 0.4);
}
#workspaces button:hover {
background-color: @surface2;
}
tooltip {
background-color: @base;
}
tooltip label {
color: @text;
}
#custom-launcher {
font-size: 15px;
padding-left: 5px;
padding-right: 12px;
background-color: @base;
}
.modules-right {
background-color: @base;
border-radius: 10px 0px 0px 10px;
}
.modules-left {
background-color: @base;
border-radius: 0px 10px 10px 0px;
}
#mode,
#clock,
#memory,
#temperature,
#cpu,
#mpd,
#custom-wall,
#temperature,
#backlight,
#pulseaudio,
#network,
#battery,
#disk,
#custom-powermenu,
#custom-arrhist {
padding-left: 12px;
padding-right: 12px;
}
#battery.charging,
#battery.full,
#battery.discharging {
color: @maroon;
}
#battery.critical:not(.charging) {
color: @red;
}
'';
settings = [
(
let
volInterval = toString cfg.volumeScrollStep;
in
{
"layer" = "top";
"position" = "top";
modules-center = [ "hyprland/workspaces" ];
modules-right = [
(lib.mkIf (withArrhist) "custom/arrhist")
"pulseaudio"
"pulseaudio#microphone"
"disk"
"memory"
"cpu"
(lib.mkIf (withBattery) "battery")
"clock"
"tray"
];
"hyprland/workspaces" = {
"format" = "{name}";
"on-click" = "activate";
"on-scroll-up" = "hyprctl dispatch workspace e+1";
"on-scroll-down" = "hyprctl dispatch workspace e-1";
};
"pulseaudio" = {
"scroll-step" = 5;
"format" = "{icon} {volume}%";
"format-muted" = "";
"format-icons" = {
"default" = [
""
""
""
];
};
"on-scroll-up" = "pamixer -i ${volInterval}";
"on-scroll-down" = "pamixer -d ${volInterval}";
"on-click" = "pamixer -t";
};
"pulseaudio#microphone" = {
"format" = "{format_source}";
"format-source" = " {volume}%";
"format-source-muted" = "";
"on-click" = "pamixer --default-source -t";
"on-scroll-up" = "pamixer --default-source -i ${volInterval}";
"on-scroll-down" = "pamixer --default-source -d ${volInterval}";
"scroll-step" = 5;
"on-click-right" = "pavucontrol";
};
"clock" = {
"interval" = 1;
"format" = "{:%H:%M %A %b %d}";
"tooltip" = true;
};
"memory" = {
"interval" = 3;
"format" = " {percentage}%";
"states" = {
"warning" = 85;
};
};
"cpu" = {
"interval" = 3;
"format" = " {usage}%";
};
"disk" = {
"interval" = 30;
"format" = "󰋊 {percentage_used}%";
"path" = "/";
"tooltip-format" = "{used} / {total}";
"states" = {
"warning" = 85;
};
};
"tray" = {
"icon-size" = 15;
"spacing" = 6;
};
"battery" = {
"interval" = 60;
"states" = {
"warning" = 20;
"critical" = 5;
};
"format" = "{icon} {capacity}%";
"format-icons" = [
""
""
""
""
""
];
};
}
// lib.optionalAttrs (withArrhist) {
"custom/arrhist" = {
"exec" = "${arrhist}/bin/arrhist";
"return-type" = "json";
"interval" = 600;
};
}
)
];
};
}