From fbff066eb27b4d8923fcdc7e6ebe2d1e8a792863 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 29 Jul 2020 00:45:35 -0400 Subject: [PATCH] Add network and fs segments to polybar --- modules/themes/fluorescence/polybar/config | 94 +++++++++++++++---- .../fluorescence/polybar/modules/redshift | 2 +- 2 files changed, 76 insertions(+), 20 deletions(-) diff --git a/modules/themes/fluorescence/polybar/config b/modules/themes/fluorescence/polybar/config index 6476c323..26d36571 100644 --- a/modules/themes/fluorescence/polybar/config +++ b/modules/themes/fluorescence/polybar/config @@ -67,9 +67,9 @@ font-1 = "Wuncon Siji:pixelsize=12;2" font-2 = "Siji:pixelsize=10;2" ; 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-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-padding = 2 @@ -127,6 +127,48 @@ format-prefix-padding = 1 format-prefix-foreground = ${colors.accent} ; 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: +; (default) +; +; +; +format-mounted = "" +format-mounted-foreground = ${colors.accent} +; Available tokens: +; %mountpoint% +; %type% +; %fsname% +; %percentage_free% +; %percentage_used% +; %total% +; %free% +; %used% +; Default: %mountpoint% %percentage_free%% + +; Available tags: +; (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] type = internal/xwindow label = %title:0:80:...% @@ -167,7 +209,7 @@ format-foreground = ${colors.accent} format-padding = 1 bar-load-indicator = -bar-load-width = 6 +bar-load-width = 8 bar-load-foreground-0 = ${colors.fg} bar-load-foreground-1 = ${colors.fg} bar-load-foreground-2 = ${colors.yellow} @@ -189,7 +231,7 @@ format-padding-left = 1 ; Only applies if is used bar-used-indicator = -bar-used-width = 6 +bar-used-width = 8 bar-used-foreground-0 = ${colors.fg} bar-used-foreground-1 = ${colors.fg} bar-used-foreground-2 = ${colors.yellow} @@ -205,8 +247,8 @@ interface = ${env:WLP:wlp3s0} interval = 3.0 format-connected = -format-disconnected = ! -format-disconnected-foreground = ${colors.red} +format-disconnected = +format-disconnected-foreground = ; label-connected = ; label-disconnected = ! @@ -223,19 +265,33 @@ ramp-signal-3-foreground = ${colors.accent} ramp-signal-4 =  ramp-signal-4-foreground = ${colors.fg} -; [module/eth] -; type = internal/network -; interface = ${env:ETH:enp2s0} -; interval = 4.0 -; -; ; format-connected-underline = #55aa55 -; ; format-connected-prefix = " " -; format-connected-foreground-foreground = ${colors.fg-alt} -; label-connected = %local_ip% -; -; format-disconnected-underline = ${self.format-connected-underline} -; label-disconnected = %ifname% disconnected -; label-disconnected-foreground = ${colors.fg-alt} +[module/network-up] +type = internal/network +interface = ${env:LAN:eno1} +interval = 4.0 +label-connected = "%upspeed%" +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/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] type = internal/pulseaudio diff --git a/modules/themes/fluorescence/polybar/modules/redshift b/modules/themes/fluorescence/polybar/modules/redshift index 7733a7fc..9a0b05f0 100755 --- a/modules/themes/fluorescence/polybar/modules/redshift +++ b/modules/themes/fluorescence/polybar/modules/redshift @@ -8,6 +8,7 @@ if [[ $? -eq 0 ]]; then temp=${temp//K/} fi +icon="" # OPTIONAL: Append ' ${temp}K' after $icon if [[ -z $temp ]]; then echo "%{F#65737E}$icon" # Greyed out (not running) @@ -18,4 +19,3 @@ elif [[ $temp -ge 4000 ]]; then else echo "%{F#D08770}$icon" # Orange fi -