Ultima attività 10 months ago

自動檢測 macOS 並設置 iTerm2 偏好設定資料夾為自訂路徑。

timmy ha revisionato questo gist 10 months ago. Vai alla revisione

Nessuna modifica

timmy ha revisionato questo gist 10 months ago. Vai alla revisione

1 file changed, 19 insertions

macos_iterm2_custom_prefs.sh(file creato)

@@ -0,0 +1,19 @@
1 + #!/bin/sh
2 +
3 + # 取得作業系統類型(例如 Darwin 表示 macOS)
4 + system_type=$(uname -s)
5 +
6 + # 如果是 macOS 系統,才執行以下區塊
7 + if [ "$system_type" = "Darwin" ]; then
8 +
9 + # 這裡可以考慮加入使用 Homebrew 安裝 iTerm2 的指令(例如 brew install --cask iterm2)
10 + # 不過目前尚未實作
11 +
12 + # 檢查使用者家目錄下是否有 .iterm2 設定資料夾
13 + if [ -d "$HOME/.iterm2" ]; then
14 + echo "設定 iTerm2 偏好設定資料夾路徑"
15 + # 將 iTerm2 的偏好設定指向自訂的資料夾
16 + defaults write com.googlecode.iterm2 PrefsCustomFolder "$HOME/.iterm2"
17 + fi
18 +
19 + fi
Più nuovi Più vecchi