Add uptime module to polybar

This commit is contained in:
Lauren Lagarde 2025-03-30 11:36:53 -05:00
parent 8e85199a56
commit 47a83eaeb5
1 changed files with 14 additions and 2 deletions

View File

@ -65,7 +65,7 @@
#"siji:pixelsize=14;1" #"siji:pixelsize=14;1"
]; ];
modules-left = "hostname bspwm i3"; modules-left = "hostname uptime bspwm i3";
modules-center = "mpd"; modules-center = "mpd";
modules-right = "dirty root xbacklight volume wlan eth zram memory cpu battery date"; modules-right = "dirty root xbacklight volume wlan eth zram memory cpu battery date";
@ -95,7 +95,7 @@
#"siji:pixelsize=14;1" #"siji:pixelsize=14;1"
]; ];
modules-left = "hostname bspwm i3"; modules-left = "hostname uptime bspwm i3";
modules-center = "mpd"; modules-center = "mpd";
modules-right = "dirty root xbacklight volume wlan eth zram memory cpu battery date tray"; modules-right = "dirty root xbacklight volume wlan eth zram memory cpu battery date tray";
@ -159,6 +159,18 @@
format-prefix-foreground = "\${colors.foreground-alt}"; format-prefix-foreground = "\${colors.foreground-alt}";
}; };
"module/uptime" = {
type = "custom/script";
exec = "echo $(uptime | sed 's|.*up|up|; s|,.*||')";
interval = 60;
format = "<label>";
format-underline = "#72fb81";
format-prefix = "";
format-prefix-foreground = "\${colors.foreground-alt}";
};
"module/dirty" = { "module/dirty" = {
type = "custom/script"; type = "custom/script";
exec = "grep -e Dirty: /proc/meminfo | sed 's/Dirty: *//; s/ kB/000/' | numfmt --to=iec --suffix=B | sed 's/\\([0-9]\\)\\([A-Z]\\)/\\1 \\2/'"; exec = "grep -e Dirty: /proc/meminfo | sed 's/Dirty: *//; s/ kB/000/' | numfmt --to=iec --suffix=B | sed 's/\\([0-9]\\)\\([A-Z]\\)/\\1 \\2/'";