Add .config/waybar/config

Add .config/waybar/scripts/PBPbattery.sh
Add .config/waybar/scripts/keyhint.sh
Add .config/waybar/scripts/power-menu.sh
Add .config/waybar/scripts/weather.sh
Add .config/waybar/style.css
This commit is contained in:
2023-07-28 13:14:56 +02:00
parent 8f5f516acd
commit b3a17d2abd
6 changed files with 470 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
#!/bin/bash
LOC="$1"
# HTML encode string as %20
LOCATION=$(sed -e "s/ /%20/g" <<<"$LOC")
content=$(curl -sS "https://thisdavej.azurewebsites.net/api/weather/current?loc=$LOCATION&deg=C")
ICON=$(curl -s 'https://wttr.in/?format=1' | sed 's/[+0-9a-cA-Z°-]//g' )
# echo $ICON
TEMP=$(echo $content | jq -r '. | "\(.temperature)°\(.degType)"' | sed 's/"//g')
TOOLTIP=$(echo $content | jq -r '. | "\(.temperature)°\(.degType)\n\(.skytext)"' | sed 's/"//g')
CLASS=$(echo $content | jq .skytext)
echo '{"text": "'$TEMP'", "tooltip": "'$ICON $TOOLTIP $LOC'", "class": '$CLASS' }'