Mojave Dynamic Desktop for PowerPC

Discussion in 'PowerPC Macs' started by G4fanboy, Jun 11, 2018.

Thread Status:
The first post in this thread is a WikiPost, and can be edited by anyone with the appropriate permissions.
  1. G4fanboy, Jun 11, 2018
    Last edited by Julian Marius Fairfax: Jul 22, 2018

    G4fanboy macrumors regular

    Joined:
    Mar 9, 2013
    Location:
    Andalucia Spain
    #1
    This post is a wiki, so if you have the appropriate user range you can edit it.

    The 16 wallpaper pictures from macOS Mojave (or Mac OS X as we like to call it) are in Reddit:

    https://www.reddit.com/r/MacOS/comments/8oz5h5/all_16_full_resolution_macos_mojave_dynamic/

    In the comments, there is a link about an OS X wallpaper changer which allows the system to automatically change wallpapers based on the time of day:

    https://github.com/pipwerks/OS-X-Wallpaper-Changer

    This version was created with the Mojave dynamic wallpaper in mind so it works better with it:

    https://github.com/jonbeebe/MacDynamicWallpaper

    mojave_dynamic_1.jpeg
    --- Post Merged, Jun 11, 2018 ---
    I hope someone can make a script to accomplish the same on PowerPC.
     
  2. Slix macrumors 65816

    Slix

    Joined:
    Mar 24, 2010
    #2
    I'll have to poke around again in AppleScript for this! I have some ideas, but I'll have to refresh my script memories. :p
     
  3. Adamscomputerrepair macrumors 6502

    Adamscomputerrepair

    Joined:
    Aug 9, 2015
    #3
    Isn't there a way to do a slideshow as your background? Or am I thinking of Windows 7 again? I seem to remember being able to time when new pictures would be on the desktop.
     
  4. AphoticD macrumors 68000

    AphoticD

    Joined:
    Feb 17, 2017
    Location:
    Australia
    #4
    You certainly can. But the only option is to set the delay between changing the picture (e.g. 5 sec, 30 sec, 30 mins, etc etc). This would work for the dynamic desktop series if it were manually reset at the same time each morning, but I believe the AppleScript above handles pictures labeled for specific periods of the day like “early afternoon” and then syncs the images to the appropriate time frame.
     
  5. z970mp macrumors 65816

    z970mp

    Joined:
    Jun 2, 2017
    #5
    Just cleaned up the WikiPost, improved the grammar and punctuation.

    Made the sentence structuring a little clearer to understand too.

    G4, could you please change the title to display "Mojave"? "Mohave" is what it sounds like, but it isn't how it's spelled. Thank you.
     
  6. Slix macrumors 65816

    Slix

    Joined:
    Mar 24, 2010
    #6
    Awesome! I'm working on combining a script I found online to change wallpapers in a shorter amount of code and the one you posted.

    Does anyone know the exact times that Mojave's dynamic wallpapers change? I'm looking for hours (for example, 1pm to 3pm it's x.jpeg).
     
  7. AphoticD macrumors 68000

    AphoticD

    Joined:
    Feb 17, 2017
    Location:
    Australia
    #7
    I tried getting Mojave beta to run in VMWare Fusion. It installed okay but just doesn’t want to get to the setup assistant on its first run... if it does eventually load, I’ll let you know!
     
  8. Slix, Jun 18, 2018
    Last edited: Jun 25, 2018

    Slix macrumors 65816

    Slix

    Joined:
    Mar 24, 2010
    #8
    Well, I don't have the exact times that the Mojave dynamic wallpapers change, but I did something anyway. :p

    Here is my AppleScript, it's pretty simple, and the comments explain a little more if you guys are confused. I called it "DynamicWallpaper.scpt" and I put it in my Documents folder.

    Code:
    (*Get current time in hours.*)
    
    set h to hours of (current date)
    
    (*Set the wallpaper number based on the hour of day.*)
    
    if (h < 4) then
    	set wallpaper to "16"
    else if (h ≥ 4 and h < 5) then
    	set wallpaper to "1"
    else if (h ≥ 5 and h < 6) then
    	set wallpaper to "2"
    else if (h ≥ 6 and h < 7) then
    	set wallpaper to "3"
    else if (h ≥ 7 and h < 9) then
    	set wallpaper to "4"
    else if (h ≥ 9 and h < 11) then
    	set wallpaper to "5"
    else if (h ≥ 11 and h < 12) then
    	set wallpaper to "6"
    else if (h ≥ 12 and h < 13) then
    	set wallpaper to "7"
    else if (h ≥ 13 and h < 14) then
    	set wallpaper to "8"
    else if (h ≥ 14 and h < 15) then
    	set wallpaper to "9"
    else if (h ≥ 15 and h < 16) then
    	set wallpaper to "10"
    else if (h ≥ 16 and h < 18) then
    	set wallpaper to "11"
    else if (h ≥ 18 and h < 19) then
    	set wallpaper to "12"
    else if (h ≥ 19 and h < 20) then
    	set wallpaper to "13"
    else if (h ≥ 20 and h < 21) then
    	set wallpaper to "14"
    else if (h ≥ 21 and h ≤ 23) then
    	set wallpaper to "15"
    end if
    
    (* Change the wallpaper here. Change the file path to another directory if you have different folders. *)
    
    tell application "System Events"
    	tell every desktop
    		set picture to "~/Documents/Apple/mojave_dynamic/mojave_dynamic_" & wallpaper & ".jpeg"
    	end tell
    end tell
    
    I also am including my launchd plist file to automatically run the script every hour (since apparently Cron is deprecated in High Sierra). I don't know yet if this works on PowerPCs, but give it a go! Call the file "com.applescriptwallpaper.change.plist". You put the plist file (be sure to change the plist file name and string for the script file path accordingly) in ~/Library/LaunchAgents/.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>Label</key>
        <!-- The label should be the same as the filename without the extension -->
        <string>com.applescriptwallpaper.change</string>
        <!-- Specify how to run your program here -->
        <key>ProgramArguments</key>
        <array>
            <string>osascript</string>
            <string>/Users/name/Documents/DynamicWallpaper.scpt</string>
        </array>
        <key>RunAtLoad</key>
            <true/>
        <!-- Run every 15 minutes -->
        <key>StartInterval</key>
        <integer>900</integer><!-- seconds -->
    </dict>
    </plist>
    
    And then you run the commands in the Terminal to start the launchd command:
    Code:
    cd ~/Library/LaunchAgents/
    launchctl load com.applescriptwallpaper.change.plist
    
    I should also note, that if you want to remove this launchd command, enter these commands before deleting the plist file, for good measure.
    Code:
    cd ~/Library/LaunchAgents/
    launchctl unload com.applescriptwallpaper.change.plist
    
    I hope this helps someone! I had to dig around A LOT to find all the answers on how to run AppleScripts automatically without Cron, so here ya go. :D I found a lot of my answers here: https://apple.stackexchange.com/que...at-a-specific-time-on-a-weekday/249452#249452
     
  9. AphoticD macrumors 68000

    AphoticD

    Joined:
    Feb 17, 2017
    Location:
    Australia
    #9
    Well done Slix! I'll download the images and have a play on Tiger.
     
  10. Slix macrumors 65816

    Slix

    Joined:
    Mar 24, 2010
    #10
    Thanks for the support you guys! I fixed up a minor bug in the AppleScript code (some of the hours of the day were missing!). I also tried it on Tiger, and I had to make some adjustments, but they're minimal:

    Change the bottom "change wallpaper here" code to this (must be a Script/Mac OS X change issue):
    Code:
    tell application "Finder"
    	set desktop picture to {"HDname:Users:username:Documents:Apple:mojave_dynamic:mojave_dynamic_" & wallpaper & ".jpeg"} as alias
    end tell
    
    Glad to see this works. I'm enjoying using it so far!
     
  11. jbarley macrumors 68040

    jbarley

    Joined:
    Jul 1, 2006
    Location:
    Vancouver Island
    #11
    Is the code change shown above for the Tiger "minimal" change you mention or is it for the script in general?
     
  12. swamprock macrumors 6502a

    swamprock

    Joined:
    Aug 2, 2015
    Location:
    Michigan
    #12
    Tiger. I tested the script in both Tiger and High Sierra and the change is meant for Tiger. Not sure if it works with Leopard yet (haven't tested it), or whether the change is also meant for Leopard.
     
  13. Slix, Jun 19, 2018
    Last edited: Jun 19, 2018

    Slix macrumors 65816

    Slix

    Joined:
    Mar 24, 2010
    #13
    Tiger only. (As far as I know.)

    I'm now having issues with the script auto running with launchd on Tiger after wake, so I don't know if it's because of how launchd works on older version, but as far as I can tell, it still works on High Sierra. I changed the StartInterval time to 900 (15 minutes) on Tiger because of that. Might be smart to have it run that often on other machines too, just so it stays up to date if the computer is asleep for a while.

    Is anyone having good results with launchd and this set up so far?

    EDIT: Looks like the way launchd works is that it will run after the next scheduled time if the computer is asleep, and stores those tasks in a "queue". Interesting. The wallpapers then change after a short time of being awake (but it is slightly jarring having it be dark and then suddenly light, for example, when it's daytime now. :p).

     
  14. jbarley macrumors 68040

    jbarley

    Joined:
    Jul 1, 2006
    Location:
    Vancouver Island
    #14
    This one is for "Slix", is there a reason for this duplicate line of code in your script?
    Sorry to ask but I'm not savvy enough to understand why it is there.

    Screen Shot 2018-06-19 at 4.16.25 PM.png
     
  15. Slix macrumors 65816

    Slix

    Joined:
    Mar 24, 2010
    #15
    Probably because I was tired when I was writing this, and that's what copy pasting code does to you. XD Thanks for pointing it out, I'll fix it up and update the original post!

    I also went ahead and tweaked the times to make them a little more inline with common sunrise and sunset times, and the middle of the day image now aligns better with noon. I also updated the original post with those update times in the code.
     
  16. jbarley, Jun 19, 2018
    Last edited: Jun 19, 2018

    jbarley macrumors 68040

    jbarley

    Joined:
    Jul 1, 2006
    Location:
    Vancouver Island
    #16
    LOL...
    been there - done that.:D

    For some reason or another I cannot get your .plist file to fire the script for me, so I came up with this solution which works well.
    I compiled your "DynamicWallpaper.scpt" into an App.

    Then I came up with this script which is also complied into an App with the "Stay Open flag set",
    installed it in my Login items so it runs when I start up.
    This App runs the "DynamicWallpaper" App every 15 minutes, (this time period can be changed)
    Finally I choose to hide this running app from my Dock using a little utility called "DockLess"
    Works like a charm, takes only a second to update things every 15 minutes.
    I'm betting someone wiser then I could incorporate something like this code snippet into your script so as to have a single self looping file. Seems the "Idle" command is the magic bullet.
    Good info here, but it somehow gets short circuited by my thick skull.:(
    https://macscripter.net/viewtopic.php?id=24568
    ---------------------------
    on idle
    tell application "System Events"
    tell application "/Applications/DynamicWallpaper .app"
    run
    end tell
    return 900
    end tell
    end idle

    ----------------------------
     
  17. z970mp, Jun 19, 2018
    Last edited: Jun 19, 2018

    z970mp macrumors 65816

    z970mp

    Joined:
    Jun 2, 2017
    #17
    I've come to the carefully considered conclusion that everybody here is tired when writing posts - myself almost constantly.

    ...Maybe that's what happens when most of western population is desperately deprived of precious sleep...

    ...You have to wonder, what would have happened if civilization never progressed past the point of hunting/gathering food for your family and creating bonds with your community instead of the current model of critical incentives to earn enough money to support yourself and future generations... ...To instead proceed life the way the planet intended it to be, so we would be swimming in sleep and possible good health instead of long-term stress...

    ...But then again, if we lived that way for tens of thousands of years and never progressed as a society, we may be inadvertently dooming the ultimate fate of the human species. We would never transcend planets, for example, or discover cures to deadly diseases.

    Well damn, now I've gone and turned a simple thread about AppleScripts into contemplation of various forks in societal paths (plus ramifications) of which the human species could have taken long ago.

    ...But I suppose that's what happens when you write posts when you're tired...

    Eh.

    In any case, goodnight all.
     
  18. Slix macrumors 65816

    Slix

    Joined:
    Mar 24, 2010
    #18
    Another good solution! I avoided the application route because I didn't want an app showing up in my dock and running and closing and stuff every so often.

    (I also fixed another bug with the times I changed last night - the first if statement was wrong, so it now works, see if that fixes your plist issue!)
     
  19. jbarley, Jun 20, 2018
    Last edited: Jun 20, 2018

    jbarley macrumors 68040

    jbarley

    Joined:
    Jul 1, 2006
    Location:
    Vancouver Island
    #19
    "Dockless" takes care of that for me nicely.
     
  20. jbarley macrumors 68040

    jbarley

    Joined:
    Jul 1, 2006
    Location:
    Vancouver Island
    #20
    Finally figured out how to get it all together and working in one AppleScript.
    Using Slix's script as a starting point, and adding the idle commands, saving it as an Application with the stay open flag set, and it runs just fine.
    As I mentioned earlier I use a utility called "Dockless" to hide the App from my Dock to keep things neat and tidy.
    The Application runs from my Login items each time I start up the computer.
    For my own use I narrowed the time periods down to 6, I just prefer it this way.
    In closing I'd like to thank those who started and contributed to this thread, and for forcing me to find a way to achieve what I wanted, who was it that said "you can't teach an ole dog new tricks".:D

    -------------------------------
    on idle

    (*Get current time in hours.*)

    set h to hours of (current date)

    (*Set the wallpaper number based on the time of day.*)

    set wallpaper to "13"
    if (h ≥ 8 and h < 12) then
    set wallpaper to "3"
    else if (h ≥ 12 and h < 15) then
    set wallpaper to "8"
    else if (h ≥ 15 and h < 18) then
    set wallpaper to "9"
    else if (h ≥ 18 and h < 21) then
    set wallpaper to "11"
    else if (h ≥ 21 and h < 8) then
    set wallpaper to "13"
    end if

    (* Change the wallpaper here. Change the file path to another directory if you have different folders. *)

    tell application "System Events"
    tell every desktop
    set picture to "~/Pictures/mojave_dynamic/mojave_dynamic_" & wallpaper & ".jpeg"
    end tell
    return 900
    end tell
    end idle
    --------------------------------
     
  21. pochopsp macrumors 6502

    pochopsp

    Joined:
    Apr 6, 2016
    Location:
    Napoli, city of sun and pizza!
    #21
    So nice @jbarley ! I followed your instructions and it worked like a charm! 3 pm here in Italy and I got the afternoon Mojave wallpaper :D the app is running in the background without taking space in the Dock
    Immagine 2.png
     
  22. AL1630 macrumors 6502

    AL1630

    Joined:
    Apr 24, 2016
    Location:
    Idaho, USA
    #22
    Very nice! I tested it out and customized it a little bit, and it looks great on my TiBook. One of my favorite parts of this forum is the projects people come together and do to keep PPC feeling fresh. Combine this with one of the Sierra Themes and you could claim it's running the Mojave beta! :D
     
  23. z970mp, Jun 23, 2018
    Last edited: Jun 23, 2018

    z970mp macrumors 65816

    z970mp

    Joined:
    Jun 2, 2017
    #23
    That's what happens when everyone puts a little elbow grease into it. Amazing what some groupwork can do.

    Though I still think Mountain Leopard is far more convincing.
     
  24. Slix macrumors 65816

    Slix

    Joined:
    Mar 24, 2010
    #24
    @jbarley: Nice work! I didn't know about the idle command!

    @pochopsp: You're on Leopard, did you have to use the modified AppleScript I posted for setting the wallpaper itself for Tiger? Or does the "tell every desktop" commands work on Leopard?

    @AL1630: I agree! It's really neat to see everyone coming together to make this type of thing happen.
     
  25. pochopsp macrumors 6502

    pochopsp

    Joined:
    Apr 6, 2016
    Location:
    Napoli, city of sun and pizza!
    #25
    @Slix I just copied the code written by jbarley in a new apple script (modifying the directory address for the wallpapers), saved as bundle application with the option "don't quit" flagged, and it worked
     
Thread Status:
The first post in this thread is a WikiPost, and can be edited by anyone with the appropriate permissions.

Share This Page