Add live weather (#5633)
* Add live weather * Just use jq * Add Weather app and make it click target * Simplify * Looks better * Nicer flow * Simplify * Move to using the notification instead of tooltip * No longer needed
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
echo "Add weather widget to Waybar"
|
||||
|
||||
WAYBAR_CONFIG="$HOME/.config/waybar/config.jsonc"
|
||||
WAYBAR_STYLE="$HOME/.config/waybar/style.css"
|
||||
|
||||
if [[ -f $WAYBAR_CONFIG ]]; then
|
||||
if ! grep -q '"custom/weather"' "$WAYBAR_CONFIG"; then
|
||||
sed -i 's/"modules-center": \["clock",/"modules-center": ["clock", "custom\/weather",/' "$WAYBAR_CONFIG"
|
||||
sed -i '/"network": {/i\ "custom/weather": {\n "exec": "$OMARCHY_PATH/default/waybar/weather.sh",\n "return-type": "json",\n "interval": 600,\n "tooltip": false,\n "on-click": "notify-send -u low \\"$(omarchy-weather-status)\\""\n },' "$WAYBAR_CONFIG"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -f $WAYBAR_STYLE ]] && ! grep -q '#custom-weather' "$WAYBAR_STYLE"; then
|
||||
cat >>"$WAYBAR_STYLE" <<'EOF'
|
||||
|
||||
#custom-weather {
|
||||
margin-left: 7.5px;
|
||||
margin-right: 7.5px;
|
||||
}
|
||||
|
||||
#custom-weather.unavailable {
|
||||
min-width: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
|
||||
omarchy-restart-waybar
|
||||
Reference in New Issue
Block a user