PDA

View Full Version : Leopard: How to Change the Login Desktop Background


MacBytes
Nov 7, 2007, 08:34 AM
http://www.macbytes.com/images/bytessig.gif (http://www.macbytes.com)

Category: Tips and How To's
Link: Leopard: How to Change the Login Desktop Background (http://www.macbytes.com/link.php?sid=20071107093458)
Description:: none

Posted on MacBytes.com (http://www.macbytes.com)
Approved by Mudbug

redAPPLE
Nov 7, 2007, 01:01 PM
what is exactly the login desktop background?

QuarterSwede
Nov 7, 2007, 01:10 PM
what is exactly the login desktop background?
The background that shows up when you're at the login window. You may have yours off. By default it's the default Leopard desktop background (stars with bright colors streaming out).

daveL
Nov 7, 2007, 01:41 PM
what is exactly the login desktop background?

Ummm .... the background image on the login screen perhaps?

QuarterSwede
Nov 7, 2007, 02:00 PM
Anyone know how to write an Applescript so that you can select your own background in a dialog ... through Automator preferrably?

% cd /System/Library/CoreServices
% mv DefaultDesktop.jpg DefaultDesktop.jpg.org
% cp /Library/Desktop\ Pictures/Aqua\ Blue.jpg /System/Library/CoreServices/DefaultDesktop.jpg
% chown root:wheel /System/Library/CoreServices/DefaultDesktop.jpg
% chmod 644 /System/Library/CoreServices/DefaultDesktop.jpg

mainstreetmark
Nov 8, 2007, 07:12 AM
Anyone know how to write an Applescript so that you can select your own background in a dialog ... through Automator preferrably?

% cd /System/Library/CoreServices
% mv DefaultDesktop.jpg DefaultDesktop.jpg.org
% cp /System/Library/CoreServices/DefaultDesktop.jpg
% chown root:wheel /System/Library/CoreServices/DefaultDesktop.jpg
% chmod 644 /System/Library/CoreServices/DefaultDesktop.jpg

No, but I'll give you a push.

If you put those commands (minus the % prompt) in a text file, they can be executed as a script. The variable $1 can be used to pass in a value. Here's a quick step-by-step:

1. Save that stuff in a text file, and remove the % prompt
2. Add "#!/bin/bash" to the top
3. Replace '/Library/Desktop\ Pictures/Aqua\ Blue.jpg' with '"$1"' (NOTE that I have enclosed $1 in double quotes. This allows for spaces in the filename, handled previously by that backslash)
4. Make the file executable, either by Get Info from the finder or the command "chmod a+x <file>"
5. Now do something with automator. :) Just call that file from automator, and include the name of the new file that Automator gives you.

I'm not an automator expert.

QuarterSwede
Nov 8, 2007, 10:24 AM
No, but I'll give you a push.

If you put those commands (minus the % prompt) in a text file, they can be executed as a script. The variable $1 can be used to pass in a value. Here's a quick step-by-step:

1. Save that stuff in a text file, and remove the % prompt
2. Add "#!/bin/bash" to the top
3. Replace '/Library/Desktop\ Pictures/Aqua\ Blue.jpg' with '"$1"' (NOTE that I have enclosed $1 in double quotes. This allows for spaces in the filename, handled previously by that backslash)
4. Make the file executable, either by Get Info from the finder or the command "chmod a+x <file>"
5. Now do something with automator. :) Just call that file from automator, and include the name of the new file that Automator gives you.

I'm not an automator expert.
That's a great start! Thanks for the "push." ;)

koobcamuk
Nov 8, 2007, 10:26 AM
Can someone make and loadup a plugin so we can do this? I want the Aqua image back. I think it looks professional.

QuarterSwede
Nov 8, 2007, 11:16 AM
I'm followed the instructions he gave but am having no luck. I'll have to do some reading up on Applescript and see where I get. So far I've noticed that you can actually record actions in the AppleScript app.

Side note:
Whenever I try to do the above term code in terminal I can get to the mv command but it always refuses giving me a permission denied.

Big-TDI-Guy
Nov 8, 2007, 10:00 PM
Anyone get this working yet? I'd like to revert to something less cartoony looking for a login screen. But terminal isn't my strong point.

QuarterSwede
Nov 8, 2007, 10:04 PM
Anyone get this working yet? I'd like to revert to something less cartoony looking for a login screen. But terminal isn't my strong point.
I still can't get it to work in the terminal yet. Been busy trying to save my dying fish from a tank fungus ... yeah, they're probably not going to make it.

Big-TDI-Guy
Nov 8, 2007, 10:33 PM
I had a massive Plecostomus in my 55 gal tank that lived over 12 years - until he got a fungal infection that I didn't spot until it was too late. Bummer, b/c I'm sure he had a lot of time left.

Good luck with your fishes.


Also - found an easy way to change the login desktop - no terminal required.

