Change desktop picture from command line ???

Discussion in 'Mac Apps and Mac App Store' started by JupiterZen, Aug 9, 2003.

  1. JupiterZen macrumors regular

    Joined:
    Jul 17, 2002
    Location:
    Reality Maingrid 23 Subjunction 42A
    #1
    Is there a way to change the desktop picture from the command line in OS X?

    If someone knows how to do this (or if it can't be done, but I doubt that ;-) I would really appreciate it.
     
  2. Mr. Anderson Moderator emeritus

    Mr. Anderson

    Joined:
    Nov 1, 2001
    Location:
    VA
    #2
    I think you can do it from Apple Script - try doing a search on this.....

    But I remember way back in the day at school when we were using Unix boxes (12 years ago) and we could remotely log in and post a pic on someone else's screen in the lab. ;)

    D
     
  3. JupiterZen thread starter macrumors regular

    Joined:
    Jul 17, 2002
    Location:
    Reality Maingrid 23 Subjunction 42A
    #3
    Remotely changing the desktop was exactly what I was planning to do ... ;)

    I'm not that familiar with Apple Script, but I figure you can execute scripts from the command line. I will probably be able to figure that out ;)

    Thanx, I'm off searching ...
     
  4. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #4
    I know a crude trick that works, even without AppleScript. I'm sure there is a better way to do this, but I'll report this method.

    1. Create a new folder that will hold the current desktop picture, e.g., "Desktop Picture" in your home folder.

    2. Copy a single image, e.g., ~/Pictures/sunset.jpg, to the folder from Step 1. Give it a generic name, e.g., picture.jpg.

    3. In the "Desktop" preference pane, pick Collection: "Choose Folder..." and select the folder from Step 1. Turn "Change Picture" on and set a time, e.g., "every minute". I don't think it matters whether or not you pick "Random order".

    4. Anytime you want to change desktop pictures, copy the new picture over the file from Step 2, e.g.,

    cp "~/Pictures/mydog.jpg" "~/Desktop Picture/picture.jpg"

    When the time you picked in Step 3 is next up, the desktop picture will change. You could even make a shell script to do the command from Step 4, e.g.,

    setdtp mydog
     
  5. JupiterZen thread starter macrumors regular

    Joined:
    Jul 17, 2002
    Location:
    Reality Maingrid 23 Subjunction 42A
    #5


    Sounds like a good option ;) I'm gonna try this one.

    Thanx ...
     

Share This Page