Polybar: A bar, bars, and miscellaneous refactoring

I'm bored as shit right now
This commit is contained in:
Salt 2018-06-20 22:04:13 -05:00
parent c51c971d6d
commit 774607b07d
2 changed files with 68 additions and 25 deletions

View File

@ -31,6 +31,8 @@ border = #3c3836
[res/config] [res/config]
padding = 4 padding = 4
bar-width = 15
bar-fill = ━
[res/fonts] [res/fonts]
font-0 = "Roboto:size=10;2" font-0 = "Roboto:size=10;2"
@ -51,7 +53,6 @@ font-4 =
width = 1908 width = 1908
height = 34 height = 34
offset-x = 6 offset-x = 6
offset-y = 0
bottom = true bottom = true
wm-restack = ${env:PB_WM_RESTACK:bspwm} wm-restack = ${env:PB_WM_RESTACK:bspwm}
@ -80,9 +81,21 @@ font-4 = ${res/fonts.font-4}
monitor = ${env:PB_MONITOR:eDP-1} monitor = ${env:PB_MONITOR:eDP-1}
inherit = template/bar inherit = template/bar
modules-left = bspwm | cpu memory fs-home modules-left = cpu memory
modules-center = xwindow modules-center = xwindow
modules-right = wlan xbacklight volume battery | date modules-right = xbacklight volume battery | date
[bar/primary-2]
monitor = ${env:PB_MONITOR:eDP-1}
inherit = template/bar
bottom = false
border-bottom-size = 4
border-top-size = 0
modules-left = bspwm
modules-center =
modules-right = fs-home | wlan
[bar/secondary] [bar/secondary]
monitor = ${env:PB_MONITOR} monitor = ${env:PB_MONITOR}
@ -139,41 +152,45 @@ label-empty-foreground = ${res/colors.background-alt}
[module/battery] [module/battery]
type = internal/battery type = internal/battery
format-charging = <label-charging> format-charging = <bar-capacity> <label-charging>
format-charging-prefix = "Battery: " format-charging-prefix = "Battery: "
format-charging-prefix-foreground = ${res/colors.icon-battery} format-charging-prefix-foreground = ${res/colors.icon-battery}
format-discharging = <label-discharging> format-discharging = <bar-capacity> <label-discharging>
format-discharging-prefix = "Battery: " format-discharging-prefix = "Battery: "
format-discharging-prefix-foreground = ${res/colors.icon-battery} format-discharging-prefix-foreground = ${res/colors.icon-battery}
format-full = <label-full> format-full = <bar-capacity> <label-full>
format-full-prefix = "Battery: " format-full-prefix = "Battery: "
format-full-prefix-foreground = ${res/colors.alert} format-full-prefix-foreground = ${res/colors.alert}
time-format = %H:%M time-format = %H:%M
full-at = 98 full-at = 98
interval = 15 interval = 15
label-charging = %percentage%%, charging label-charging = %percentage%%+
label-discharging = %percentage%% label-discharging = %time%
label-full = %percentage%%, full label-full = %percentage%%
bar-capacity-width = ${res/config.bar-width}
bar-capacity-fill = ${res/config.bar-fill}
bar-capacity-fill-foreground = ${res/colors.icon-battery}
bar-capacity-empty = ${self.bar-capacity-fill}
bar-capacity-empty-foreground = ${res/colors.background-alt}
bar-capacity-indicator = |
bar-capacity-indicator-foreground = ${res/colors.background-alt}
[module/cpu] [module/cpu]
type = internal/cpu type = internal/cpu
format = <ramp-coreload> format = <bar-load>
format-prefix = "CPU: " format-prefix = "CPU: "
format-prefix-foreground = ${res/colors.icon-cpu} format-prefix-foreground = ${res/colors.icon-cpu}
interval = 1 interval = 1
ramp-coreload-0 = ▁ bar-load-width = ${res/config.bar-width}
ramp-coreload-1 = ▂ bar-load-fill = ${res/config.bar-fill}
ramp-coreload-2 = ▃ bar-load-fill-foreground = ${res/colors.icon-cpu}
ramp-coreload-3 = ▄ bar-load-empty = ${self.bar-load-fill}
ramp-coreload-4 = ▅ bar-load-empty-foreground = ${res/colors.background-alt}
ramp-coreload-5 = ▆ bar-load-indicator = |
ramp-coreload-5-foreground = ${res/colors.alert} bar-load-indicator-foreground = ${res/colors.background-alt}
ramp-coreload-6 = ▇
ramp-coreload-6-foreground = ${res/colors.alert}
ramp-coreload-7 = █
ramp-coreload-7-foreground = ${res/colors.warning}
[module/date] [module/date]
type = internal/date type = internal/date
@ -188,32 +205,57 @@ label = %date% %time%
[module/fs-home] [module/fs-home]
type = internal/fs type = internal/fs
format-mounted = <label-mounted> format-mounted = <bar-used> <label-mounted>
format-mounted-prefix = "Home: " format-mounted-prefix = "Home: "
format-mounted-prefix-foreground = ${res/colors.icon-fs} format-mounted-prefix-foreground = ${res/colors.icon-fs}
mount-0 = /home mount-0 = /home
label-mounted = %free% free label-mounted = %free% free
bar-used-width = ${res/config.bar-width}
bar-used-fill = ${res/config.bar-fill}
bar-used-fill-foreground = ${res/colors.icon-fs}
bar-used-empty = ${self.bar-used-fill}
bar-used-empty-foreground = ${res/colors.background-alt}
bar-used-indicator = |
bar-used-indicator-foreground = ${res/colors.background-alt}
[module/memory] [module/memory]
type = internal/memory type = internal/memory
format = <label> format = <bar-used> <label>
format-prefix = "Memory: " format-prefix = "Memory: "
format-prefix-foreground = ${res/colors.icon-memory} format-prefix-foreground = ${res/colors.icon-memory}
interval = 1 interval = 1
label = %gb_free% usable label = %gb_used%
bar-used-width = ${res/config.bar-width}
bar-used-fill = ${res/config.bar-fill}
bar-used-fill-foreground = ${res/colors.icon-memory}
bar-used-empty = ${self.bar-used-fill}
bar-used-empty-foreground = ${res/colors.background-alt}
bar-used-indicator = |
bar-used-indicator-foreground = ${res/colors.background-alt}
[module/volume] [module/volume]
type = internal/volume type = internal/volume
format-volume = <label-volume> format-volume = <bar-volume> <label-volume>
format-volume-prefix = "Volume: " format-volume-prefix = "Volume: "
format-volume-prefix-foreground = ${res/colors.icon-volume} format-volume-prefix-foreground = ${res/colors.icon-volume}
format-muted = <label-muted> format-muted = <label-muted>
label-volume = %percentage%%
label-muted = Muted label-muted = Muted
label-muted-foreground = ${res/colors.foreground-dark} label-muted-foreground = ${res/colors.foreground-dark}
bar-volume-width = ${res/config.bar-width}
bar-volume-fill = ${res/config.bar-fill}
bar-volume-fill-foreground = ${res/colors.icon-volume}
bar-volume-empty = ${self.bar-volume-fill}
bar-volume-empty-foreground = ${res/colors.background-alt}
bar-volume-indicator = |
bar-volume-indicator-foreground = ${res/colors.background-alt}
[module/wlan] [module/wlan]
type = internal/network type = internal/network
format-connected = <label-connected> format-connected = <label-connected>

View File

@ -15,6 +15,7 @@ if [[ $PB_MONITOR == "" ]]; then
fi fi
printf '[INFO] Starting Polybar primary on monitor $PB_MONITOR' printf '[INFO] Starting Polybar primary on monitor $PB_MONITOR'
polybar -r primary& polybar -r primary&
polybar -r primary-2&
# ...and then moving on to secondaries, if we have them # ...and then moving on to secondaries, if we have them
# Alright, now this looks *really* bad, spawning so many subprocesses, but # Alright, now this looks *really* bad, spawning so many subprocesses, but
# there's no way in hell you can get me to attempt to solve this with regex. # there's no way in hell you can get me to attempt to solve this with regex.