返回顶部
m

mac-monitor-brightness-controlMac亮度控制

>

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
121
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

mac-monitor-brightness-control

macOS 上的外接显示器控制(无需第三方图形界面应用)

概述

macOS 本身不提供对外接显示器的原生控制功能,但大多数现代显示器都支持 DDC/CI 协议——该协议允许软件直接向显示器硬件发送指令:亮度、对比度、音量、输入源、色温、电源等。

本技能分为设置部分(如下)和各控制参考文件。
完成设置后,直接跳转到所需控制的参考文件。

参考文件(设置后阅读)
文件涵盖的控制功能
references/brightness.md亮度——脚本、键盘快捷键、定时预设
references/contrast.md
对比度——色彩模式锁定技巧 |

| references/volume.md | 显示器扬声器音量、静音切换 | | references/input-source.md | 输入源切换、KVM 设置、各品牌代码 | | references/color-temperature.md | 色彩预设、RGB 增益、日间/夜间模式脚本 | | references/power-and-misc.md | 电源开关、旋转、恢复出厂设置、功能探测 |

第 0 步——确认你的配置

使用什么 Mac 芯片?

bash uname -m # arm64 = Apple Silicon | x86_64 = Intel

或:苹果菜单 → 关于本机。

显示器如何连接?
线缆Apple SiliconIntel
USB-C / Thunderbolt✅ 完整 DDC 支持✅ 完整 DDC 支持
DisplayPort
✅ 可用 | ✅ 可用 |

| HDMI(内置端口) | ⚠️ M1/M2 Mac Mini、M1 MBP、Mac Studio 上被屏蔽 | ✅ 可用 | | 通过 Thunderbolt 转接器的 HDMI | ✅ 通常可用 | ✅ 可用 | | DisplayLink 扩展坞 | ❌ 不支持 DDC | ❌ 不支持 DDC |

如果你使用的是 Apple Silicon 且通过 HDMI 连接且无法更换线缆 → 跳转到 软件备用方案


第 1 步——安装正确的工具

Apple Silicon → m1ddc

bash brew install m1ddc m1ddc display list # 你的显示器应显示在此处

Intel → ddcctl

bash brew install ddcctl ddcctl -d 1 -p 1 # 探测显示器 1——列出支持的控制功能

未安装 Homebrew?
bash
/bin/bash -c $(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)


第 2 步——快速测试

在编写脚本前验证 DDC 是否正常工作:

bash

Apple Silicon


m1ddc set luminance 30 # 屏幕应明显变暗
m1ddc set luminance 80 # 屏幕应变亮

Intel

ddcctl -d 1 -b 30 ddcctl -d 1 -b 80

无变化?→ 参见下方 软件备用方案

多台显示器?指定目标显示器:
bash
m1ddc display list # 查找索引
m1ddc display 2 set luminance 60
ddcctl -d 2 -b 60 # Intel 等效命令



第 3 步——设置 Shell 脚本

所有控制功能均以单行 shell 命令形式实现。创建 ~/scripts/ 文件夹
并将脚本保存在此处,以便 Automator、cron 和键盘快捷键调用。

bash
mkdir -p ~/scripts

在脚本中始终使用 完整二进制路径——Automator 和 cron 不会加载你的 shell PATH:

  • - Apple Silicon:/opt/homebrew/bin/m1ddc
  • Intel:/usr/local/bin/ddcctl

参见各 references/*.md 文件获取每种控制的即用脚本。

创建脚本后使其可执行:
bash
chmod +x ~/scripts/*.sh



第 4 步——键盘快捷键(Automator)

适用于任何脚本。为每个要绑定到按键的操作执行一次此步骤。

  1. 1. 打开 Automator → 新建文稿 → 快速操作
  2. 工作流程接收 → 任何应用程序中的 无输入
  3. 添加 运行 Shell 脚本 → 粘贴完整的脚本路径(例如 /Users/yourname/scripts/brightness-up.sh)
  4. 保存为例如 Brightness Up
  5. 系统设置 → 键盘 → 键盘快捷键 → 服务 → 通用
  6. 找到你的快速操作 → 分配快捷键(例如 ⌃⌥↑)

如果快捷键无响应:系统设置 → 隐私与安全性 → 自动化 → 授予权限。


第 5 步——定时预设(可选)

使用 cron 在特定时间自动切换显示器设置:

bash
crontab -e

早上 8 点日间模式

0 8 * /Users/yourname/scripts/day-mode.sh

晚上 9 点夜间模式

0 21 * /Users/yourname/scripts/night-mode.sh

参见 references/color-temperature.md 获取现成的日间/夜间脚本。



软件备用方案(不支持 DDC)

如果你的显示器不支持 DDC(电视、廉价显示器、DisplayLink 扩展坞),
使用 macOS Gamma 表控制 在软件层面调暗图像:

bash

将亮度设置为 60%(范围:0.0–1.0)


osascript -e tell application System Events to set brightness of (first screen of (get every screen)) to 0.6

作为脚本(~/scripts/brightness-soft.sh):
bash
#!/bin/bash

用法:brightness-soft.sh 0.6


osascript -e tell application \System Events\ to set brightness of (first screen of (get every screen)) to ${1:-0.7}

⚠️ 软件调暗仅改变显示效果——不省电,低亮度时会有轻微色偏。
可用时始终优先使用硬件 DDC。


故障排除

症状解决方法
m1ddc display list 无返回结果必须使用 USB-C;M1/M2 Mac Mini 上 HDMI 被屏蔽
找到显示器但控制无效
显示器 OSD 中可能关闭了 DDC/CI;或开启了动态对比度 | | 错误的显示器被更改 | 使用 m1ddc display 2 … 或 ddcctl -d 2 … | | 快速操作中找不到命令 | 使用完整路径:/opt/homebrew/bin/m1ddc | | 快捷键无响应 | 系统设置 → 隐私与安全性 → 自动化 | | 完全不支持 DDC | 使用软件备用方案(osascript gamma) |

参考链接

  • - m1ddc(Apple Silicon):https://github.com/waydabber/m1ddc
  • ddcctl(Intel):https://github.com/kfix/ddcctl
  • Apple Silicon 上 DDC/CI HDMI 被屏蔽:https://github.com/MonitorControl/MonitorControl#readme

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 mac-display-control-1775943363 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 mac-display-control-1775943363 技能

通过命令行安装

skillhub install mac-display-control-1775943363

下载

⬇ 下载 mac-monitor-brightness-control v1.0.0(免费)

文件大小: 9.02 KB | 发布时间: 2026-4-12 10:29

v1.0.0 最新 2026-4-12 10:29
Initial release of mac-monitor-brightness-control.
A comprehensive, step-by-step guide for controlling external display settings on a Mac via command line or keyboard shortcuts, with no third-party GUI apps required.

- Covers Apple Silicon and Intel Macs, all major monitor brands, and all connection types.
- Explains hardware support, DDC/CI protocol basics, and setup for both m1ddc (Apple Silicon) and ddcctl (Intel).
- Includes smoke testing, scripting, keyboard shortcut integration, and time-based automation.
- Provides a fallback method for displays lacking DDC/CI support.
- Reference files detail individual control areas: brightness, contrast, volume, input source, color temperature, power, etc.
- Troubleshooting tips and links to tool documentation included.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部