mac桌面壁纸
Whenever I need to accomplish a basic task that typically calls for interacting with a UI, I challenge myself to complete the task from command line. After all, most UIs are simply a mask over basic commands, especially when it comes to the operating system. Suddenly I feel like an automation or systems engineer!
每当我需要完成通常需要与UI交互的基本任务时,我都会挑战自己从命令行完成任务。 毕竟,大多数UI只是基本命令的掩盖,尤其是在操作系统方面。 突然我感觉自己像是一名自动化或系统工程师!
One task I can imagine an IT administrator would need to automate is setting the desktop wallpaper via a script, remotely, or simply by providing the command to do so:
我可以想象IT管理员需要自动化的一项任务是通过脚本远程或简单地通过提供命令来设置桌面墙纸:
osascript -e 'tell application "Finder" to set desktop picture to POSIX file "/Users/davidwalsh/Downloads/pubg-background.jpg"'
It's important to note that you must provide the absolute path to the image, and not a path that begins with a user path (i.e. ~/Downloads/my-image.jpg
)
重要的是要注意,您必须提供图像的绝对路径,而不是以用户路径开头的路径(即 ~/Downloads/my-image.jpg
)
Beyond the general nerdiness of knowing how to change desktop wallpaper via command line, it could be useful to change your background based on a service being down or other event.
除了知道如何通过命令行更改桌面墙纸的一般习惯之外,根据服务关闭或其他事件来更改背景可能很有用。
I challenge you to think more like a remote IT administrator or automator when you need to accomplish your next simple task!
当您需要完成下一个简单任务时,我会挑战您,让您更像是远程IT管理员或自动化人员!
mac桌面壁纸