首页 » 操作系统 » macOS » 正文

一键切换副屏输入源

发布者:站点默认
2023/07/14 浏览数(226) 分类:macOS 一键切换副屏输入源已关闭评论

用到的软件

ddcctlKarabiner-Elements.app

用法

RightCmd + \ --> 将副屏输入源切换为 VGA
RightOpt + \ --> 将副屏输入源切换为 HDMI
RightCmd + RightOpt + \ --> 将副屏输入源切换为 DP

changeExternalDisplayInputSource.json

~/.config/karabiner/assets/complex_modifications/

{
    "title": "Change the external display input source",
    "author": "win:https://github.com/hensm/ddccli; mac:https://github.com/kfix/ddcctl;",
    "rules": [
        {   
            "description": "Right⌘\\: Change the external display input source to VGA",
            "manipulators": [{
                "type": "basic",
                "from": {
                    "key_code": "backslash",
                    "modifiers": {
                        "mandatory": ["right_command"],
                        "optional": ["caps_lock"]
                    }   
                },  
                "to": [{
                    "shell_command": "/usr/local/bin/ddcctl -d 1 -i 1"
                }]  
            }]  
        },  
        {   
            "description": "Right⌥\\: Change the external display input source to HDMI",
            "manipulators": [{
                "type": "basic",
                "from": {
                    "key_code": "backslash",
                    "modifiers": {
                        "mandatory": ["right_option"],
                        "optional": ["caps_lock"]
                    }   
                },  
                "to": [{
                    "shell_command": "/usr/local/bin/ddcctl -d 1 -i 17"
                }]  
            }]                                                                                                                                                                                                                                
        },  
        {   
            "description": "Right⌘⌥\\: Change the external display input source to DP",
            "manipulators": [{
                "type": "basic",
                "from": {
                    "key_code": "backslash",
                    "modifiers": {
                        "mandatory": ["right_command", "right_option"],
                        "optional": ["caps_lock"]
                    }   
                },  
                "to": [{
                    "shell_command": "/usr/local/bin/ddcctl -d 1 -i 15"
                }]  
            }]  
        }   
    ]   
}
点击返回顶部
  1. 留言
  2. 联系方式