Testing
This commit is contained in:
parent
63a0aa60fa
commit
8d8fc06801
1 changed files with 5 additions and 3 deletions
|
@ -38,6 +38,7 @@
|
|||
echo "Activating get-theme-times systemd service"
|
||||
curl -s "https://api.sunrise-sunset.org/json?lat=35.680&lng=135.03&tzid=Asia/Tokyo" | fx .results.sunrise > /tmp/wttr.sunrise
|
||||
curl -s "https://api.sunrise-sunset.org/json?lat=35.680&lng=135.03&tzid=Asia/Tokyo" | fx .results.sunset > /tmp/wttr.sunset
|
||||
chmod ogu+rw /tmp/wttr.sunset /tmp/wttr.sunrise
|
||||
echo "get-theme-times - complete"
|
||||
'';
|
||||
after = [ "networking-online.target" ];
|
||||
|
@ -47,14 +48,15 @@
|
|||
set-theme = {
|
||||
enable = true;
|
||||
script = ''
|
||||
#!/bin/env bash
|
||||
echo "set-theme.service - Checking for theme settings"
|
||||
if [ ! -f /tmp/wttr.sunrise ] ; then
|
||||
systemctl --user start get-theme-times.service
|
||||
fi
|
||||
echo "Getting dates:"
|
||||
SUNRISE=`date $(cat /tmp/wttr.sunset) +%s`
|
||||
SUNRISE=$(date -d "$(cat /tmp/wttr.sunset)" +%s)
|
||||
echo "Sunrise: $SUNRISE"
|
||||
SUNSET=`date $(cat /tmp/wttr.sunset) +%s`
|
||||
SUNSET=$(date -d "$(cat /tmp/wttr.sunset)" +%s)
|
||||
echo "Sunset: $SUNSET"
|
||||
CURRENT=`date +%s`
|
||||
echo "Current: $CURRENT"
|
||||
|
|
Loading…
Reference in a new issue