2024-10-05 12:10:18 +02:00
|
|
|
{ pkgs, lib, config, machineVars, ... }: let
|
2022-08-19 03:49:21 +02:00
|
|
|
colors = config.colors.defaultColorSet;
|
|
|
|
in {
|
|
|
|
services.polybar = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
script = ''
|
|
|
|
polybar top &
|
|
|
|
'';
|
|
|
|
|
|
|
|
package = pkgs.polybar.override {
|
|
|
|
githubSupport = true;
|
|
|
|
mpdSupport = true;
|
2024-10-05 12:10:18 +02:00
|
|
|
pulseSupport = true;
|
2022-08-19 03:49:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
settings = {
|
2024-10-05 12:10:18 +02:00
|
|
|
"module/tray" = {
|
|
|
|
type = "internal/tray";
|
|
|
|
|
|
|
|
# padding = 4;
|
|
|
|
tray-spacing = "8px";
|
|
|
|
tray-maxsize = "25px";
|
|
|
|
# tray-background = colors.background;
|
|
|
|
};
|
|
|
|
|
2022-08-19 03:49:21 +02:00
|
|
|
"bar/top" = {
|
|
|
|
bottom = false;
|
|
|
|
# monitor =
|
2024-10-05 12:10:18 +02:00
|
|
|
# tray.position = "right";
|
2022-08-19 03:49:21 +02:00
|
|
|
|
|
|
|
background = colors.background;
|
|
|
|
foreground = colors.foreground;
|
|
|
|
|
|
|
|
padding = {
|
|
|
|
left = 2;
|
|
|
|
right = 2;
|
|
|
|
};
|
|
|
|
width = "100%";
|
|
|
|
height = 40;
|
|
|
|
|
|
|
|
fixed-center = true;
|
|
|
|
|
|
|
|
font = map (f: f + ":pixelsize=12:antialias=true:hinting=true") [
|
|
|
|
"Fira Code Retina"
|
|
|
|
"Noto Sans CJK JP"
|
|
|
|
"FiraCode Nerd Font"
|
|
|
|
];
|
|
|
|
|
|
|
|
modules = {
|
|
|
|
left = "xmonad";
|
|
|
|
center = "date";
|
|
|
|
right = builtins.concatStringsSep " " [
|
2024-10-05 12:10:18 +02:00
|
|
|
"filesystem"
|
|
|
|
(lib.optionalString (machineVars.wlanInterface != null) "wlan")
|
|
|
|
(lib.optionalString (machineVars.battery != null) "batt")
|
|
|
|
"pulseaudio"
|
2022-08-19 03:49:21 +02:00
|
|
|
"mpd"
|
2024-10-05 12:10:18 +02:00
|
|
|
"tray"
|
2022-08-19 03:49:21 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-10-05 12:10:18 +02:00
|
|
|
# tray = {
|
|
|
|
# padding = 4;
|
|
|
|
# maxsize = 25;
|
|
|
|
# background = colors.background;
|
|
|
|
# };
|
2022-08-19 03:49:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
"module/xmonad" = {
|
|
|
|
type = "custom/script";
|
|
|
|
exec = "${pkgs.xmonad-log}/bin/xmonad-log";
|
|
|
|
tail = "true";
|
|
|
|
};
|
|
|
|
|
|
|
|
"module/date" = {
|
|
|
|
type = "internal/date";
|
|
|
|
interval = 1.0;
|
|
|
|
|
|
|
|
format-padding = 1;
|
|
|
|
|
|
|
|
label = "%date% | %time%";
|
|
|
|
label-padding = 1;
|
|
|
|
|
2023-03-07 23:01:41 +01:00
|
|
|
date = "W%W | %Y.%m.%d | %A";
|
2022-08-19 03:49:21 +02:00
|
|
|
time = "%R";
|
|
|
|
};
|
|
|
|
|
|
|
|
"module/wlan" = {
|
|
|
|
type = "internal/network";
|
|
|
|
interval = 1.0;
|
|
|
|
unknown-as-up = true;
|
|
|
|
# Wireless interfaces often start with `wl` and ethernet interface with `eno` or `eth`. Check " ifconfig/iwconfig "
|
|
|
|
interface = pkgs.lib.mkIf (machineVars.wlanInterface != null) machineVars.wlanInterface;
|
|
|
|
|
|
|
|
format = {
|
|
|
|
connected = "<label-connected>";
|
|
|
|
connected-padding = 1;
|
|
|
|
# connected-suffix = "%{A1:networkmanager_dmenu &:}%{A}"
|
|
|
|
# connected-suffix-padding = 1
|
|
|
|
# connected-suffix-foreground = ${colors.fg-alt}
|
|
|
|
# connected-suffix-background = ${colors.accent}
|
|
|
|
|
|
|
|
disconnected = "<label-disconnected>";
|
|
|
|
disconnected-padding = 1;
|
|
|
|
# disconnected-suffix = "%{A1:networkmanager_dmenu &:}%{A}"
|
|
|
|
# disconnected-suffix-padding = 1
|
|
|
|
# disconnected-suffix-foreground = ${colors.fg-alt}
|
|
|
|
# disconnected-suffix-background = ${colors.accent}
|
|
|
|
|
|
|
|
label = {
|
|
|
|
connected = "%essid%";
|
|
|
|
connected-padding = 1;
|
|
|
|
# connected-background = ${colors.fg-alt}
|
|
|
|
|
|
|
|
disconnected = "OFF";
|
|
|
|
disconnected-padding = 1;
|
|
|
|
# disconnected-background = ${colors.fg-alt}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
"module/batt" = {
|
|
|
|
type = "internal/battery";
|
|
|
|
full-at = 99;
|
|
|
|
|
|
|
|
battery = pkgs.lib.mkIf (machineVars.battery != null) machineVars.battery;
|
|
|
|
adapter = "AC";
|
|
|
|
|
|
|
|
poll.interval = 5;
|
|
|
|
|
|
|
|
# format-charging = "<label-charging>"
|
|
|
|
format.charging.padding = 1;
|
|
|
|
|
|
|
|
# format-charging-suffix = "%{A1:xfce4-power-manager-settings &:}%{A}"
|
|
|
|
# format-charging-suffix-padding = 1
|
|
|
|
# format-charging-suffix-foreground = ${colors.fg-alt}
|
|
|
|
# format-charging-suffix-background = ${colors.accent}
|
|
|
|
#
|
|
|
|
# format-discharging = "<label-discharging>"
|
|
|
|
# format-discharging-padding = 1
|
|
|
|
#
|
|
|
|
# format-discharging-suffix = "%{A1:xfce4-power-manager-settings &:}%{A}"
|
|
|
|
# format-discharging-suffix-padding = 1
|
|
|
|
# format-discharging-suffix-foreground = ${colors.fg-alt}
|
|
|
|
# format-discharging-suffix-background = ${colors.accent}
|
|
|
|
#
|
|
|
|
|
|
|
|
label-charging = "%percentage%%";
|
|
|
|
label-discharging = "%percentage%%";
|
|
|
|
label-full = "FULL";
|
|
|
|
label = {
|
|
|
|
charging = {
|
|
|
|
padding = 1;
|
|
|
|
foreground = colors.green;
|
|
|
|
# background = ${colors.fg-alt}
|
|
|
|
};
|
|
|
|
discharging = {
|
|
|
|
padding = 1;
|
|
|
|
foreground = colors.yellow;
|
|
|
|
};
|
|
|
|
full = {
|
|
|
|
padding = 1;
|
|
|
|
foreground = colors.blue;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-10-05 12:10:18 +02:00
|
|
|
"module/pulseaudio" = {
|
|
|
|
type = "internal/pulseaudio";
|
2022-08-19 03:49:21 +02:00
|
|
|
# format-volume = "<bar-volume>}"
|
|
|
|
# format-volume = "%{A1:bash -c '~/.scripts/get-volume' &:}<bar-volume>%{A}"
|
|
|
|
# format-volume = <label-volume> <bar-volume>
|
|
|
|
|
|
|
|
# format-volume-padding = 1
|
|
|
|
# format-muted-padding = 1
|
2024-10-05 12:10:18 +02:00
|
|
|
format-volume = " <label-volume> <bar-volume>";
|
2022-08-19 03:49:21 +02:00
|
|
|
# label-volume =
|
|
|
|
label-volume-foreground = colors.magenta;
|
|
|
|
# format-muted-foreground = "${colors.foreground-alt}";
|
|
|
|
label-muted = "mute";
|
|
|
|
|
|
|
|
bar.volume = {
|
|
|
|
width = 8;
|
|
|
|
foreground = [
|
|
|
|
"#55aa55"
|
|
|
|
"#55aa55"
|
|
|
|
"#55aa55"
|
|
|
|
"#55aa55"
|
|
|
|
"#55aa55"
|
|
|
|
"#f5a70a"
|
|
|
|
"#ff5555"
|
|
|
|
];
|
|
|
|
gradient = false;
|
|
|
|
indicator = "|";
|
|
|
|
# indicator-font = 1
|
|
|
|
fill = "─";
|
|
|
|
# fill-font = 1
|
|
|
|
empty = "─";
|
|
|
|
# empty-font = 1
|
|
|
|
# empty-foreground = "${colors.foreground-alt}";
|
|
|
|
};
|
|
|
|
|
|
|
|
#
|
|
|
|
# format-volume-prefix = "%{A3:pavucontrol &:}%{A}"
|
|
|
|
# format-volume-prefix-padding = 1
|
|
|
|
# format-volume-prefix-background = ${colors.fg-alt}
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# format-muted-prefix = "%{A3:pavucontrol &:}%{A}"
|
|
|
|
# format-muted-prefix-padding = 1
|
|
|
|
# format-muted-prefix-background = ${colors.fg-alt}
|
|
|
|
#
|
|
|
|
# label-muted = " "
|
|
|
|
# label-muted-background = ${colors.fg-alt}
|
|
|
|
#
|
|
|
|
# bar-volume-width = 5
|
|
|
|
# bar-volume-indicator = ""
|
|
|
|
# bar-volume-empty = ""
|
|
|
|
# bar-volume-fill = ""
|
|
|
|
#
|
|
|
|
# bar-volume-indicator-foreground = ${colors.fg}
|
|
|
|
# bar-volume-indicator-background = ${colors.fg-alt}
|
|
|
|
#
|
|
|
|
# bar-volume-empty-foreground = ${colors.fg-alt}
|
|
|
|
# bar-volume-empty-background = ${colors.fg-alt}
|
|
|
|
#
|
|
|
|
# bar-volume-fill-foreground = ${colors.accent-alt}
|
|
|
|
# bar-volume-fill-background = ${colors.fg-alt}
|
|
|
|
};
|
|
|
|
|
|
|
|
"module/mpd" = {
|
|
|
|
type = "internal/mpd";
|
|
|
|
|
|
|
|
# your port and host here
|
|
|
|
host = "127.0.0.1";
|
|
|
|
port = "6600";
|
|
|
|
|
|
|
|
format-online = "<toggle> <label-song>";
|
|
|
|
|
|
|
|
# These are opposite, because polybar expects you to click the icon to change state,
|
|
|
|
# instead of showing the current state.
|
|
|
|
|
|
|
|
icon-pause = "";
|
|
|
|
icon.pause = {
|
|
|
|
font = 3;
|
|
|
|
padding = 1;
|
|
|
|
foreground = colors.green;
|
|
|
|
} ;
|
|
|
|
|
|
|
|
icon-play = "";
|
|
|
|
icon.play = {
|
|
|
|
font = 3;
|
|
|
|
padding = 1;
|
|
|
|
foreground = colors.red;
|
|
|
|
} ;
|
|
|
|
|
|
|
|
label-song = "%title%";
|
|
|
|
label.song = {
|
2023-03-07 23:01:41 +01:00
|
|
|
maxlen = 30;
|
2022-08-19 03:49:21 +02:00
|
|
|
ellipsis = true;
|
|
|
|
padding = 1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
"module/filesystem" = {
|
|
|
|
type = "internal/fs";
|
|
|
|
|
|
|
|
# Mountpoints to display
|
|
|
|
mount = [
|
|
|
|
"/"
|
|
|
|
];
|
|
|
|
# ] ++ (builtins.values machineVars.dataDrives.drives);
|
|
|
|
|
|
|
|
format.mount = [
|
|
|
|
{ background = "#101010"; }
|
|
|
|
];
|
|
|
|
|
|
|
|
# Seconds to sleep between updates
|
|
|
|
# Default: 30
|
|
|
|
interval = 10;
|
|
|
|
|
|
|
|
# Display fixed precision values
|
|
|
|
# Default: false
|
|
|
|
fixed-values = true;
|
|
|
|
|
2024-10-05 12:10:18 +02:00
|
|
|
# Margin (number of spaces, pixels, or points) to add before/after each module
|
|
|
|
# Individual side values can be defined using:
|
|
|
|
# module-margin-{left,right}
|
|
|
|
module-margin = "16px";
|
|
|
|
# spacing = "16px";
|
2022-08-19 03:49:21 +02:00
|
|
|
|
|
|
|
# Default: 90
|
|
|
|
# New in version 3.6.0
|
|
|
|
warn-percentage = 75;
|
|
|
|
};
|
|
|
|
|
|
|
|
"settings" = {
|
|
|
|
screenchange-reload = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|