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 中顯示歌詞。

載入中......
此文章數據所有權由區塊鏈加密技術和智能合約保障僅歸創作者所有。