在BetterTouchTool自定义一个歌词显示控件
Touchbar Lyric
安装 python
安装过程不展开介绍了,可以使用brew、python.org官网、pyenv、conda等工具安装。
⚠️需要注意的问题:
- 3.9.x、3.10.x版本会在控件中输出报错信息:
1 | NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3' |
- 解决方案:最终使用的是3.12.0
安装 touchbar_lyric
1 | pip3 install touchbar_lyric --upgrade |
测试 touchbar_lyric
1 | python3 -m touchbar_lyric --app Music |
在BetterTouchTool中配置
- 自定义菜单栏,选择Shell脚本 / 任务 widget
- 填写脚本配置:
- 启动路径:
/bin/bash
- 参数:
-c
- 环境变量:在你本机的Terminal中输入
echo $PATH
,然后复制输出内容到此处,格式类似于:1
PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin...
个性化(可选)
空白歌词显示「No Lyric」
1 | output=$(python3 -m touchbar_lyric --app Music) |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Aghenim Sanctuary!