Automatically change the OS X Login Window text
I wrote a python script that read at random a row in a text file that contain my phrases database. Below the script:
import os,random
lines = []
fin = open('/opt/local/etc/random_login_text.list', 'r')
for line in fin.readlines():
lines.append(line.strip())
linesRandom = random.randint(0, len(lines))
newLoginText = lines[linesRandom -1]
print newLoginText
theCommand = 'defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "' + newLoginText + '"'
print theCommand
os.system(theCommand)
To change the text after every login, I added a call to the script in the System Preferences -> Accounts menù
Written by Mauro Barincelli
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#