Go to: /System/Library/CoreServices/DefaultDesktop.jpg
Remove DefaultDesktop.jpg - save it if you want - and find another picture with your native resolution (1920 x 1200 on my 24" imac), name that picture DefaultDesktop.jpg, and put that into the folder.

Didn't work on mine, until I found a picture with the same resolution as my native. But when it didn't work, I got the old blue screen from Tiger - which isn't bad in itself.

QuarterSwede
Nov 8, 2007, 11:36 PM
I had a massive Plecostomus in my 55 gal tank that lived over 12 years - until he got a fungal infection that I didn't spot until it was too late. Bummer, b/c I'm sure he had a lot of time left.

Good luck with your fishes.


Also - found an easy way to change the login desktop - no terminal required.

Go to: /System/Library/CoreServices/DefaultDesktop.jpg
Remove DefaultDesktop.jpg - save it if you want - and find another picture with your native resolution (1920 x 1200 on my 24" imac), name that picture DefaultDesktop.jpg, and put that into the folder.

Didn't work on mine, until I found a picture with the same resolution as my native. But when it didn't work, I got the old blue screen from Tiger - which isn't bad in itself.
I finally got it sorted. I forgot that my root password is different from my Admin password, hence why I couldn't get access.

If you follow the steps above you'll be able to set any jpg as the DefaultDesktop.jpg. Just sudo (or su if you're careful) before starting.

Now I just have to figure out how to gain root access through an Applescript and add a file picker dialog. I'm wondering what's the easier route: Applescript only, Automator only or a combo?

I'll have to pick it up after work tomorrow as the new Mythbusters episode (water heater rocket) on my DVR is calling and then it's off to bed. Should be good times. :D

OT:
My wife and I just set up our hospital tank tonight and are giving it the recommended 48 hours to stabilize before adding the fish. We just hope they last that long. I don't think the two tetras will make it as it's already on their scales but I think the two albino bottom feeders will.

I'm just wondering how fungus got in the tank in the first place ... it's been running for 5 months with no new additions.

QuarterSwede
Nov 9, 2007, 09:26 PM
Ok, so I found a script (http://aricsblog.blogspot.com/2006/09/running-shell-commands-with-automator.html) that will let you execute sudo commands. The only problem is I can't quite figure out how to get it to work with the existing (above) script.

The below should make the password dialog window.
on run {input, parameters}
tell application "System Events"
set the_username to do shell script "whoami"
set the_password to "password"
display dialog "You now need to enter the password for the currently logged in account: " & the_username & "

This account must have Administrator access to this computer." default answer "password" buttons {"OK", "Cancel"} default button "OK" with icon 2 with title "Password" with hidden answer
set the_password to text returned of the result
end tell
return {the_password}
end run

This either rejects the sudo password
exec echo $1 | sudo -v -S;
if [ $? -eq 1 ] then
echo "you are not a sudoer"; else
echo "you are a sudoer"; # replace this with your entire script.
exec echo $1 | sudo -S ls /private/var/root/;
fi

or accepts it and runs

echo "you are a sudoer"; # replace this with your entire script.
or whatever you have replaced it with.

That's where I run into a problem. It'll run the script but nothing happens with my injected code (so far I'm using the Automator workflow for ease of use).

phrozted
Dec 12, 2008, 01:13 PM
Doesn't work for me. No matter what I do. I've done all the commands correctly, but every time the login background ends up being solid blue, as though maybe the picture isn't working. But it's the same picture I'm using for my regular desktop background, and I've even changed its parameters to match the native resolution. What gives?

zagato27
Dec 12, 2008, 08:17 PM
I'm not a "script writer" or programmer so I found this
http://keakaj.com/visage.htm
Works great for a non-geek. Ok, you do have to buy it but what the heck. I want "different". Does a lot of other stuff that is probably really cool but either scares the heck out of me or I just don't understand it. So, simple and realitively cheap and so far hasn't screwed up my system. Cheers

batchtaster
Mar 9, 2009, 12:21 AM
Forget everything you just read and use:

/usr/bin/defaults write /Library/Preferences/com.apple.loginwindow DesktopPicture "/path/to/the picture.jpg"


No screwing around with replacing an image and the potential to a) botch the job b) have it trampled by Apple c) futz around with sudo and privileges d) pay for unnecessary software e) write involved scripts.

For a user as, say, part of a login script:
/usr/bin/defaults write com.apple.desktop Background '{default = {ImageFilePath = "/path/to/the image.jpg"; };}'

Again, no filesystem trickery involved. Single line, done the way Apple does it. You can even push it through Workgroup Manager/MCX, just click on the Details button.

saiful220
Sep 29, 2011, 02:46 PM
Can someone make nice? I want the Aqua image back. I think it looks professional.

RedRaven571
Oct 4, 2011, 09:45 AM
How about loginox? it's free and lets you change the login background whenever you want just by dragging the picture onto the application.

rajan91
Oct 10, 2011, 01:42 AM
hi :apple:

If you do want to just change the wallpaper, then you will also want to find the key WallpaperStyle - you may have to create it. Set the string to 0 (zero) to display the wallpaper bitmap centered; a value of 1 will tile it, and a value of 2 will stretch it to the screen resolution. :mad:

itdepotonline
Oct 29, 2011, 09:49 AM
I really like your informative and useful stuff.
It really looks great to me.
thanks