#!/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