Add conky and gtk theme
This commit is contained in:
22
linux/jelly-conky/get_weather
Executable file
22
linux/jelly-conky/get_weather
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
# It seems that in conky the execi command will start before curl has completely
|
||||
# written the file. For some reason adding a sleep before calling curl fixes it.
|
||||
sleep 2
|
||||
|
||||
forecast=~/".cache/jelly-conky/forecast.json"
|
||||
weather=~/".cache/jelly-conky/weather.json"
|
||||
|
||||
mkdir -p ~/".cache/jelly-conky"
|
||||
|
||||
api_prefix="api.openweathermap.org/data/2.5/"
|
||||
|
||||
appid="APPID=$1"
|
||||
id="&id=$2"
|
||||
units="&units=$3"
|
||||
lang="${4%%_*}"
|
||||
lang="&lang=$lang"
|
||||
|
||||
curl -s "${api_prefix}forecast?${appid}${id}${units}${lang}" -o "$forecast"
|
||||
curl -s "${api_prefix}weather?${appid}${id}${units}${lang}" -o "$weather"
|
||||
Reference in New Issue
Block a user