Setting a custom desktop for all users the first time they login to an iMac...

psherotov
Contributor

Dear Jamf Community,

I've created a custom desktop wallpaper and have there components: 

1.) Desktoppr

2.) A LaunchAgent plist

3.) A shell script that the launch agent calls

Owner and permissions are correctly set: root:wheel 644 for launch agent and script. 

Locations:

Launch Agent is is: "/Library/LaunchAgents" 

Script in is in "/Library/Scripts"

Desktoppr is installed in default location

Location of wallpaper: "Library/Desktop Pictures/" 

Here is the plist and the script:
PLIST

<?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>
    <string>com.BoltonCSD.set-wallpaper</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Library/Scripts/set_wallpaper.sh</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>StandardOutPath</key>
    <string>/var/log/set-wallpaper.log</string>
    <key>StandardErrorPath</key>
    <string>/var/log/set-wallpaper-error.log</string>
</dict>
</plist>

 Script:

#!/bin/bash

# Wait for 10 seconds
sleep 10

# Set the desktop wallpaper using desktoppr
desktoppr "/Library/Desktop Pictures/Mascot_Logo_new.tif"

# Set the scale of the wallpaper using desktoppr
desktoppr scale center

# Set the background color using desktoppr
desktoppr color 294826

 
What would be the best way to push this out so that users have this set when they login? Please be specific about settings :-)

Thanks!
Phil

1 ACCEPTED SOLUTION

psherotov
Contributor

@AJPinto I tried what you recommended and it worked this time, not sure why it wasn't working before. I the only difference is I placed the wallpaper in /Users/Shared/ before.

However, just as a point of interest I did get the other method to work, but obviously it was a LOT more work doing it the second way :-) 

View solution in original post

5 REPLIES 5

psherotov
Contributor

Just wanted to add that I typically put them in the correct locations on my computer and confirm the correct permissions and ownership then use Composer to create packages.

I had tried installing the wallpaper in "/Users/Shared/" and using the built in config profile in Jamf Pro (specifying the path) but that didn't work for some reason. In any case, something odd that I observed was there was a color band at the top and bottom when I had scale set to center, even though I took care to make the wallpaper the size of Apple's wallpapers: 4480x2520. Using Desktoppr I was able to fix it by adding the background color after converting the RGB to a Hex string. 

AJPinto
Honored Contributor II

Usually you just use a package to push the image you want to the device, then a configuration profile telling the devices to use that image as the wallpaper. I would not try to do this though CLI.

 

AJPinto_0-1695049247541.png

 

psherotov
Contributor

@AJPinto I tried what you recommended and it worked this time, not sure why it wasn't working before. I the only difference is I placed the wallpaper in /Users/Shared/ before.

However, just as a point of interest I did get the other method to work, but obviously it was a LOT more work doing it the second way :-) 

AJPinto
Honored Contributor II

I dont think I have ever tried to put wallpapers in any location other then Library. There is a chance macOS is configured to not accept other locations, but I have not tested that theory. 

The easy ways rarely teach us anything :). 

 

If you are fixed, you can mark this post as resolved. Others may come across it and find it helpful if they know the issue was fixed.

psherotov
Contributor

Well, I suppose that's a good way to look at it, but life is short and I'd rather avoid baroque solutions when a simple one will do :-) Still good to know that /Library is the best place for desktop wallpapers