mac桌面壁纸_在Mac上从命令行设置桌面墙纸

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管理员或自动化人员!

翻译自: https://davidwalsh.name/desktop-wallpaper-command-line

mac桌面壁纸

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值