Fix when networks are not connected in #polybar
This commit is contained in:
@ -224,15 +224,14 @@ type = internal/network
|
|||||||
interface = ${env:WLAN:}
|
interface = ${env:WLAN:}
|
||||||
interval = 5.0
|
interval = 5.0
|
||||||
|
|
||||||
format-connected = <ramp-signal> <label-connected>
|
format-connected = <label-connected>
|
||||||
format-connected-underline = #9f78e1
|
format-connected-underline = #9f78e1
|
||||||
label-connected = %essid% %local_ip%
|
label-connected = %essid% %signal%%
|
||||||
|
|
||||||
format-disconnected =
|
format-disconnected = <label-disconnected>
|
||||||
;format-disconnected = <label-disconnected>
|
format-disconnected-underline = #880000
|
||||||
;format-disconnected-underline = ${self.format-connected-underline}
|
label-disconnected = wifi down
|
||||||
;label-disconnected = %ifname% disconnected
|
label-disconnected-foreground = ${colors.foreground-alt}
|
||||||
;label-disconnected-foreground = ${colors.foreground-alt}
|
|
||||||
|
|
||||||
ramp-signal-0 =
|
ramp-signal-0 =
|
||||||
ramp-signal-1 =
|
ramp-signal-1 =
|
||||||
@ -250,11 +249,10 @@ format-connected-underline = #55aa55
|
|||||||
format-connected-prefix-foreground = ${colors.foreground-alt}
|
format-connected-prefix-foreground = ${colors.foreground-alt}
|
||||||
label-connected = %local_ip%
|
label-connected = %local_ip%
|
||||||
|
|
||||||
format-disconnected =
|
format-disconnected = <label-disconnected>
|
||||||
;format-disconnected = <label-disconnected>
|
format-disconnected-underline = #880000
|
||||||
;format-disconnected-underline = ${self.format-connected-underline}
|
label-disconnected = eth down
|
||||||
;label-disconnected = %ifname% disconnected
|
label-disconnected-foreground = ${colors.foreground-alt}
|
||||||
;label-disconnected-foreground = ${colors.foreground-alt}
|
|
||||||
|
|
||||||
[module/date]
|
[module/date]
|
||||||
type = internal/date
|
type = internal/date
|
||||||
@ -263,11 +261,11 @@ interval = 5
|
|||||||
date =
|
date =
|
||||||
date-alt = " %Y-%m-%d"
|
date-alt = " %Y-%m-%d"
|
||||||
|
|
||||||
time = %H:%M
|
time = %H:%M:%S
|
||||||
time-alt = %H:%M:%S
|
time-alt = %H:%M:%S
|
||||||
|
|
||||||
format-prefix =
|
;format-prefix =
|
||||||
format-prefix-foreground = ${colors.foreground-alt}
|
;format-prefix-foreground = ${colors.foreground-alt}
|
||||||
format-underline = #0a6cf5
|
format-underline = #0a6cf5
|
||||||
|
|
||||||
label = %date% %time%
|
label = %date% %time%
|
||||||
@ -339,7 +337,7 @@ format-charging-underline = #ffb52a
|
|||||||
format-discharging = <animation-discharging> <label-discharging>
|
format-discharging = <animation-discharging> <label-discharging>
|
||||||
format-discharging-underline = ${self.format-charging-underline}
|
format-discharging-underline = ${self.format-charging-underline}
|
||||||
|
|
||||||
format-full-prefix = " "
|
;format-full-prefix = " "
|
||||||
format-full-prefix-foreground = ${colors.foreground-alt}
|
format-full-prefix-foreground = ${colors.foreground-alt}
|
||||||
format-full-underline = ${self.format-charging-underline}
|
format-full-underline = ${self.format-charging-underline}
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@ pkill polybar
|
|||||||
|
|
||||||
wlan=`/sbin/ifconfig | grep wlp | tail -1 | cut -d ':' -f 1`
|
wlan=`/sbin/ifconfig | grep wlp | tail -1 | cut -d ':' -f 1`
|
||||||
eth=`/sbin/ifconfig | grep enx | tail -1 | cut -d ':' -f 1`
|
eth=`/sbin/ifconfig | grep enx | tail -1 | cut -d ':' -f 1`
|
||||||
|
[[ -z "$eth" ]] && { eth=`/sbin/ifconfig | grep enp | tail -1 | cut -d ':' -f 1`; }
|
||||||
|
|
||||||
for m in $(polybar --list-monitors | cut -d":" -f1); do
|
for m in $(polybar --list-monitors | cut -d":" -f1); do
|
||||||
WLAN=$wlan ETH=$eth MONITOR=$m polybar --reload primary &
|
WLAN=$wlan ETH=$eth MONITOR=$m polybar --reload primary &
|
||||||
|
|||||||
Reference in New Issue
Block a user