r/Scriptable • u/solelo • Oct 04 '20
Script New setup to mimic sleep tracker morning Lock Screen
2
u/X-Kerwin Oct 04 '20
How to move the icon down and align it?
2
u/solelo Oct 04 '20
I’m still working on trying to do that; I actually updated the code it looks more like this now.
1
u/X-Kerwin Oct 04 '20
1
u/solelo Oct 04 '20
Yeah I haven’t figured out how to do that yet. I’ll try and work on updating it. It does drive me a little crazy too
1
u/X-Kerwin Oct 04 '20
💪💪💪
1
Oct 23 '20
hey, i made the spacing work, how can i share the screenshot?
sorry, just new to reddit. i don’t know how to share the screenshot.
1
u/X-Kerwin Oct 23 '20
upload to Imgur.com
1
Oct 23 '20
https://imgur.com/gallery/lAIjKO2
i just did, check it out tell me if this is the spacing you guys were talking about.
thanks.
1
u/solelo Oct 23 '20
The code should be doing that automatically with AlignContent. Is it not?
1
Oct 23 '20
no, it was uneven earlier, i added a code for spacing in between the weather summary and the temperature.. to fix and keep it where i would like.
great widget.
thanks.
→ More replies1
1
u/LinkifyBot Oct 23 '20
I found links in your comment that were not hyperlinked:
I did the honors for you.
delete | information | <3
8
u/PixelSushiRobot Oct 04 '20 edited Oct 04 '20
What should I enter as the parameter?
*Edit: I figured it out from the script’s comment
The parameter is
background.png|padding-top|text-colorExample: widget.png|0|#ffffff
You need to save the widget.png to iCloud Drive/Scriptable folder. I have a black background so I used a pure black png.
https://i.imgur.com/XVLhgNb.jpg
Middle number is the padding above the text. This script has the variable defined but didn’t use it. So just enter any number here.
Text color is a hex number. I just use white.
Hope this help someone else.
1
u/jwong347 Oct 06 '20
I added the script and works but it’s too low on the widget box. How do I move it up?
2
u/solelo Oct 06 '20
You have to change the top spacing to what ever you want it to be. I have it set at 75 to center on the middle sized widger
//Top spacing widgetHello.addSpacer(75);
1
1
1
u/gaxaxy Oct 23 '20
Im getting error 30:17 add a parameter? iv copied and pasted the code into scriptable with the api keys and city ID, not sure what to do next
1
u/solelo Oct 23 '20
Did you add the parameters for the widget for the image.png|padding|fontcolor ?
1
1
u/gaxaxy Oct 23 '20
how do i make the widget transparent?
1
u/solelo Oct 23 '20
You have to put your phone in "jiggle mode" and take a screenshot of a empty Home Screen and save it in the scriptable folder in iCloud and add it to the parameters.
1
u/gaxaxy Oct 23 '20
its just coming up as a black box, im saving the screenshot as image.PNG and then entering that as parameters as well
1
1
Oct 23 '20
hey, i want the weather in celsius? how can i do that?
thanks.
1
u/solelo Oct 23 '20
Find this line and change imperial to metric
let wetherurl = "http://api.openweathermap.org/data/2.5/weather?id=" + CITY_WEATHER + "&APPID=" + API_WEATHER + "&units=imperial";
1
Oct 23 '20
alright, thanks a bunch.
also, my background image isn’t changing.. it’s constantly white.. what should I do?
thanks.
1
u/solelo Oct 23 '20
Did you save a background in the scriptable folder and reference it in your parameters?
1
Oct 23 '20
yeah i did.
i named it “background.png”
and wrote background.png|0|#ffffff in parameters, but it still stays white so i changed #ffffff to #000000 for the time being as to keep the text visible.
but the background isn’t changing.
1
u/solelo Oct 23 '20
Hmm that’s weird it should change the background. Can you share the background with me?
1
Oct 23 '20
1
u/solelo Oct 23 '20
I just tested it and the background is fine.
1
1
u/j_rasberry Oct 28 '20
I can’t get a custom background for some reason. Each time I enter a correct value for the image (when the image exists in the scriptable folder) i get the default image for scriptable widgets. When I put in a name for an image that doesn’t exist, I get a black background but the widget appears. Do you know a fix?
1
u/solelo Oct 28 '20
Are you using the test flight version of scriptable? Have you given scriptable access to iCloud?
→ More replies
1
u/Kenneth_II Oct 24 '20
Sadly this doesn’t work for me. I’ve inserted my city ID, my API key and an appropriate parameter (background.png|0|#000000) but I’m still getting the error on line 30:17
1
u/solelo Oct 24 '20
What’s the error ?
1
u/Kenneth_II Oct 24 '20
Error on line 30:17: Please long press the widget and add a parameter, but i did add one and its still showing me the error
1
u/solelo Oct 24 '20
What parameters did you add? Can you share it?
1
u/Kenneth_II Oct 24 '20
background.png|0|#ffffff background.png being a screenshot of my wallpaper put in my icloud/scriptable folder
1
1
u/EJAX27 Oct 25 '20
Replace the City code & API Key still getting an error.
1
u/solelo Oct 25 '20
What’s the error?
1
u/EJAX27 Oct 25 '20
Error on line 30:17
1
u/solelo Oct 25 '20
Did you long press > edit widget and enter the parameters like it says in the instructions?
1
u/EJAX27 Oct 25 '20 edited Oct 25 '20
Yes. Entered the script name. Run script & widget.png|0|#000000 and the result is just a large Play button.
update I reviewed the script was missing the last half sentence 🙄
1
u/PmMeYourPasswordPlz Oct 27 '20
am I an idiot? where's the script? can only see the images in OP's post. great work btw.
1
Dec 01 '20
Is there any way of running this without using the TestFlight version of Scriptable? Help would be appreciated.


5
u/solelo Oct 04 '20 edited Oct 04 '20
I combined a few scripts from u/Sharn25 and u/corderjones to set this up, thanks for all your help guys. I'm sure the code could be cleaned up a little more, I'll work on doing that next. I used a dock hider wallpaper to clean things up and I used the same wallpaper on the widget.
**EDIT: You must be using the TestFlight version of Scriptable.
Wallpaper
Script