Polybar: Monospacify and clean things up

This commit is contained in:
Salt 2018-08-19 17:12:59 -05:00
parent b3ba463e4e
commit 2b7d073c2b
2 changed files with 43 additions and 102 deletions

View File

@ -1,9 +1,5 @@
#!/bin/sh
export TERMINAL=konsole
# Primary bottom
export PB_BAR_PRIMARY_MODULES_LEFT='cpu memory swap'
export PB_MODULE_BAR_WIDTH=60
export PB_MODULE_ETH_INTERFACE=eno1
export PB_MODULE_WLAN_INTERFACE=wlp5s0
# vim:ft=sh

View File

@ -34,15 +34,12 @@ border = #3c3836
bar-empty = ${self.border}
[res/config]
padding = 4
bar-width = ${env:PB_MODULE_BAR_WIDTH:45}
bar-indicator =
bar-fill = |
padding = 2
[res/fonts]
font-0 = "Roboto:style=Regular:size=10;2"
font-1 = "Roboto:style=Bold:size=10;2"
font-2 = "Roboto:style=Light:size=10;2"
font-0 = "Inconsolata:style=Regular:size=10;2"
font-1 = "Inconsolata:style=Bold:size=10;2"
font-2 = "Inconsolata:style=Light:size=10;2"
font-3 = "Inconsolata:size=10;2"
font-4 = "Material Design Icons:size=11;3"
@ -61,7 +58,7 @@ wm-restack = ${env:PB_WM_RESTACK:bspwm}
# Module padding and spacing
module-margin = 2
padding = 4
padding = ${res/config.padding}
# Tray settings
tray-maxsize = 16
@ -85,12 +82,9 @@ font-4 = ${res/fonts.font-4}
monitor = ${env:PB_MONITOR:eDP-1}
inherit = template/bar
tray-detached = true
tray-position = center
modules-left = ${env:PB_BAR_PRIMARY_MODULES_LEFT:cpu memory}
modules-center = ${env:PB_BAR_PRIMARY_MODULES_CENTER: }
modules-right = ${env:PB_BAR_PRIMARY_MODULES_RIGHT:volume battery | date}
modules-left = ${env:PB_BAR_PRIMARY_MODULES_LEFT:cpu memory swap}
modules-center = ${env:PB_BAR_PRIMARY_MODULES_CENTER: bspwm}
modules-right = ${env:PB_BAR_PRIMARY_MODULES_RIGHT:volume battery date}
[bar/primary-2]
monitor = ${env:PB_MONITOR:eDP-1}
@ -98,9 +92,9 @@ inherit = template/bar
bottom = false
modules-left = ${env:PB_BAR_PRIMARY_2_MODULES_LEFT:bspwm}
modules-center = ${env:PB_BAR_PRIMARY_2_MODULES_CENTER:xwindow}
modules-right = ${env:PB_BAR_PRIMARY_2_MODULES_RIGHT:wlan eth}
modules-left = ${env:PB_BAR_PRIMARY_2_MODULES_LEFT: }
modules-center = ${env:PB_BAR_PRIMARY_2_MODULES_CENTER: }
modules-right = ${env:PB_BAR_PRIMARY_2_MODULES_RIGHT: }
[bar/secondary]
monitor = ${env:PB_MONITOR}
@ -144,30 +138,22 @@ content = " "
#====================
[module/battery]
type = internal/battery
format-charging = <bar-capacity> <label-charging>
format-charging-prefix = "Battery: "
format-charging = <label-charging>
format-charging-prefix = "CHR: "
format-charging-prefix-foreground = ${res/colors.icon-battery}
format-discharging = <bar-capacity> <label-discharging>
format-discharging-prefix = "Battery: "
format-discharging = <label-discharging>
format-discharging-prefix = "BAT: "
format-discharging-prefix-foreground = ${res/colors.icon-battery}
format-full = <bar-capacity> <label-full>
format-full-prefix = "Battery: "
format-full = <label-full>
format-full-prefix = "BAT: "
format-full-prefix-foreground = ${res/colors.icon-battery}
time-format = %H:%M
full-at = 98
interval = 15
label-charging = %percentage%%+
label-discharging = %percentage%%
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.bar-empty}
bar-capacity-indicator = ${res/config.bar-indicator}
bar-capacity-indicator-foreground = ${res/colors.background-alt}
label-charging = %percentage:3%%
label-discharging = %percentage:3%%
label-full = %percentage:3%%
[module/bspwm]
type = internal/bspwm
@ -199,18 +185,12 @@ label-empty-font = 3
[module/cpu]
type = internal/cpu
format = <bar-load>
format = <label>
format-prefix = "CPU: "
format-prefix-foreground = ${res/colors.icon-cpu}
interval = 1
bar-load-width = ${res/config.bar-width}
bar-load-fill = ${res/config.bar-fill}
bar-load-fill-foreground = ${res/colors.icon-cpu}
bar-load-empty = ${self.bar-load-fill}
bar-load-empty-foreground = ${res/colors.bar-empty}
bar-load-indicator = ${res/config.bar-indicator}
bar-load-indicator-foreground = ${res/colors.background-alt}
label = %percentage:3%%
[module/date]
type = internal/date
@ -223,45 +203,28 @@ interval = 30
label = %date% %time%
[module/dropbox]
type = custom/script
format-prefix = "Dropbox: "
format-prefix-foreground = ${res/colors.icon-dropbox}
interval = 15
exec = dropbox-cli status
exec-if = which dropbox-cli && [ "`dropbox-cli status`" != "Up to date" ] && wget -q --spider http://www.startpage.com/
[module/eth]
type = internal/network
format-connected = <label-connected>
format-connected-prefix = "Ethernet: "
format-connected-prefix = "ETH: "
format-connected-prefix-foreground = ${res/colors.icon-network}
format-disconnected = <label-disconnected>
format-disconnected-prefix = "Ethernet: "
format-disconnected-prefix = "ETH: "
format-disconnected-prefix-foreground = ${res/colors.icon-network}
interface = ${env:PB_MODULE_ETH_INTERFACE:enp0s31f6}
label-connected = %local_ip%
label-disconnected = Disconnected
label-disconnected = None
label-disconnected-foreground = ${res/colors.foreground-dark}
[module/fs-home]
type = internal/fs
format-mounted = <bar-used> <label-mounted>
format-mounted-prefix = "Home: "
format-mounted-prefix = "HOME: "
format-mounted-prefix-foreground = ${res/colors.icon-fs}
mount-0 = /home
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.bar-empty}
bar-used-indicator = ${res/config.bar-indicator}
bar-used-indicator-foreground = ${res/colors.background-alt}
label-mounted = %free:5% free
[module/hostname]
type = custom/script
@ -272,20 +235,12 @@ exec = hostname
[module/memory]
type = internal/memory
format = <bar-used> <label>
format-prefix = "Memory: "
format = <label>
format-prefix = "MEM: "
format-prefix-foreground = ${res/colors.icon-memory}
interval = 1
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.bar-empty}
bar-used-indicator = ${res/config.bar-indicator}
bar-used-indicator-foreground = ${res/colors.background-alt}
label = %percentage_used:3%%
[module/monitor]
type = custom/text
@ -295,15 +250,15 @@ content-foreground = ${res/colors.background-alt}
[module/swap]
type = internal/memory
format = <label>
format-prefix = "Swap: "
format-prefix = "SWP: "
format-prefix-foreground = ${res/colors.icon-memory}
interval = 1
label = %gb_swap_used% used
label = %percentage_swap_used:3%%
[module/tor]
type = custom/script
format-prefix = "Tor: "
format-prefix = "TOR: "
format-prefix-foreground = ${res/colors.icon-tor}
interval = 10
@ -319,25 +274,17 @@ exec = uname -sr
[module/volume]
type = internal/volume
format-volume = <bar-volume> <label-volume>
format-volume-prefix = "Volume: "
format-volume = <label-volume>
format-volume-prefix = "VOL: "
format-volume-prefix-foreground = ${res/colors.icon-volume}
format-muted = <bar-volume> <label-muted>
format-muted-prefix = "Volume: "
format-muted = <label-muted>
format-muted-prefix = "VOL: "
format-muted-prefix-foreground = ${res/colors.icon-volume}
label-volume = %percentage%%
label-muted = %percentage%%
label-volume = %percentage:3%%
label-muted = %percentage:3%%
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.bar-empty}
bar-volume-indicator = ${res/config.bar-indicator}
bar-volume-indicator-foreground = ${res/colors.background-alt}
[module/wlan]
type = internal/network
format-connected = <label-connected>
@ -349,16 +296,16 @@ format-disconnected-prefix-foreground = ${res/colors.icon-network}
interface = ${env:PB_MODULE_WLAN_INTERFACE:wlp1s0}
label-connected = %local_ip%
label-disconnected = Disconnected
label-disconnected = None
label-disconnected-foreground = ${res/colors.foreground-dark}
[module/xbacklight]
type = internal/xbacklight
format = <bar> <label>
format-prefix = "Light: "
format-prefix = "XBL: "
format-prefix-foreground = ${res/colors.icon-xbacklight}
label = %percentage%%
label = %percentage:3%%
bar-width = ${res/config.bar-width}
bar-fill = ${res/config.bar-fill}
@ -371,8 +318,6 @@ bar-indicator-foreground = ${res/colors.background-alt}
[module/xwindow]
type = internal/xwindow
format = <label>
label = %title%
label-maxlen = 100
label-ellipsis = true
label = %title:0:75:...%
# vim:ft=dosini