How can I programmatically change the background in Mac OS X?

后端 未结 10 1968
轮回少年
轮回少年 2020-11-28 03:30

How would I go about programmatically changing the desktop background in Mac OS X? I\'d like to use python, but I\'m interested in any way possible. Could I hook up to Ter

10条回答
  •  孤街浪徒
    2020-11-28 03:58

    There are a default collection of quality images in:

    /Library/Desktop Pictures/
    

    To automate the selection of one of these across all desktops, without a 3rd party dependency:

    osascript -e 'tell application "System Events" to set picture of every desktop to "/Library/Desktop Pictures/Solid Colors/Stone.png"'
    

提交回复
热议问题