Want to contribute? Fork me on Codeberg.org!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
3.9 KiB

2 years ago
{ pkgs, lib, ... }:
let
background = "#2e3440";
background-alt = "#3b4252";
foreground = "#eceff4";
primary = "#8fbcbb";
secondary = "#ff00ff"; # not sure what this does
alert = "#ff00ff"; # not sure what this does
disabled = "#434c5e";
in
2 years ago
{
# Dependencies
home.packages = with pkgs; [
(pkgs.callPackage ./aozora.nix { })
(pkgs.callPackage ./polybar-now-playing.nix { })
];
services.polybar = {
enable = true;
script = "polybar &";
package = pkgs.polybar.override {
i3GapsSupport = true;
alsaSupport = true;
};
config = {
"colors" = {
};
2 years ago
"bar/top" = {
font-0 = "Noto Sans Mono;2";
font-1 = "Noto Sans CJK JP;2";
background = "${background}";
foreground = "${foreground}";
2 years ago
width = "100%";
height = "24pt";
line-size = "3pt";
padding-right = 1;
module-margin = 1;
separator = "|";
separator-foreground = "${disabled}";
2 years ago
cursor-click = "pointer";
cursor-scroll = "ns-resize";
modules-left = [
"xworkspaces"
"xwindow"
"now-playing"
];
modules-right = [
"aozora"
"filesystem"
"pulseaudio"
"memory"
"cpu"
"battery"
2 years ago
"date"
];
};
"module/xworkspaces" = {
type = "internal/xworkspaces";
label-active-background = "${background-alt}";
label-active-underline = "${primary}";
2 years ago
label-active-padding-right = 1;
label-occupied-padding-right = 1;
label-urgent-background = "${alert}";
2 years ago
label-urgent-padding-right = 1;
label-empty-foreground = "${disabled}";
2 years ago
label-empty-padding-right = 1;
};
"module/xwindow" = {
type = "internal/xwindow";
};
"module/now-playing" = {
type = "custom/script";
tail = true;
format = "<label>";
exec = "/etc/profiles/per-user/elnu/bin/polybar-now-playing";
click-right = "kill -USR1 $(pgrep --oldest --parent %pid%)";
};
"module/aozora" = {
type = "custom/script";
format = "<label>";
# Wait a few seconds before running to prevent no internet error on first start
# TODO: make aozora wait blockingly for internet in --bar mode
exec = "/run/current-system/sw/bin/sleep 3 && /etc/profiles/per-user/elnu/bin/aozora air-quality-in-lakewood-aw-341300 --bar 2> /dev/null";
2 years ago
interval = 90;
};
"module/filesystem" = {
type = "internal/fs";
interval = 25;
mount-0 = "/";
label-mounted = "%{F#88c0d0}%mountpoint%%{F-} %percentage_used%%";
label-unmounted = "%mountpoint% not mounted";
label-unmounted-foreground = "${disabled}";
2 years ago
};
"module/pulseaudio" = {
type = "internal/pulseaudio";
format-volume-prefix = "VOL ";
format-volume-prefix-foreground = "${primary}";
2 years ago
label-muted = "muted";
label-muted-foreground = "${disabled}";
2 years ago
};
"module/memory" = {
type = "internal/memory";
interval = 2;
format-prefix = "RAM ";
format-prefix-foreground = "${primary}";
2 years ago
};
"module/cpu" = {
type = "internal/cpu";
interval = 2;
format-prefix = "CPU ";
format-prefix-foreground = "${primary}";
};
# TODO: Only build battery module on ThinkPad host
"module/battery" = {
type = "internal/battery";
battery = "BAT0";
adapter = "AC";
label-charging = "%{F${primary}}AC%{F-} %percentage%%";
label-discharging = "%{F${primary}}BAT%{F-} %percentage%%";
label-full = "%{F${primary}}AC%{F-}";
2 years ago
};
"module/date" = {
type = "internal/date";
internal = 1;
date = "%H:%M";
date-alt = "%Y-%m-%d %H:%M:%S";
label-foreground = "${primary}";
2 years ago
};
};
};
}