Comments (3)
I was just trying to sort this out today and it appears that you need to put your time zone offset in the timestamps. So if you are UTC-6, try replacing the "Z" at the end with "-06:00" (and of course pay attention to whether daylight savings time is in effect for the date that you specify and adjust your offset accordingly):
"time": "2023-12-30T15:00:00-06:00"
Things also seem to work better if your JSON entries match the order of the files in the file system. Pay attention to the order in which it reads in your images—surprisingly, it's not the order in which you have them in the JSON file.
from wallpapper.
The weird thing, if you deconstruct the official Apple ones, they're in UTC ISO format (ending in Z). Not sure why it doesn't work when I try this, though.
Thanks for the tip! I'll give it a shot if I decide to mess around with this again.
from wallpapper.
The actual plist in which the times are stored in the final HEIC doesn't have times at all. 8am for example is simply stored as the floating point value 0.33. Which makes sense, because the dynamic wallpapers always change at the same local time, no matter your time zone.
The value wallpapper will use is calculated here:
The code is intended to throw away everything except the hour and minute, then turn those two components into a Double representing the fraction of the day that has passed, but that is not what it does. Because the code uses an actual library to handle the dates, instead of just pulling the hour and minute values from the json, it undergoes several time zone conversions which are simply wrong. From my brief testing it seems that in aggregate, your local time zone is added twice, then the time zone in the time-stamp is subtracted from that (see example below).
For example if your local time is +01:00
:
08:00:00Z
will become0.41666666666666669
(10am)08:00:00+01:00
will become0.375
(9am)08:00:00+02:00
will become0.33333333333333331
(actually 8am)
This explains why your image changes at 7pm and 1am (your timezone being -06:00
causes it to be wrong by 6 hours, since it subtracts 12 hours from your UTC timestamps). That one of the changes ends up being around midnight might be caused by it actually ending up with a negative value somewhere along the line, which then becomes zero (plus rounding errors), not sure though.
Either way, you should get the correct times, if you specify -12:00
as the time zone offset (no, really) and then just give the local times you want the images to change at. If the problem remains, you could have a look at the actual plist that gets generated.
In order to get the plist in a human-readable form:
wallpapper -e output.heic -o output.plist
plistutil -i output.list -f json -o output.json
The json file will contain an object ap
which gives the (zero-based) indices of the isForLight
and isForDark
images, as well as an array ti
, which maps times (given as fractions) to indices of images to show.
If your output were working correctly, you'd expect it to look roughly like this:
{
"ti": [
{
"t": 0.375,
"i": 0
},
{
"t": 0.79166667,
"i": 1
},
{
"t": 0.04166667,
"i": 2
},
{
"t": 0.20833333,
"i": 3
},
{
"t": 0.29166667,
"i": 4
}
],
"ap": {
"d": 1,
"l": 0
}
}
from wallpapper.
Related Issues (20)
- ISO 8601 timings not working for wallpaper HOT 5
- Having multiple sequence kinds breaks functionality
- Loop in seconds HOT 1
- Using local time for time changing wall paper HOT 2
- Brew install fails HOT 1
- `CoreFoundation._CFObject` not found when executing `wallpaper -e`
- I'm not really understanding how to use the JSON file HOT 3
- The HEIC set to wallpaper doesn't change with time and shows wrong frame HOT 4
- Brew install failed HOT 3
- Activation of SDK from Xcode necessary HOT 1
- Homebrew install not working - Ventura - SwiftPM Errors HOT 3
- Loss in quality when wallpaper is output
- Add warning about the misspelled name.
- Light mode does not seem to work when specifying light / dark and time based images
- wallpapper-exif unsupported format of creation date
- Proposal: Automated Time Based JSON Generator and GPS Adder
- Light/dark positions
- Having trouble with the JSON file. HOT 1
- Incorrect Solar frames picked during the day
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wallpapper.