Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUT-3757: Deprecate or specify supported OSX version - Template CMD: Set Desktop Background #558

Merged
merged 2 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ EOF

#### Description

NOTE: As of MacOS 12.3 or higher, this command does not work. Please use an MDM configuration profile to deploy wallpapers as a workaround.

The "JumpCloud_Background.png" file is downloaded to the local machine and saved in the folder "/Users/Shared"/

To modify this command to download and set a background image of your choice follow the steps under '*** Customize ***' by updating the backgroundURL and corresponding fileType variables.
Expand All @@ -57,5 +59,7 @@ Import-JCCommand -URL "https://github.com/TheJumpCloud/support/blob/master/Power

#### **Troubleshooting Tips**

NOTE: As of MacOS 12.3 or higher, this command does not work. Please use an MDM configuration profile to deploy wallpapers as a workaround.

Check to see if the file is downloading on the machine by navigating to /Users/Shared folder.
If the image file is not downloading to the machine it is likely that the 'fileType' has not been updated to match the file (png/jpg)
2 changes: 1 addition & 1 deletion PowerShell/JumpCloud Commands Gallery/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"type": "mac",
"command": "## *** Customize ***\n # 1. Update the 'backgroundURL' to the URL of your desired desktop image. A JumpCloud image is used by default.\n backgroundURL=\"https://raw.githubusercontent.com/TheJumpCloud/support/master/PowerShell/JumpCloud%20Commands%20Gallery/Files/JumpCloud_Background.png\"\n # 2. Ensure the 'fileType' matches the file type of the desktop image (change to jpg if using a jpg). 'png' is set by default.\n fileType=\"png\"\n # ------------Do not modify below this line-------------\n date_val=$(date \"+%Y-%m-%d-%H%M\")\n backgroundFile=/Users/Shared/desktopimage_$date_val.$fileType\n curl -s -o \"$backgroundFile\" \"$backgroundURL\"\nread -r -d '' PSCRIPT<<EOF\nfrom AppKit import NSWorkspace, NSScreen\nfrom Foundation import NSURL\n# generate a fileURL for the desktop picture\nfile_url = NSURL.fileURLWithPath_('$backgroundFile')\n# make image options dictionary\n# we just make an empty one because the defaults are fine\noptions = {}\n# get shared workspace\nws = NSWorkspace.sharedWorkspace()\n# iterate over all screens\nfor screen in NSScreen.screens():\n # tell the workspace to set the desktop picture\n (result, error) = ws.setDesktopImageURL_forScreen_options_error_(\n file_url, screen, options, None)\nEOF\n env python -c \"$PSCRIPT\"",
"link": "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Mac%20Commands/Mac%20-%20Set%20Desktop%20Background.md",
"description": "The \"JumpCloud_Background.png\" file is downloaded to the local machine and saved in the folder \"/Users/Shared\"/\n\nTo modify this command to download and set a background image of your choice follow the steps under '*** Customize ***' by updating the backgroundURL and corresponding fileType variables.\n\nThis command used in tandem with the wallpaper modification Mac policy can be used to set and then prevent end users from updating their background.\n\nThis command can be built manually as a Mac command where the 'run-as' user is set to the JC managed user on that machine and can not be executed as the root user."
"description": "NOTE: As of MacOS 12.3 or higher, this command does not work. Please use an MDM configuration profile to deploy wallpapers as a workaround.\n\nThe \"JumpCloud_Background.png\" file is downloaded to the local machine and saved in the folder \"/Users/Shared\"/\n\nTo modify this command to download and set a background image of your choice follow the steps under '*** Customize ***' by updating the backgroundURL and corresponding fileType variables.\n\nThis command used in tandem with the wallpaper modification Mac policy can be used to set and then prevent end users from updating their background.\n\nThis command can be built manually as a Mac command where the 'run-as' user is set to the JC managed user on that machine and can not be executed as the root user."
},
{
"name": "Windows - 64-Bit Command | v1.0 JCCG",
Expand Down
Loading