system/home/ui/polybar/config.nix

133 lines
2.5 KiB
Nix
Raw Normal View History

{ lib, config, pkgs, colors }:
with lib;
let
mkWifi = interface: {
type = "internal/network";
interval = 3;
interface = {
text = interface;
type = "wireless";
};
label.connected = "%essid% %signal%";
format.connected = {
prefix = "| ";
suffix = "%";
};
};
in
{
"bar/main" = {
2022-09-26 00:52:49 +03:00
monitor = "\${env:MONITOR:DisplayPort-1}";
width = "100%";
height = "20px";
font = [
"Fira Code:size=9:antialias=true"
2022-10-02 15:09:38 +03:00
"Fira Code:bold:size=9:antialias=true"
"FiraCode Nerd Font Mono:size=9:antialias=true"
];
radius = 0;
modules = {
left = "xmonad";
center = "date wifi_home wifi_laptop";
2022-10-01 17:35:36 +03:00
right = "exchangerate volume battery lang time";
};
};
"module/date" = {
type = "internal/date";
interval = 10;
date = "%a %d %b %Y";
label = "%date%";
format.padding = 1;
};
"module/time" = {
type = "internal/date";
time = "%H:%M:%S";
label = {
text = "%time%";
font = 2;
foreground = colors.orange;
};
};
"module/lang" = {
type = "internal/xkeyboard";
format = {
text = "<label-layout>";
padding = 1;
};
label.layout.font = 2;
};
"module/volume" = {
type = "custom/script";
exec = "~/scripts/get_volume.sh";
interval = 1;
format = {
2022-10-02 15:14:30 +03:00
prefix = "%{T3}%{T-} ";
padding = 1;
};
};
2022-10-02 15:09:38 +03:00
"module/battery" = let padding = 1; in {
2022-10-01 17:35:36 +03:00
type = "internal/battery";
full-at = 99;
low-at = 10;
battery = "BAT0";
adapter = "AC0";
2022-10-02 15:09:38 +03:00
format.charging = {
inherit padding;
text = "%{T3}%{T-} <label-charging>";
};
2022-10-01 17:35:36 +03:00
format.discharging = {
2022-10-02 15:09:38 +03:00
inherit padding;
2022-10-01 17:35:36 +03:00
text = "%{T3}<ramp-capacity>%{T-} <label-discharging>";
2022-10-02 15:09:38 +03:00
};
format.full = {
inherit padding;
text = "%{T3}%{T-} <label-full>";
};
format.low = {
inherit padding;
text = "%{T3}%{T-} <label-low>";
2022-10-01 17:35:36 +03:00
};
# Only applies if <ramp-capacity> is used
2022-10-02 15:09:38 +03:00
ramp.capacity = [ "" "" "" "" "" ];
2022-10-01 17:35:36 +03:00
};
"module/wifi_home" = mkWifi "wlp11s0f3u2";
"module/wifi_laptop" = mkWifi "wlp2s0";
"module/xmonad" = mkIf config.ui.xmonad.enable {
type = "custom/script";
exec = "${pkgs.xmonad-log}/bin/xmonad-log";
tail = true;
};
2022-08-28 17:20:22 +03:00
"module/exchangerate" = {
type = "custom/script";
exec = "~/scripts/exchangerate.sh";
interval = 60;
format = {
prefix = "USD: ";
padding = 1;
};
};
"global/wm" = {
margin = {
bottom = 0;
top = 0;
};
};
}