diff options
Diffstat (limited to 'env/.config/i3blocks')
| -rwxr-xr-x | env/.config/i3blocks/bandwidth-wrapper.sh | 14 | ||||
| -rw-r--r-- | env/.config/i3blocks/config | 11 |
2 files changed, 22 insertions, 3 deletions
diff --git a/env/.config/i3blocks/bandwidth-wrapper.sh b/env/.config/i3blocks/bandwidth-wrapper.sh new file mode 100755 index 0000000..d78daa4 --- /dev/null +++ b/env/.config/i3blocks/bandwidth-wrapper.sh @@ -0,0 +1,14 @@ +#!/bin/bash +CACHE_FILE="/tmp/bandwidth.cache" + +# Primary bar updates the cache +if [ -n "$I3BLOCKS_PRIMARY" ]; then + ~/.config/i3blocks/bandwidth/bandwidth > "$CACHE_FILE" 2>/dev/null +fi + +# Both bars show from cache +if [ -f "$CACHE_FILE" ]; then + sleep 0.1 && cat "$CACHE_FILE" +else + echo "↓0 ↑0" +fi diff --git a/env/.config/i3blocks/config b/env/.config/i3blocks/config index 1be7de4..b2faf6c 100644 --- a/env/.config/i3blocks/config +++ b/env/.config/i3blocks/config @@ -81,8 +81,13 @@ label= interval=10 separator=false -[bandwidth] +#[bandwidth] #INTERFACE=eth0 +#interval=5 + +[bandwidth] +INTERFACE=eth0 +command=bandwidth-wrapper.sh interval=5 # CPU usage @@ -93,7 +98,7 @@ interval=5 label= interval=10 min_width= 100.00% -#separator=false +separator=false [load_average] label= @@ -109,7 +114,7 @@ interval=30 [rss] label= -command=/usr/bin/newsboat -x print-unread|sed 's/\s.*//; s/Error:/E/' +command=cat /tmp/newsboat-unreads.cache 2>/dev/null || echo "0" interval=20 # Date Time |
