Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,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 1.67 / 5
  You rated: 1 / 5 (6 votes cast)
 
[8,384 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 whoever posted them. This site is not responsible for what they say.
A script to pick a random login window background
Authored by: apveenstra on Dec 31, '07 07:42:21AM

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 Dec 31, '07 07:44:54AM

oops! replied to wrong hint :(



[ Reply to This | # ]
A script to pick a random login window background
Authored by: merlyn on Dec 31, '07 09:34:55AM
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 Dec 31, '07 11:03:23AM

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 Dec 31, '07 12:43:47PM
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 Dec 31, '07 01:24:17PM

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 Jan 08, '08 08:10:51AM

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 | # ]