V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
c4f36e5766583218
V2EX  ›  问与答

MacOS: 可以在命令行下读取系统屏幕亮度,键盘背光亮度,声音大小等值吗?

  •  
  •   c4f36e5766583218 · May 9, 2019 · 2138 views
    This topic created in 2551 days ago, the information mentioned may be changed or developed.
    7 replies    2020-02-05 12:24:27 +08:00
    377848
        1
    377848  
       May 9, 2019
    等大佬回复
    mauve
        2
    mauve  
    PRO
       May 9, 2019 via Android
    Hammerspoon 或者 applescript,推荐 Hammerspoon
    lizhuoli
        3
    lizhuoli  
       May 9, 2019 via iPhone
    可以试试 Apple Script,能访问大部分 macOS 的接口和系统事件,Google 一下应该就有
    c4f36e5766583218
        4
    c4f36e5766583218  
    OP
       May 9, 2019
    @mauve #2 Hammerspoon 文档里看到一句。
    hs.audiodevice.defaultOutputDevice():setVolume(0)
    应该有 hs.audiodevice.defaultOutputDevice():getVolume()的吧
    c4f36e5766583218
        6
    c4f36e5766583218  
    OP
       May 9, 2019
    apple script: display alert output volume of (get volume settings)
    https://apple.stackexchange.com/questions/191300/get-output-volume-with-applescript
    lxk11153
        7
    lxk11153  
       Feb 5, 2020
    Shell: osascript -e 'get volume settings'
    AppleScript: get volume settings

    但是屏幕亮度,键盘亮度还不知道,等高手~
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2368 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 01:41 · PVG 09:41 · LAX 18:41 · JFK 21:41
    ♥ Do have faith in what you're doing.