Edit: v2 out now! The GitHub link in step 3 below will take you to v1, but I suggest checking out v2 - a lot easier to read.
This widget showcases the next F1 race schedule in your time zone - great if you like to know all the details for the weekends events. It dims sessions during the weekend that have passed, will auto-update to the next race's schedule, and supports sprint race weekends as well.
Want it? Here's how to get it:
Download Scriptable from the iOS store, it's free!
In Scriptable, add a new Script, give it a name, and paste in the script.
Add the widget for Scriptable to your Lock Screen like any other widget
After you drag the rectangular Scriptable widget to the lock screen, tap the widget and it will ask you to select the Scriptable script to show.
???
Profit.
To get correct date format for folks outside of the US, you can change these 3 lines return sessionTime.toLocaleTimeString('en-US', options); to replace en-US with en-GB (for example).
Great question! I haven't tried. I assume it will look not great due to padding sizes and stuff being specific to make the lockscreen look good, but that should be easily changed in the script.
Yea it is, a sacrifice I had to make to get all the info I wanted to show on there.
Edit: oops I responded from my inbox and didn't see this comment thread was about the home screen.
Its not formatted for homescreen. I would tap and hold on the widget in Scriptable and "Duplicate" it, give it a name, add that copy to your homescreen, then play with these until it looks good to you:
let headerFont = new Font("Hiragino Sans W7", 16) /// the last number here, 16, is the font size
let titleFont = new Font("Hiragino Sans W7", 10) /// the last number here, 10, is the font size
let bodyFont = new Font("Hiragino Sans W6", 10) /// the last number here, 10, is the font size
headerCell.size = new Size(175,0)
body.size = new Size(175,0)
Which are font sizes and column widths. Column width of 350 looks good to me.
You can change the spacing between the header and table by changing this line before the let body = widget.addStack() line:
widget.addSpacer(4);
And change the spacing between each table row by changing this line that occurs before all the if statements:
wow this is cool. yeah time text is hard to read especially on light backgrounds (I have cycling photos so unpredictable). Any option or way to edit to have it larger? I’d be ok with just qualy/race (or sprint qualy/race/qualy/race so four columns max?
Edit: oops I responded from my inbox and didn't see this comment thread was about the home screen.
Its not formatted for homescreen. I would tap and hold on the widget in Scriptable and "Duplicate" it, give it a name, add that copy to your homescreen, then play with these until it looks good to you:
let headerFont = new Font("Hiragino Sans W7", 16) /// the last number here, 16, is the font size for the race name
let titleFont = new Font("Hiragino Sans W7", 10) /// the last number here, 10, is the font size for the session name
let bodyFont = new Font("Hiragino Sans W6", 10) /// the last number here, 10, is the font size for the date/time
headerCell.size = new Size(175,0)
body.size = new Size(175,0)
Which are font sizes and column widths. Column width of 350 looks good to me.
You can change the spacing between the header and table by changing this line before the let body = widget.addStack() line:
widget.addSpacer(4);
And change the spacing between each table row by changing this line that occurs before all the if statements:
thanks. Tweaked a little with some trial and error.
adjusted fonts - header/title 10, body 12
reduced to max columns 4 (had to reorder the numbering at the end so I deleted FP1 and moved up the column numbers for the others from 0-3. I’m ok with that
changed the date format to en-GB which makes the dates 16/3 (phew)
Nice! Upon further inspection, the time is width limited. I will see if I can't figure out how to increase the width of each column, there's certainly a little room.
It's certainly possible but would definitely require more lines of code to make it work properly. Ultimately having it on the Lock Screen is already a great view
Cool idea, not getting it to work though. Stuck at 4, the widget doesn't show. Pasted the code and when i ran it i got the widget to show properly in scriptable, but that's it.
You drag the widget into the spot on the lockscreen, then tap on the widget which will bring up a screen to select the script to use for the widget. Did you do that part?
Try running the script 1 time within Scriptable: Open scriptable, tap the script, press the play button in the bottom right corner. Now go back to customize your Lock Screen - does it show up now?
I followed steps 1 - 5. On the lock screen it shows ‘edit widget to select script’. However, when I tap the custom script provided, it runs (I think, as it flashes like the other default scripts do), but then stops and nothing happens.
Returning to the lock screen keeps showing the ‘edit widget to select script’ cta on the dragged in horizontal widget area.
Adding the widget on the home screen as normal works, it displays the upcoming race table, but as you mentioned, the padding causes it to float a little.
Go into “Customize mode” on your Lock Screen like you’re going to add the widget again, then tap on the widget. You should get a pop up that asks you to select the scriptable script.
And now it works. Of course. The only thing I did different now is to run the script immediately after adding the scriptable widget vs adding it, close customisation and then running the script.
You choose the wrong scriptable widget. Remove that one, and when you select Scriptable to add the widget, swipe over and there is a rectangular one to add.
See my post here. You need to update the script. The API owner probably blocked the old script due to the excessive API calls.
Otherwise if you are on the latest script, it could be related to the auto-update feature. But I haven’t pushed an update in weeks so unlikely. If you hadn’t enabled notifications for Scriptable and there was a script update available, it will throw an error until you enable notifications.
If you'd like something a little less fiddly, I have an iOS app I maintain called NextGP that has a slew of widgets like this and a bunch of other cool F1 features.
I'll add a Lock Screen weekend schedule widget similar to this today!
It’s not fiddly at all, and requires minimal extra effort compared to a paid widget - going to the GitHub, copying the code, and pasting it into Scriptable.
The reason I did this was that I didn’t like any of the available options from prebuilt apps. Most only show part of the weekend schedule, or use an ugly font, or some other thing I don’t like.
8
u/timespacedecay Mar 11 '25 edited Mar 15 '25
Edit: v2 out now! The GitHub link in step 3 below will take you to v1, but I suggest checking out v2 - a lot easier to read.
This widget showcases the next F1 race schedule in your time zone - great if you like to know all the details for the weekends events. It dims sessions during the weekend that have passed, will auto-update to the next race's schedule, and supports sprint race weekends as well.
Want it? Here's how to get it:
To get correct date format for folks outside of the US, you can change these 3 lines
return sessionTime.toLocaleTimeString('en-US', options);to replaceen-USwithen-GB(for example).2
u/ThePracticalEnd Mar 13 '25
Love this!
1
u/Dicecreamvan Mar 12 '25
That’s awesome, but the script doesn’t seem to run from my lock screen, only on home screen. Any help here?
1
u/overnitepartsfromjpn Mar 12 '25
Mine is just showing up in 1 square icon space, rather than full width. Any idea what I might be doing wrong?
1
u/mtrueman Mar 13 '25
Looks like your api is failing maybe. All I get this morning is a white box after it was working fine last night.
1
u/vlad_0 Mar 13 '25
Very nice.
Which widget is the one on the left with the lights /temp ?
1
u/kukaz00 May 02 '25
It now shows Error: The network connection was lost but if I run the script from the app it’s all good
1
u/[deleted] Jan 29 '26
Will the widget also work for the upcoming season? Do we need to adjust things since last year?
2
u/KaiTak98 Mar 13 '25
Great work. Thx.
1
u/Noodles-n00b Mar 13 '25
Nice work - thanks OP!
-1
u/BeneficialPen1557 Mar 13 '25
If you'd like something a little less fiddly, I have an iOS app I maintain called NextGP that has a slew of widgets like this and a bunch of other cool F1 features.
I'll add a Lock Screen weekend schedule widget similar to this today!
https://apps.apple.com/us/app/nextgp-f1-widgets-results/id1638726743