Home Forums OS X Server and Client Discussion Questions and Answers Local MCX & Desktop images

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #377170
    mlinde
    Participant

    Ok, so I have a setup with Local MCX that places a desktop image using the plists. Here’s the oddity. Every Friday the desktop image changes in our environment (yeah, I know). So I wrote a script that downloads the new image and replaces the old one – it has the same name so it should just update, right?

    No. The source image is updated, but the image on the user desktop is not updating. I know it’s cached somewhere, and I’ve been looking but does anyone know where the cached image is, so I can delete it in my script, and it will create a new cached image based on the default?

    Thanks…

    #377215
    mlinde
    Participant

    – bump –
    No one has to manage the desktop image?

    So now I will ask for troubleshooting help again, this one specific to how the preference editor works when utilizing/importing local preferences. Here’s the scenario, if anyone can help (even if you just tell me I’m doing it all wrong) I’d appreciate it.

    I am supposed to swap out the desktop image every week with a new image from Marketing.
    All machines should show the same desktop image.

    So I have a magical shell script that connects to a login folder on our DC, and downloads the appropriate file every week. The filename does not change (it’s always Wallpaper.bmp – yes, it’s being done to match the Windows setup) so I just overwrite the file (which I’ve placed in /Library/Desktop Pictures/) every week with my script. All of that works fine – if I check the image in the directory, it’s been overwritten with the new one. However, the desktop doesn’t change. If I log into the machine with a new account (never logged in before) it still shows the old image, so I broke something with my Local MCX management. I’m sure it’s reading a cached image from somewhere, but I have no idea where. I’ve deleted the contents of /Library/Caches, of ~/Library/Caches, I’ve deleted ~/Library/Preferences/com.apple.desktop.plist, but all of this fails to update the image.

    If I use System Preferences to try and change the Desktop Picture, it changes in the little preview window, but the desktop never changes. I broke it. Bad. Please help.
    Could really use some fresh ideas – thanks!

    #377218
    blake
    Participant

    I have a shell script that downloads a webcam image every 5 minutes and updates the desktop pattern. Here is the code I use to update the desktop.

    [code]
    dtpat=/Files/images/stevens.jpg
    osascript -e “set ufsdtpath to do shell script \”echo $dtpat\”” \
    -e “set hfsdtpath to POSIX file ufsdtpath” \
    -e “tell application \”Finder\”” \
    -e “set desktop picture to hfsdtpath” \
    -e “end tell”
    [/code]

    You can simplify this if you just want to hardcode in the HFS path.

    Blake

    #377230
    mlinde
    Participant

    Thanks – are you using MCX to manage the desktop image as well?

    I’m worried that my management is affecting my ability to update the image, as I can’t change the desktop image at all (even the ever-present option from Safari does not change it).

    Anyone have these two sorts of things working together?

    #377330
    mlinde
    Participant

    So I’ve determined that using Local MCX management somehow locks the image to some cached file, whatever the desktop image was when the user first logs in. I’ve tried deleting all the preferences and caches I am aware of, and still couldn’t change it until I disabled the Local MCX settings.

    Files I deleted in my testing:
    /Library/Managed Preferences/com.apple.desktop.plist
    /Library/Managed Preferences/user/com.apple.desktop.plist
    /Users/user/Library/Caches/Desktop (all contents)
    /Users/user/Library/Managed Preferences/com.apple.desktop.plist
    /Users/user/Library/Preferences/com.apple.desktop.plist

    and it still wouldn’t change.

    I disabled the Desktop Picture preference management in Local MCX and the desktop picture updated immediately on logout/login.

    So I looked at using OSAScript/Applescript as an option, but have run into the positioning issue – if the desktop image is not already set to “Centered” it automatically tiles – which is unacceptable in the environment, sadly. Now I’m looking at having to write a cocoa app to change the desktop picture, as that appears to be the only option for setting the position of the images. Ugh. Does no-one manage desktop images in their environment?

    Thanks…

    #377331
    Greg Neagle
    Participant

    You might be able to do something with PlistBuddy and ~/Library/Preferences/com.apple.desktop.plist.

    Look at Background:default:ImageFilePath and Background:default:Placement

    -Greg

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Comments are closed