banner
lca

lca

真正的不自由,是在自己的心中设下牢笼。

macbook touch bar显示歌词

macbook 的 touchbar 功能在新版的 mac 上已经没了,但个人还是挺喜欢有 touchbar 的 mac 的。可以在 touchbar 上显示音乐歌词。

工具

安装touchbar_lyric

pip3 install touchbar_lyric --upgrade

去 touchbar_lyric 项目找到 lyric.json 文件,内容如下,导入到 BetterTouchTool 中。

[
    {
      "BTTWidgetName" : "Lyric",
      "BTTTriggerType" : 642,
      "BTTTriggerTypeDescription" : "Shell Script \/ Task Widget",
      "BTTTriggerClass" : "BTTTriggerTypeTouchBar",
      "BTTPredefinedActionType" : -1,
      "BTTPredefinedActionName" : "No Action",
      "BTTShellScriptWidgetGestureConfig" : "\/bin\/sh:::-c:::-:::",
      "BTTEnabled2" : 1,
      "BTTRepeatDelay" : 0,
      "BTTUUID" : "93C8B565-73C7-49BE-960A-4FCF512CE881",
      "BTTNotesInsteadOfDescription" : 0,
      "BTTEnabled" : 1,
      "BTTModifierMode" : 0,
      "BTTOrder" : 0,
      "BTTDisplayOrder" : 99,
      "BTTMergeIntoTouchBarGroups" : 0,
      "BTTTriggerConfig" : {
        "BTTTouchBarFreeSpaceAfterButton" : 0,
        "BTTTouchBarOnlyShowIcon" : false,
        "BTTTouchBarButtonColor" : "0.000000, 0.000000, 0.000000, 255.000000",
        "BTTTouchBarApplyCornerRadiusTo" : 0,
        "BTTTouchBarItemPlacement" : 0,
        "BTTTouchBarAppleScriptStringRunOnInit" : true,
        "BTTTouchBarAlwaysShowButton" : false,
        "BTTTouchBarFontColorAlternate" : "0.000000, 0.000000, 0.000000, 255.000000",
        "BTTScriptType" : 0,
        "BTTTouchBarButtonWidth" : 550,
        "BTTTouchBarScriptUpdateInterval" : 1,
        "BTTTouchBarItemIconHeight" : 22,
        "BTTTouchBarButtonUseFixedWidth" : 0,
        "BTTTouchBarButtonTextAlignment" : 1,
        "BTTTouchBarAlternateBackgroundColor" : "0.000000, 0.000000, 0.000000, 255.000000",
        "BTTTBWidgetWidth" : 400,
        "BTTTouchBarItemIconWidth" : 22,
        "BTTTouchBarShellScriptString" : "$PYTHONPATH -m touchbar_lyric  --app Spotify",
        "BTTTouchBarIconTextOffset" : 5,
        "BTTTouchBarButtonFontSize" : 12,
        "BTTTouchBarFontColor" : "156.000006, 226.000002, 90.000002, 255.000000",
        "BTTTouchBarButtonName" : "Lyric",
        "BTTTouchBarButtonCornerRadius" : 6,
        "BTTTouchBarItemPadding" : 20
      }
    }
  ]

下载 lyric.json 文件,在 BetterTouchTool 中导入预设。

f1fcc14443b78250156d5c937ca3b059_MD5

ee7383b9944796fde2b2aaf8afe5e0a3_MD5

新建一个触发器,选择Shell脚本/任务 Widget,小部件标识符写个名称,在下面4中写入,/opt/homebrew/Cellar/[email protected]/3.9.19/bin/python3.9 -m touchbar_lyric --app Spotify --traditional,这段脚本,在touchbar_lyric中可以找到。

780897552ed506909ee994723e3fe674_MD5

如何判断 python3 的位置呢?

b58f1e8248e06796261f3b93b8f8227e_MD5

后续重启 BetterTouchTool 即可实现 touch bar 中显示歌词。

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.