OS X变更Login屏幕背景

    这里说的是, 当你启动OS X后, 系统停留在登录界面的时候, Login窗口后面整个屏幕的那个画面.


    目前网上有一种流行的更改方式是直接更改OS X系统默认的屏幕背景图形文件, 它的存放位置在/System/Library/CoreServices/, 文件名是DefaultDesktop.jpg. 操作者只要把自己制作的图形文件覆盖这个文件就好了. 注意,在 OS X 10.5.4以后, 操作者要注意把该文件的owner和group一定要变更为root:wheel,以及权限, 否则可能不工作, 见下面命令.
    chown root:wheel DefaultDesktop.jpg
    chmod u=rw,g=r,o=r DefaultDesktop_new.jpg


    这个方法固然简单, 但是笔者总觉得有点破坏了原来系统的完整, 所以还是通过OS X的通用/推荐的方法来做最好, 这个方法就是变更loginwindow的plist文件. 在OS X中, 应用程序的配置都是使用plist文件来设置的, plist文件就是一个符合规范的xml文本文件, 对于它的操作可以通过很多方式来进行, 即可以是OS X提供的defaults命令, 也可以是文本编辑, 更可以是第三方的XML编辑器, 而且比较直观和容易管理, 所以推荐使用这种方式.


    具体到更改plist文件的方式来说, 你可以把你的背景图形文件存放在磁盘的任何一个地方, 因为CoreServices运行的时候一般是用系统启动时的root用户, 所以可以有权利访问任何一个文件.


    比如, 我要把我的屏幕变更为/Library/Desktop Pictures/Lines Blue.jpg文件, 那么在Terminal里执行下面的命令就可以了:

sudo defaults write /Library/Preferences/com.apple.loginwidnow "/Library/Desktop Pictures/Lines Blue.jpg"


    然后输入admin的密码就变更好了.


    注意: 在OS X的Terminal里面用户可以拖动GUI里面的任何一个文件到Terminal里面, Terminal自动给出该文件的完整路径, 而对于有空格的全文件名的, 它会自动在空格前加入/来指示后面是文件名的空格. 在上面的命令行中, 最后的双引号里面的全文件名中, 一定要把那些/去掉, 否则不认.


    还有其他方法, 比如你依然可以使用LoginWindow Manager来变更背景, 但是这个程序在Bombich.com网站上已经不再支持了.

LoginWindow Manager



    还有一个叫做Desktop 2 Login 1.0的工具可以使用, 下载到:http://www.apple.com/downloads/macosx/icons_screensavers/desktop2login.html:



    有的人谢了一个AppleScript来做相同的事情, 大家看看是不是有点麻烦:


--Created by Stormen
--Email address: [email protected]
--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


还有就是可以通过Workgroup Manager来变更, 这里不多说.


总结: 比较之后,直接更改文件的方法和变更plist的方法适合于企业环境和有一定基础的一般用户使用, 在企业环境里, 可以通过Remote Desktop Admin的发送Unix命令的方式轻松管理成百上千的客户机.对于一般用户还是使用GUi的图形工具方便可靠.

 

 

 

 

 

ref; http://www.macosxhints.com/article.php?story=20070610164328933
http://www.macosxhints.com/article.php?story=20071027002458808


原文链接: http://blog.csdn.net/afatgoat/article/details/3788089

你可能感兴趣的:(OS X变更Login屏幕背景)