Add network and fs segments to polybar

This commit is contained in:
Henrik Lissner 2020-07-29 00:45:35 -04:00
parent 0208ea0cd7
commit fbff066eb2
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 76 additions and 20 deletions

View file

@ -67,9 +67,9 @@ font-1 = "Wuncon Siji:pixelsize=12;2"
font-2 = "Siji:pixelsize=10;2" font-2 = "Siji:pixelsize=10;2"
; modules-left = volume pad cpu memory pad pkg mail ; modules-left = volume pad cpu memory pad pkg mail
modules-left = pulseaudio pad cpu memory modules-left = pulseaudio pad cpu memory pad fs
modules-center = bspwm modules-center = bspwm
modules-right = wlan syncthing redshift pad battery pad date modules-right = syncthing redshift wlan pad network-up pad network-down pad battery pad date
;tray-position = center ;tray-position = center
;tray-padding = 2 ;tray-padding = 2
@ -127,6 +127,48 @@ format-prefix-padding = 1
format-prefix-foreground = ${colors.accent} format-prefix-foreground = ${colors.accent}
; format-underline = ${xrdb:color4} ; format-underline = ${xrdb:color4}
[module/fs]
type = internal/fs
mount-0 = /
mount-1 = /mnt/projects ; for desktops
mount-2 = /home ; for laptop
interval = 30
; Available tags:
; <label-mounted> (default)
; <bar-free>
; <bar-used>
; <ramp-capacity>
format-mounted = "<bar-used>"
format-mounted-foreground = ${colors.accent}
; Available tokens:
; %mountpoint%
; %type%
; %fsname%
; %percentage_free%
; %percentage_used%
; %total%
; %free%
; %used%
; Default: %mountpoint% %percentage_free%%
; Available tags:
; <label-unmounted> (default)
format-unmounted =
label-unmounted =
label-unmounted-foreground = ${colors.fg-alt}
bar-used-indicator =
bar-used-width = 8
bar-used-foreground-0 = ${colors.fg}
bar-used-foreground-1 = ${colors.fg}
bar-used-foreground-2 = ${colors.yellow}
bar-used-foreground-3 = ${colors.alert}
bar-used-foreground-4 = ${colors.alert}
bar-used-fill = |
bar-used-empty = ¦
bar-used-empty-foreground = ${colors.fg-alt}
[module/xwindow] [module/xwindow]
type = internal/xwindow type = internal/xwindow
label = %title:0:80:...% label = %title:0:80:...%
@ -167,7 +209,7 @@ format-foreground = ${colors.accent}
format-padding = 1 format-padding = 1
bar-load-indicator = bar-load-indicator =
bar-load-width = 6 bar-load-width = 8
bar-load-foreground-0 = ${colors.fg} bar-load-foreground-0 = ${colors.fg}
bar-load-foreground-1 = ${colors.fg} bar-load-foreground-1 = ${colors.fg}
bar-load-foreground-2 = ${colors.yellow} bar-load-foreground-2 = ${colors.yellow}
@ -189,7 +231,7 @@ format-padding-left = 1
; Only applies if <bar-used> is used ; Only applies if <bar-used> is used
bar-used-indicator = bar-used-indicator =
bar-used-width = 6 bar-used-width = 8
bar-used-foreground-0 = ${colors.fg} bar-used-foreground-0 = ${colors.fg}
bar-used-foreground-1 = ${colors.fg} bar-used-foreground-1 = ${colors.fg}
bar-used-foreground-2 = ${colors.yellow} bar-used-foreground-2 = ${colors.yellow}
@ -205,8 +247,8 @@ interface = ${env:WLP:wlp3s0}
interval = 3.0 interval = 3.0
format-connected = <ramp-signal> format-connected = <ramp-signal>
format-disconnected = ! format-disconnected =
format-disconnected-foreground = ${colors.red} format-disconnected-foreground =
; label-connected = ; label-connected =
; label-disconnected = ! ; label-disconnected = !
@ -223,19 +265,33 @@ ramp-signal-3-foreground = ${colors.accent}
ramp-signal-4 =  ramp-signal-4 = 
ramp-signal-4-foreground = ${colors.fg} ramp-signal-4-foreground = ${colors.fg}
; [module/eth] [module/network-up]
; type = internal/network type = internal/network
; interface = ${env:ETH:enp2s0} interface = ${env:LAN:eno1}
; interval = 4.0 interval = 4.0
; label-connected = "%upspeed%"
; ; format-connected-underline = #55aa55 format-connected-prefix = " "
; ; format-connected-prefix = " " format-connected-prefix-foreground = ${colors.accent}
; format-connected-foreground-foreground = ${colors.fg-alt} format-connected-foreground = ${colors.fg}
; label-connected = %local_ip% format-connected-background =
; format-connected-underline =
; format-disconnected-underline = ${self.format-connected-underline} format-disconnected-prefix = " "
; label-disconnected = %ifname% disconnected format-disconnected-prefix-foreground = ${colors.alert}
; label-disconnected-foreground = ${colors.fg-alt} format-disconnected-foreground = ${colors.alert}
[module/network-down]
type = internal/network
interface = ${env:LAN:eno1}
interval = 4.0
label-connected = "%downspeed%"
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.accent}
format-connected-foreground = ${colors.fg}
format-connected-background =
format-connected-underline =
format-disconnected-prefix = " "
format-disconnected-prefix-foreground = ${colors.alert}
format-disconnected-foreground = ${colors.alert}
[module/pulseaudio] [module/pulseaudio]
type = internal/pulseaudio type = internal/pulseaudio

View file

@ -8,6 +8,7 @@ if [[ $? -eq 0 ]]; then
temp=${temp//K/} temp=${temp//K/}
fi fi
icon=""
# OPTIONAL: Append ' ${temp}K' after $icon # OPTIONAL: Append ' ${temp}K' after $icon
if [[ -z $temp ]]; then if [[ -z $temp ]]; then
echo "%{F#65737E}$icon" # Greyed out (not running) echo "%{F#65737E}$icon" # Greyed out (not running)
@ -18,4 +19,3 @@ elif [[ $temp -ge 4000 ]]; then
else else
echo "%{F#D08770}$icon" # Orange echo "%{F#D08770}$icon" # Orange
fi fi