sh: Add internet-check base script
Added script to sh base package to allow checking for internet connectivity. Checks both through system virtual filesystem and, as a fallback, through pinging google dns. Added a simple readme to sh module.
This commit is contained in:
parent
658e07e1b8
commit
3bf5becbe2
3 changed files with 48 additions and 4 deletions
|
|
@ -269,7 +269,7 @@ format-underline = ${colors.primary}
|
|||
[module/mail]
|
||||
type = custom/script
|
||||
exec = echo "$( [ $(systemctl --user --property=ActiveState show mbsync.timer) = 'ActiveState=active' ] && echo "" || echo "" ) $(notmuch count tag:inbox and tag:unread)"
|
||||
exec-if = [ "$(notmuch count tag:inbox and tag:unread)" -gt 0 ]
|
||||
exec-if = check-internet && [ "$(notmuch count tag:inbox and tag:unread)" -gt 0 ]
|
||||
click-right = systemctl --user start mbsync.timer
|
||||
click-left = systemctl --user stop mbsync.timer
|
||||
interval = 300.0
|
||||
|
|
@ -278,7 +278,7 @@ format-underline = ${colors.primary}
|
|||
[module/weather]
|
||||
type = custom/script
|
||||
exec = $XDG_CONFIG_HOME/polybar/scripts/poly-weather 'Copenhagen?m&format=%t+%C+(%p)'
|
||||
exec-if = type $XDG_CONFIG_HOME/polybar/scripts/poly-weather
|
||||
exec-if = type $XDG_CONFIG_HOME/polybar/scripts/poly-weather && check-internet
|
||||
interval = 60.0
|
||||
; format-background = ${colors.primary}
|
||||
; format-foreground = ${colors.background}
|
||||
|
|
@ -301,7 +301,7 @@ tail = true
|
|||
[module/archupdates]
|
||||
type = custom/script
|
||||
exec = $XDG_CONFIG_HOME/polybar/scripts/poly-archupdates
|
||||
exec-if = type $XDG_CONFIG_HOME/polybar/scripts/poly-archupdates
|
||||
exec-if = type $XDG_CONFIG_HOME/polybar/scripts/poly-archupdates && check-internet
|
||||
interval = 600
|
||||
format = <label>
|
||||
format-prefix = " "
|
||||
|
|
@ -311,7 +311,7 @@ format-underline = ${colors.primary}
|
|||
[module/networkspeed]
|
||||
type = custom/script
|
||||
exec = $XDG_CONFIG_HOME/polybar/scripts/poly-networkspeed
|
||||
exec-if = type $XDG_CONFIG_HOME/polybar/scripts/poly-networkspeed
|
||||
exec-if = type $XDG_CONFIG_HOME/polybar/scripts/poly-networkspeed && check-internet
|
||||
tail = true
|
||||
format-underline = ${colors.primary}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue