2024-07-19 12:00:55 +00:00
|
|
|
|
{
|
|
|
|
|
lib,
|
|
|
|
|
config,
|
|
|
|
|
pkgs,
|
|
|
|
|
...
|
|
|
|
|
}:
|
2024-07-19 01:34:42 +00:00
|
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
let
|
|
|
|
|
cfg = config.modules.waybar;
|
2024-07-19 01:51:40 +00:00
|
|
|
|
theme = config.theming;
|
|
|
|
|
colors = theme.colors;
|
2024-07-19 12:00:55 +00:00
|
|
|
|
in
|
|
|
|
|
{
|
2024-07-19 01:34:42 +00:00
|
|
|
|
options.modules.waybar = {
|
|
|
|
|
enable = mkEnableOption "waybar";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
|
pulsemixer
|
|
|
|
|
playerctl
|
2024-07-31 11:39:09 +00:00
|
|
|
|
wpa_supplicant_gui # TODO: Move
|
2024-07-19 01:34:42 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
programs.waybar = {
|
|
|
|
|
enable = true;
|
|
|
|
|
settings = {
|
|
|
|
|
mainBar = {
|
|
|
|
|
layer = "top";
|
|
|
|
|
spacing = 16;
|
2024-07-19 12:00:55 +00:00
|
|
|
|
modules-left = [ "river/tags" ];
|
2024-07-19 01:34:42 +00:00
|
|
|
|
modules-center = [
|
|
|
|
|
#"river/window"
|
|
|
|
|
"mpris"
|
|
|
|
|
];
|
|
|
|
|
modules-right = [
|
2024-07-31 11:39:09 +00:00
|
|
|
|
"network"
|
2024-07-19 01:34:42 +00:00
|
|
|
|
"pulseaudio"
|
|
|
|
|
"battery"
|
|
|
|
|
"clock"
|
|
|
|
|
];
|
|
|
|
|
"river/window" = {
|
|
|
|
|
max-length = 50;
|
|
|
|
|
};
|
|
|
|
|
"river/tags" = {
|
|
|
|
|
tag-labels = [
|
|
|
|
|
"一"
|
|
|
|
|
"二"
|
|
|
|
|
"三"
|
|
|
|
|
"四"
|
|
|
|
|
"五"
|
|
|
|
|
"六"
|
|
|
|
|
"七"
|
|
|
|
|
"八"
|
|
|
|
|
"九"
|
|
|
|
|
];
|
|
|
|
|
disable-click = false;
|
|
|
|
|
};
|
2024-07-31 11:39:09 +00:00
|
|
|
|
network = {
|
|
|
|
|
tooltip = false;
|
|
|
|
|
on-click = "wpa_gui";
|
|
|
|
|
format-wifi = "直 {essid}"; # Spacing achieved using "Thin Space"
|
|
|
|
|
format-ethernet = "TODO";
|
|
|
|
|
format-disconnected = "睊";
|
|
|
|
|
};
|
2024-07-19 01:34:42 +00:00
|
|
|
|
pulseaudio = {
|
|
|
|
|
tooltip = false;
|
|
|
|
|
format = "{icon} {volume}%"; # Spacing achieved using "Thin Space"
|
|
|
|
|
#format-muted = "";
|
|
|
|
|
format-muted = "{icon} --%"; # Spacing achieved using "Thin Space"
|
|
|
|
|
format-icons = {
|
|
|
|
|
#headphone = "";
|
|
|
|
|
#default = [ "" "" ];
|
|
|
|
|
headphone = "";
|
|
|
|
|
headphone-muted = "";
|
2024-07-19 12:00:55 +00:00
|
|
|
|
default = [
|
|
|
|
|
""
|
|
|
|
|
""
|
|
|
|
|
""
|
|
|
|
|
];
|
2024-07-19 01:34:42 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
battery = {
|
|
|
|
|
format = "{icon} {capacity}%"; # Spacing achieved using "Thin Space"
|
|
|
|
|
format-charging = " {capacity}%"; # Spacing achieved using "Thin Space"
|
|
|
|
|
#format-icons = [ "" "" "" "" "" "" "" "" "" "" "" ];
|
2024-07-19 12:00:55 +00:00
|
|
|
|
format-icons = [
|
|
|
|
|
""
|
|
|
|
|
""
|
|
|
|
|
""
|
|
|
|
|
""
|
|
|
|
|
""
|
|
|
|
|
""
|
|
|
|
|
""
|
|
|
|
|
""
|
|
|
|
|
""
|
|
|
|
|
""
|
|
|
|
|
""
|
|
|
|
|
];
|
2024-07-19 01:34:42 +00:00
|
|
|
|
interval = 1;
|
|
|
|
|
};
|
|
|
|
|
clock = {
|
|
|
|
|
#format = " {:%H:%M}";
|
|
|
|
|
#format = " {:%H:%M}"; # Spacing achieved using "Thin Space"
|
|
|
|
|
format = "{:%H:%M}";
|
|
|
|
|
};
|
|
|
|
|
mpris = {
|
|
|
|
|
format = "{dynamic}";
|
|
|
|
|
tooltip-format = "";
|
|
|
|
|
interval = 1;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-07-19 01:51:40 +00:00
|
|
|
|
# TODO: Replace base03 color with named color
|
2024-07-19 01:34:42 +00:00
|
|
|
|
style = ''
|
|
|
|
|
window#waybar {
|
2024-07-19 01:51:40 +00:00
|
|
|
|
color: #${colors.fg};
|
|
|
|
|
background-color: #${colors.bg};
|
2024-07-19 01:34:42 +00:00
|
|
|
|
border-style: none none solid none;
|
2024-07-19 01:51:40 +00:00
|
|
|
|
border-width: ${toString theme.layout.borderSize}px;
|
2024-07-19 19:54:41 +00:00
|
|
|
|
border-color: #${colors.border-unfocused};
|
2024-07-19 01:34:42 +00:00
|
|
|
|
font-size: 12px;
|
2024-07-19 01:51:40 +00:00
|
|
|
|
font-family: "${theme.fonts.monospace.name}";
|
2024-07-19 01:34:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.modules-right {
|
|
|
|
|
margin: 0 8px 0 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#tags button {
|
2024-07-19 01:51:40 +00:00
|
|
|
|
color: #${theme.schemeColors.base03};
|
2024-07-19 01:34:42 +00:00
|
|
|
|
padding: 0 5px 1px 5px;
|
|
|
|
|
border-radius: 0;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-family: "Unifont";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#tags button.occupied {
|
2024-07-19 01:51:40 +00:00
|
|
|
|
color: #${colors.fg};
|
2024-07-19 01:34:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#tags button.focused {
|
2024-07-19 01:51:40 +00:00
|
|
|
|
color: #${colors.accent};
|
2024-07-19 01:34:42 +00:00
|
|
|
|
}
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-07-19 12:00:55 +00:00
|
|
|
|
}
|