Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Change the login window background picture - revisited Desktop
As I found out in some forums (i.e. this ancient Mac OS X Hint), the common way to change the login window's background picture is to replace the Aqua Blue.jpg in /Library » Desktop Pictures with your own image. However, there's a more elegant way to do this: by adding a value to the appropriate plist file, namely /Library » Preferences &raquo com.apple.loginwindow.plist. You can do this in two ways, either with a Terminal command or by directly editing the plist file using Property List Editor from the Xcode package.

Terminal solution:

Open Terminal and type these two commands (the $ is the command prompt; don't type that):
$ sudo -i
$ defaults write /Library/Preferences/com.apple.loginwindow \
DesktopPicture '/path/to/replacement/image/file.jpg'
Replace the /path/to... bit with the full path and filename of the image you'd like to use.

Property List Editor solution:

Launch Property List Editor (in /Developer » Applications » Utilities), and then open the com.apple.loginwindow.plist file from /Library » Preferences. Add a New Sibling of class String with the name DesktopPicture. In the Value column, enter the complete path to the new image you want to set as the login window backgroung image. For example, you'd use this...
/Library/Desktop Pictures/Plants/Agave.jpg
...to use the Apple-supplied agave plant picture. Please keep in mind that you need the correct user permissions to edit the plist file; save the changes and quit the editor when done. After using either method, log out and you should see your new login window background picture.

I found out that this was possible by exploring the /System » Library » CoreServices » SecurityAgentPlugins » loginwindow.bundle » Contents » MacOS » loginwindow executable in detail.
    •    
  • Currently 3.00 / 5
  You rated: 1 / 5 (9 votes cast)
 
[111,225 views]  

Change the login window background picture - revisited | 14 comments | Create New Account
Click here to return to the 'Change the login window background picture - revisited' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Change the login window background picture - revisited
Authored by: neuralstatic on Jun 14, '07 08:14:37AM
this and much more in a minimal gui from mike bombich: loginwindow manager. i use it for log in hooks but it does backgrounds, and a whole lot more.

http://www.bombich.com/software/lwm.html



[ Reply to This | # ]
Change the login window background picture - revisited
Authored by: jackb79 on Jun 14, '07 08:29:23AM

Yeah but this way is over complicated. I just like renaming the Aqua Blue to Aqua Blue Copy and placing a new one in its place. Takes less than a minute and I'm satisfied



[ Reply to This | # ]
Change the login window background picture - revisited
Authored by: kyngchaos on Jun 14, '07 02:40:14PM

Not all that complicated, really. And safer. Messing around with system files is not a good idea - as easy as it is to do the deed, it's also easy for something to go wrong. And a future OS update may overwrite it, so you'll have to do it again, while a preference setting should stick thru an update.



[ Reply to This | # ]
Change the login window background picture - revisited
Authored by: teflonall on Jun 14, '07 08:45:57AM

i tried the command but terminal keeps asking for password but when i try to enter one it does not respond to anything but enter

what do i do?



[ Reply to This | # ]
Change the login window background picture - revisited
Authored by: neuralstatic on Jun 14, '07 10:40:55AM

if i understand your concern....when you enter a password, you won't see characters echoed to the screen. just type in the right password and hit enter.

but if you're not a terminal person, just use the gui, or creat a new aqua blue.jpg



[ Reply to This | # ]
Change the login window background picture - revisited
Authored by: glusk on Jun 14, '07 02:43:49PM

Thanks for this. I've always thought this was possible but never figured it out. I'd much rather edit the preference than replace the standard file.

G



[ Reply to This | # ]
Change the login window background picture - revisited
Authored by: stormen on Jun 14, '07 08:43:17PM
I have been looking for something like this for a while and it runs great.
The only problem I ran into is that I was not getting my background to show up from my /Users/"myusername"/Pictures folder. This is a simple fix.
Go to the "Get Info" and change the permissions for "Group" and "Others" to read only.
And there displaying my selected image without changing the Aqua Blue.jpg image.

I also wrote this AppleScript to make the process quicker.... only have it selecting images from you /Users/"Your user name"/Pictures folder

--Created by Stormen
--Email address: Stormen81@gmail.com
--Created Date: June 14, 2007
--Modified Date:
--License: Freeware
----------------------------------------
-- Get current loged in user
tell application "System Events" to set c_user to name of current user
-- set the image path
set image_path to "Users:" & c_user & ":Pictures"
-- List all the images
tell application "System Events" to set pic to the name of every file in folder image_path
-- user gets to choose the image he/she wants
set chosen_pic to (choose from list pic)
-- if the user presses cancle exit the script
if chosen_pic is not false then
	-- set the whole user path with pic at the end
	set ThePic to "/Users/" & c_user & "/Pictures/" & chosen_pic
	-- set the shell script for the user
	set runme_s to "sudo defaults write /Library/Preferences/com.apple.loginwindow \\DesktopPicture '" & ThePic & "'"
	-- user must enter the root password for the shell
	set inpwd to display dialog "Enter Root password " default answer "" with hidden answer
	-- if the user presses cancle exit the script
	if inpwd is not false then
		-- set the user password
		set pwd to text returned of inpwd
		-- run the shell command
		do shell script runme_s password pwd with administrator privileges
	end if
end if

I have this script running..... it is a little less painless than copy a file and changing 2 file names.

Later
Stormen

[ Reply to This | # ]
Change the login window background picture - revisited
Authored by: daleminter on Jun 15, '07 02:20:28AM

This is fantastic as you can rollout the preference using WGM in OS X Server. Change the setting once under WGM, on next login all uses get a new background.

I would suggest using ARD to push out new background pics to the clientst too.

---
Tecsol Limited
Auckland, New Zealand
www.tecsol.co.nz



[ Reply to This | # ]
Change the login window background picture - revisited
Authored by: reppert on Jun 15, '07 04:57:51AM

Or you could go the really easy route and use Mike Bombich's Login Window Manager. That's what I use to change the desktop login window background.



[ Reply to This | # ]
Change the login window background picture - revisited
Authored by: tirerim on Jun 15, '07 09:06:06AM
There's no reason to use sudo -i for just one command—that gives you a fully interactive root shell, which you will then have to exit afterwards. It's safer to just do

$ sudo defaults write /Library/Preferences/com.apple.loginwindow \
DesktopPicture '/path/to/replacement/image/file.jpg'


which will only execute that single command as root.

[ Reply to This | # ]
Change the login window background picture - revisited
Authored by: krunk7 on Nov 08, '07 10:44:42AM

This hint does not work for me. I have tried:

  • Executing command as sudo defaults write....
  • dropping into root shell (sudo -i) then executing
  • opening plist as root (sudo open /Library/Preferences....)
  • opening plist from root shell (sudo -i, then open /Library/Preferences)
The first two execute without error, but no changes to plist are made. The second two throw a permissions error on save. I have checked the plist permissions and root does have write permissions.

[ Reply to This | # ]
Fixed
Authored by: krunk7 on Nov 08, '07 11:09:09AM

Error corrected, you can't open and edit the plist via gui. However, when executing the defaults write, I tab completed the plist name... creating a file with a .plist.plist extension. Correcting the command worked.



[ Reply to This | # ]
Change the login window background picture - revisited
Authored by: chrisfender1 on Sep 05, '08 07:40:40PM

Just want to let every one know that it is not a jpeg that you are changing it's a .tiff and it has to be a pic that is 90 by 90 otherwise system pref cuts it out
there is an easier way to do this, is to go to system>library>core services>open file contents of loginwindow.app>contents>resources>MacOSX.tiff
replace that with any .tiff and then simply remove loginwindow.plist in ~>library>preferences>com.apple.loginwindow.plist and then run this in terminal "killall Dock"
it's much safer because you are authenticating a file as a registered user and you are not bypassing security rot files since you authenticate.
That's pretty much how you change any pic for the mac os core services: find the picture format replace it with yours, delete its .plist and then kill the Dock. (killing the dock resets critical system files that need to run while you are logged in, a crash identifier will run, create a new plist and then associate all the pix to its destined location)
have fun mac peops ;)



[ Reply to This | # ]
Change the login window background picture - revisited
Authored by: hints_hinterton on Sep 30, '11 03:25:13PM

Original terminal tip worked for me under 10.5.8 although not at first.
I did
[code]sudo defaults write /Library/Preferences/com.apple.loginwindow DesktopPicture '/path/to/replacement/image/file.jpg'[/code]

You do need the quotation marks around your file path.
I don't know if you need to pre-size your image to 2560x1600@72dpi but that's what the default image is.

I think what finally did the trick was setting the permissions on both the image and enclosing directory to be world/group/other readable. You don't really want to muck with permissions on a system level folder but if it's your own creation, it should be alright. You should be able to use the Get Info permissions area to take care of this. For the Terminal savvy, I assigned both image and directory to be owned by root:admin, set directory to 775 and image to 644 but I'm sure other combinations will work.



[ Reply to This | # ]