Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

A script to pick a random login window background System
I really this older hint, on how to change the login window background by telling the system to look for the image in another location, but I want to suggest a small variation of it.

I like to constantly change my backgrounds. I have a directory with a bunch of background pictures, so I wrote a simple AppleScript which takes a random file from this directory and saves it as the picture used as the login window background. Mine is named myloginwindow.jpg, and it sits in my Public folder. Then I saved the AppleScript as an application, and added it to the login items for my account. Now every time I log in, I see a different login background. Since I really know nothing about AppleScripting, the above is probably not ideal (please feel free to suggest improvements in the comments), but it works for me.

[robg adds: I haven't tested this one, but to make it work, you'll also have to have used the linked hint to specify a new location for the login background images.]
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[4,970 views]  

A script to pick a random login window background | 7 comments | Create New Account
Click here to return to the 'A script to pick a random login window background' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
A script to pick a random login window background
Authored by: apveenstra on Mon, Dec 31 2007 at 7:42AM PST
Or you could use the built in Photoshop tool: File -> Automate -> Fit Image...

[ Reply to This | # ]
A script to pick a random login window background
Authored by: apveenstra on Mon, Dec 31 2007 at 7:44AM PST
oops! replied to wrong hint :(

[ Reply to This | # ]
A script to pick a random login window background
Authored by: merlyn on Mon, Dec 31 2007 at 9:34AM PST
A simpler idiom for a random selection is: set item1 to some item of theList

[ Reply to This | # ]
A script to pick a random login window background
Authored by: V.K. on Mon, Dec 31 2007 at 11:03AM PST
thanks. btw, is there a quick ways to choose several random items from a list?

[ Reply to This | # ]
A script to pick a random login window background
Authored by: Pace on Mon, Dec 31 2007 at 12:43PM PST
Based on something I read here, I created the following script back when I was on Tiger:
#!/bin/bash
RANGE=35
echo
number=$RANDOM
let "number %= $RANGE"
cp /Users/Shared/backgrounds/$number.jpg /Library/LoginWindow/Aqua_Blue.jpg
And changed the default login background image to the one mentioned on the last line (/Library/LoginWindow/Aqua_Blue.jpg), and set the script to be run on every logout (logout hook). That way, I have a total of 36 (0.jpg to 35.jpg) images that change every time I log out of an account, shut down, restart, … Less noticeable than an Applescript script or app.

[ Reply to This | # ]
A script to pick a random login window background
Authored by: V.K. on Mon, Dec 31 2007 at 1:24PM PST
Thanks!
sorry but I'm even more ignorant about shell scripts than apple scripts.
How do I create a logout hook to a shell script? Also, do you know if I can make your script run every time I go to the login window and not just on logouts (say if I use the users menu)?

[ Reply to This | # ]
A script to pick a random login window background
Authored by: Pace on Tue, Jan 8 2008 at 8:10AM PST
Hi, sorry for not replying earlier.

Unfortunately, I'm really a beginner in those matters too, so I don't remember. I did it a few months ago after some research, but now it's all behind me.
Try searching "logout hooks" on Google, it might turn up some useful results.

Good luck…

[ Reply to This | # ]