Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Add a Terminal page that gives Terminal one of Peel's themes

Țugui Dragoș933c29fff3ba
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstrings
index 4f54e5fa..1475bb0f 100644
--- a/Localization/Peel/Localizable.xcstrings
+++ b/Localization/Peel/Localizable.xcstrings
@@ -20841,6 +20841,112 @@
}
}
},
+ "Choose a theme below, and Terminal opens with it." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Níže zvolte motiv a Terminál se s ním bude otevírat."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Wähle unten ein Thema, dann wird Terminal damit geöffnet."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Elige uno de los temas de abajo y Terminal se abrirá con él."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Choisissez ci-dessous le thème avec lequel Terminal s’ouvrira."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Scegli qui sotto il tema con cui si aprirà Terminale."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "以下でテーマを選ぶと、ターミナルはそのテーマで開くようになります。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "아래에서 테마를 선택하면 터미널이 그 테마로 열립니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Kies hieronder een thema, dan opent Terminal met dat thema."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Wybierz poniżej motyw, a Terminal będzie się z nim otwierał."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Escolha um tema abaixo, e o Terminal vai abrir com ele."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Alegeți o temă de mai jos și Terminal se va deschide cu ea."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Выберите тему ниже, и Терминал будет открываться с ней."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Välj ett tema nedan, så öppnas Terminal med det."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Aşağıdan bir tema seçin; Terminal o temayla açılır."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Виберіть тему нижче, і Термінал відкриватиметься з нею."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "在下方选取一个主题,“终端”打开时就会使用它。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "在下方選擇一個主題,「終端機」就會以該主題打開。"
+ }
+ }
+ }
+ },
"Choose an app to see what it leaves behind." : {
"localizations" : {
"cs" : {
@@ -45876,6 +45982,112 @@
}
}
},
+ "In Use" : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Používá se"
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "In Verwendung"
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "En uso"
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "En cours d’utilisation"
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "In uso"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "使用中"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "사용 중"
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "In gebruik"
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "W użyciu"
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Em Uso"
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "În uz"
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Используется"
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Används"
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Kullanımda"
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Використовується"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "使用中"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "使用中"
+ }
+ }
+ }
+ },
"In the Trash" : {
"localizations" : {
"cs" : {
@@ -50434,6 +50646,112 @@
}
}
},
+ "It may be asking whether to stop a command that is still running." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Možná se ptá, zda má ukončit příkaz, který stále běží."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Möglicherweise fragt Terminal gerade, ob ein noch laufender Befehl beendet werden soll."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Puede que Terminal te esté preguntando si quieres detener un comando que sigue en ejecución."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Il vous demande peut-être s’il faut arrêter une commande encore en cours d’exécution."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Forse ti sta chiedendo se vuoi interrompere un comando ancora in esecuzione."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "ターミナルが、まだ実行中のコマンドを終了するかどうかを尋ねている可能性があります。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "아직 실행 중인 명령을 중단할지 묻고 있을 수 있습니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal vraagt misschien of een commando dat nog actief is, moet worden beëindigd."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Być może pyta, czy zakończyć polecenie, które nadal działa."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Ele pode estar perguntando se você quer finalizar um comando que ainda está em execução."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "S‑ar putea să vă întrebe dacă doriți să opriți o comandă care încă rulează."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Возможно, он спрашивает, прервать ли команду, которая еще выполняется."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal kanske frågar om ett kommando som fortfarande körs ska stoppas."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Hâlâ çalışan bir komutu durdurmak isteyip istemediğinizi soruyor olabilir."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Можливо, він запитує, чи зупинити команду, яка ще виконується."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "它可能正在询问你是否要停止某个仍在运行的命令。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "它可能正在詢問是否要停止仍在執行的指令。"
+ }
+ }
+ }
+ },
"It needs administrator access, which Peel’s helper provides." : {
"localizations" : {
"cs" : {
@@ -80220,6 +80538,112 @@
}
}
},
+ "Open Terminal" : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Otevřít Terminál"
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal öffnen"
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Abrir Terminal"
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Ouvrir Terminal"
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Apri Terminale"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "ターミナルを開く"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "터미널 열기"
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Open Terminal"
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Otwórz Terminal"
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Abrir o Terminal"
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Deschideți Terminal"
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Открыть Терминал"
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Öppna Terminal"
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal’i Aç"
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Відкрити Термінал"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "打开终端"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "打開終端機"
+ }
+ }
+ }
+ },
"Open Uninstaller" : {
"localizations" : {
"cs" : {
@@ -80326,6 +80750,112 @@
}
}
},
+ "Open a New Window" : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Otevřít nové okno"
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Neues Fenster öffnen"
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Abrir una nueva ventana"
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Ouvrir une nouvelle fenêtre"
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Apri una nuova finestra"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "新規ウインドウを開く"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "새로운 윈도우 열기"
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Open een nieuw venster"
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Otwórz nowe okno"
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Abrir uma Nova Janela"
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Deschideți o fereastră nouă"
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Открыть новое окно"
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Öppna ett nytt fönster"
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Yeni Pencere Aç"
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Відкрити нове вікно"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "新建窗口"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "打開新視窗"
+ }
+ }
+ }
+ },
"Open apps keep the old setting until you reopen them" : {
"localizations" : {
"cs" : {
@@ -101453,6 +101983,218 @@
}
}
},
+ "Quit Terminal" : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Ukončit Terminál"
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal beenden"
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Salir de Terminal"
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Quitter Terminal"
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Esci da Terminale"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "ターミナルを終了"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "터미널 종료"
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Stop Terminal"
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Zakończ Terminal"
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Encerrar Terminal"
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Închideți aplicația Terminal"
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Завершить Терминал"
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Avsluta Terminal"
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal’den Çık"
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Завершити Термінал"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "退出终端"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "結束終端機"
+ }
+ }
+ }
+ },
+ "Quit Terminal first?" : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Nejprve ukončit Terminál?"
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal zuerst beenden?"
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "¿Salir primero de Terminal?"
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Quitter d’abord Terminal ?"
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Vuoi prima uscire da Terminale?"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "先にターミナルを終了しますか?"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "먼저 터미널을 종료하겠습니까?"
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal eerst stoppen?"
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Najpierw zakończyć Terminal?"
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Encerrar o Terminal primeiro?"
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Închideți mai întâi aplicația Terminal?"
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Сначала завершить Терминал?"
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Vill du avsluta Terminal först?"
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Önce Terminal’den çıkılsın mı?"
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Спершу завершити Термінал?"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "要先退出“终端”吗?"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "要先結束「終端機」嗎?"
+ }
+ }
+ }
+ },
"Quit these apps before removing them." : {
"localizations" : {
"cs" : {
@@ -121945,6 +122687,324 @@
}
}
},
+ "Terminal" : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminál"
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal"
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal"
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal"
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminale"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "ターミナル"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "터미널"
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal"
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal"
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal"
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal"
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Терминал"
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal"
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal"
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Термінал"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "终端"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "終端機"
+ }
+ }
+ }
+ },
+ "Terminal didn’t quit." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminál se neukončil."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal wurde nicht beendet."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "No se ha podido salir de Terminal."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Impossible de quitter Terminal."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Uscita da Terminale non riuscita."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "ターミナルを終了できませんでした。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "터미널이 종료되지 않았습니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Het stoppen van Terminal is niet gelukt."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal nie zakończył działania."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "O Terminal não foi encerrado."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal nu s‑a închis."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Терминал не завершил работу."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal avslutades inte."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal kapanmadı."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Термінал не завершив роботу."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“终端”尚未退出。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "「終端機」尚未結束。"
+ }
+ }
+ }
+ },
+ "Terminal opens with this theme, and every new window uses it." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminál se otevírá s tímto motivem a používá ho každé nové okno."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal wird mit diesem Thema geöffnet, und jedes neue Fenster verwendet es."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal se abre con este tema, y todas las ventanas nuevas lo usan."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal s’ouvre avec ce thème, et chaque nouvelle fenêtre l’utilise."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminale si apre con questo tema e lo usa per ogni nuova finestra."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "ターミナルはこのテーマで開き、新規ウインドウもすべてこのテーマを使用します。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "터미널은 이 테마로 열리며, 새로운 윈도우도 모두 이 테마를 사용합니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal opent met dit thema, en elk nieuw venster gebruikt het."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal otwiera się z tym motywem i używa go w każdym nowym oknie."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "O Terminal abre com este tema, e toda nova janela o usa."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal se deschide cu această temă, iar fiecare fereastră nouă o folosește."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Терминал открывается с этой темой, и она используется в каждом новом окне."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal öppnas med det här temat, och varje nytt fönster använder det."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal bu temayla açılır ve her yeni pencere onu kullanır."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Термінал відкривається з цією темою, і її використовує кожне нове вікно."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“终端”打开时会使用此主题,每个新窗口也都会使用它。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "「終端機」會以此主題打開,每個新視窗也都會使用它。"
+ }
+ }
+ }
+ },
"That folder can’t be added." : {
"localizations" : {
"cs" : {
@@ -129579,6 +130639,112 @@
}
}
},
+ "Themes" : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Motivy"
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Themen"
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Temas"
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Thèmes"
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Temi"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "テーマ"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "테마"
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Thema's"
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Motywy"
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Temas"
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Teme"
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Темы"
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Teman"
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Temalar"
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Теми"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "主题"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "主題"
+ }
+ }
+ }
+ },
"Then %@ would open these." : {
"localizations" : {
"cs" : {
@@ -145234,6 +146400,112 @@
}
}
},
+ "While Terminal is open, it doesn’t see a new theme, and can undo it the next time it saves its settings." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Dokud je Terminál otevřený, o novém motivu neví a při příštím uložení svých nastavení ho může zrušit."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Solange Terminal geöffnet ist, bemerkt die App kein neues Thema und kann die Änderung rückgängig machen, wenn sie ihre Einstellungen das nächste Mal sichert."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Mientras Terminal está abierta, no ve el tema nuevo y puede deshacerlo la próxima vez que guarde sus ajustes."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Tant que Terminal est ouvert, il ne s’aperçoit pas d’un changement de thème et peut l’annuler la prochaine fois qu’il enregistre ses réglages."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Mentre Terminale è aperto, non vede un nuovo tema e può annullarlo la prossima volta che salva le sue impostazioni."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "ターミナルは、開いている間は新しいテーマを認識せず、次に設定を保存するときにテーマの変更を取り消すことがあります。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "터미널은 열려 있는 동안 새로운 테마를 인식하지 못하며, 다음에 설정을 저장할 때 테마 변경을 되돌릴 수 있습니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Zolang Terminal open is, ziet de app een nieuw thema niet, en kan die het ongedaan maken de volgende keer dat die de instellingen bewaart."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Dopóki Terminal jest otwarty, nie widzi zmiany motywu i może ją cofnąć, gdy następnym razem zachowa swoje ustawienia."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Enquanto estiver aberto, o Terminal não percebe uma mudança de tema e pode desfazê-la na próxima vez que salvar os próprios ajustes."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Cât timp Terminal este deschis, nu vede o temă nouă și o poate anula data viitoare când își salvează configurările."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Пока Терминал открыт, он не видит новую тему и может отменить ее, когда в следующий раз сохранит свои настройки."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Medan Terminal är öppen ser den inte ett nytt tema och kan ångra det nästa gång den sparar sina inställningar."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Terminal açıkken yeni bir temayı görmez ve bir dahaki sefere ayarlarını kaydettiğinde onu geri alabilir."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Поки Термінал відкритий, він не бачить нової теми й може відмінити її, коли наступного разу збереже свої налаштування."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“终端”在打开期间看不到新主题,并且可能会在下次保存设置时将其撤销。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "「終端機」打開期間看不到新主題,而且可能會在下次儲存設定時把主題改回來。"
+ }
+ }
+ }
+ },
"Why It Matters" : {
"localizations" : {
"cs" : {
diff --git a/Packages/PeelCore/Sources/PeelCore/Terminal/TerminalSettings.swift b/Packages/PeelCore/Sources/PeelCore/Terminal/TerminalSettings.swift
new file mode 100644
index 00000000..967e65d6
--- /dev/null
+++ b/Packages/PeelCore/Sources/PeelCore/Terminal/TerminalSettings.swift
@@ -0,0 +1,38 @@
+import AppKit
+
+public struct TerminalSettings: TerminalSettingsStoring, Sendable {
+ public static let identifier = "com.apple.Terminal"
+ private static let profilesKey = "Window Settings"
+
+ public init() {}
+
+ public var isTerminalOpen: Bool {
+ NSRunningApplication.runningApplications(withBundleIdentifier: Self.identifier).contains { !$0.isTerminated }
+ }
+
+ public var isManaged: Bool {
+ ([Self.profilesKey] + TerminalProfileRole.allCases.map(\.rawValue)).contains {
+ CFPreferencesAppValueIsForced($0 as CFString, Self.identifier as CFString)
+ }
+ }
+
+ public func profiles() -> [String: [String: Any]] {
+ CFPreferencesAppSynchronize(Self.identifier as CFString)
+ return CFPreferencesCopyAppValue(Self.profilesKey as CFString, Self.identifier as CFString) as? [String: [String: Any]] ?? [:]
+ }
+
+ public func setProfiles(_ profiles: [String: [String: Any]]) -> Bool {
+ CFPreferencesSetAppValue(Self.profilesKey as CFString, profiles as CFDictionary, Self.identifier as CFString)
+ return CFPreferencesAppSynchronize(Self.identifier as CFString)
+ }
+
+ public func profileName(for role: TerminalProfileRole) -> String? {
+ CFPreferencesAppSynchronize(Self.identifier as CFString)
+ return CFPreferencesCopyAppValue(role.rawValue as CFString, Self.identifier as CFString) as? String
+ }
+
+ public func setProfileName(_ name: String?, for role: TerminalProfileRole) -> Bool {
+ CFPreferencesSetAppValue(role.rawValue as CFString, name as CFString?, Self.identifier as CFString)
+ return CFPreferencesAppSynchronize(Self.identifier as CFString)
+ }
+}
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/StringCatalogTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/StringCatalogTests.swift
index 284d9a34..9b32edc3 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/StringCatalogTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/StringCatalogTests.swift
@@ -111,9 +111,9 @@ import Testing
}
static let sidebarNames = [
- "Home", "Tweaks", "History", "Settings", "Applications", "Orphaned Files", "Intel Software", "Package Receipts", "Space",
- "Developer", "Build Artifacts", "Installers and Backups", "Duplicates", "iCloud Drive", "File Search", "Background Items",
- "Extensions", "Plug-ins",
+ "Home", "Tweaks", "Terminal", "History", "Settings", "Applications", "Orphaned Files", "Intel Software",
+ "Package Receipts", "Space", "Developer", "Build Artifacts", "Installers and Backups", "Duplicates",
+ "iCloud Drive", "File Search", "Background Items", "Extensions", "Plug-ins",
]
static let sidebarMaximum: CGFloat = 320
static let sidebarRowInsets: CGFloat = 37
diff --git a/Peel/Model/QuitBeforeRemoving.swift b/Peel/Model/QuitBeforeRemoving.swift
index fe3468bc..a7981dbd 100644
--- a/Peel/Model/QuitBeforeRemoving.swift
+++ b/Peel/Model/QuitBeforeRemoving.swift
@@ -91,7 +91,7 @@ final class QuitBeforeRemoving {
/// Returns once every one of `processes` has exited, or the task is canceled. `isTerminated` is followed through
/// key-value observing, which Apple documents for it, since the workspace does not post a notice for every end.
- private static func untilGone(_ processes: [NSRunningApplication]) async {
+ static func untilGone(_ processes: [NSRunningApplication]) async {
let (changes, continuation) = AsyncStream.makeStream(of: Void.self, bufferingPolicy: .bufferingNewest(1))
let observations = processes.map { $0.observe(\.isTerminated) { _, _ in continuation.yield() } }
defer { observations.forEach { $0.invalidate() } }
diff --git a/Peel/Model/TerminalLibrary.swift b/Peel/Model/TerminalLibrary.swift
new file mode 100644
index 00000000..6bc0ff23
--- /dev/null
+++ b/Peel/Model/TerminalLibrary.swift
@@ -0,0 +1,80 @@
+import AppKit
+import Foundation
+import Observation
+import PeelCore
+
+@Observable
+final class TerminalLibrary {
+ enum Action: Equatable {
+ case use(TerminalTheme)
+ case putBack
+ }
+
+ private static let ledgerKey = "terminalThemes"
+ private static let patience: Duration = .seconds(10)
+
+ private let settings = TerminalSettings()
+ private var ledger: TerminalThemeLedger
+ private(set) var themeInUse: TerminalTheme?
+ private(set) var profileInUse: String?
+ private(set) var canPutBack = false
+ private(set) var isTerminalOpen = false
+ private(set) var isQuittingTerminal = false
+ private(set) var problem: TerminalThemeLedger.Outcome?
+ var waitingForTerminal: Action?
+ var terminalDidNotQuit = false
+
+ init() {
+ ledger = TerminalThemeLedger(stored: UserDefaults.standard.dictionary(forKey: Self.ledgerKey) ?? [:])
+ }
+
+ func refresh() {
+ profileInUse = settings.profileName(for: .newWindows)
+ themeInUse = ledger.theme(in: settings)
+ canPutBack = ledger.canPutBack
+ isTerminalOpen = settings.isTerminalOpen
+ }
+
+ func perform(_ action: Action) {
+ guard !settings.isTerminalOpen else {
+ waitingForTerminal = action
+ return
+ }
+ let outcome = switch action {
+ case .use(let theme): (try? ledger.use(theme, in: settings)) ?? .refused
+ case .putBack: ledger.putBack(in: settings)
+ }
+ UserDefaults.standard.set(ledger.stored, forKey: Self.ledgerKey)
+ problem = outcome == .managed || outcome == .refused ? outcome : nil
+ refresh()
+ }
+
+ func quitTerminal(andThen action: Action) async {
+ waitingForTerminal = nil
+ let running = NSRunningApplication.runningApplications(withBundleIdentifier: TerminalSettings.identifier)
+ isQuittingTerminal = true
+ defer { isQuittingTerminal = false }
+ running.forEach { $0.terminate() }
+ let didQuit = await withTaskGroup(of: Bool.self) { group in
+ group.addTask { await QuitBeforeRemoving.untilGone(running); return true }
+ group.addTask { try? await Task.sleep(for: Self.patience); return false }
+ let first = await group.next() ?? false
+ group.cancelAll()
+ return first
+ }
+ guard didQuit else {
+ terminalDidNotQuit = true
+ return
+ }
+ perform(action)
+ }
+
+ func openTerminal() {
+ guard let terminal = NSWorkspace.shared.urlForApplication(withBundleIdentifier: TerminalSettings.identifier) else { return }
+ if settings.isTerminalOpen {
+ NSWorkspace.shared.open([URL.homeDirectory], withApplicationAt: terminal, configuration: NSWorkspace.OpenConfiguration())
+ } else {
+ NSWorkspace.shared.openApplication(at: terminal, configuration: NSWorkspace.OpenConfiguration())
+ }
+ }
+}
diff --git a/Peel/Navigation/PeelIntents.swift b/Peel/Navigation/PeelIntents.swift
index b5e56d11..5d987293 100644
--- a/Peel/Navigation/PeelIntents.swift
+++ b/Peel/Navigation/PeelIntents.swift
@@ -24,6 +24,7 @@ enum PeelPlace: String, AppEnum {
case extensions
case plugins
case tweaks
+ case terminal
static let typeDisplayRepresentation = TypeDisplayRepresentation(name: "Place in Peel")
@@ -46,6 +47,7 @@ enum PeelPlace: String, AppEnum {
.extensions: "Extensions",
.plugins: "Plug-ins",
.tweaks: "Tweaks",
+ .terminal: "Terminal",
]
var tool: Tool {
@@ -68,6 +70,7 @@ enum PeelPlace: String, AppEnum {
case .extensions: .extensions
case .plugins: .plugins
case .tweaks: .tweaks
+ case .terminal: .terminal
}
}
}
diff --git a/Peel/Navigation/Tool.swift b/Peel/Navigation/Tool.swift
index a551e7e4..5101915d 100644
--- a/Peel/Navigation/Tool.swift
+++ b/Peel/Navigation/Tool.swift
@@ -1,7 +1,7 @@
import Foundation
/// A tool in the sidebar. The order of the cases is the order within each group, in the sidebar and in the View
-/// menu, where the first nine tools get ⌘1 to ⌘9. The `.home` group (Home, Tweaks, History) comes first.
+/// menu, where the first nine tools get ⌘1 to ⌘9. The `.home` group (Home, Tweaks, Terminal, History) comes first.
nonisolated enum Tool: String, CaseIterable, Identifiable {
case home
@@ -27,6 +27,7 @@ nonisolated enum Tool: String, CaseIterable, Identifiable {
case plugins
case tweaks
+ case terminal
case history
enum Group: CaseIterable {
@@ -40,7 +41,7 @@ nonisolated enum Tool: String, CaseIterable, Identifiable {
var group: Group {
switch self {
- case .home, .tweaks, .history: .home
+ case .home, .tweaks, .terminal, .history: .home
case .applications, .orphans, .intel, .packages, .homebrew: .apps
case .space, .developer, .projects, .installers, .duplicates, .cloud, .fileSearch: .storage
case .backgroundItems, .extensions, .plugins: .system
@@ -66,6 +67,7 @@ nonisolated enum Tool: String, CaseIterable, Identifiable {
case .extensions: "Extensions"
case .plugins: "Plug-ins"
case .tweaks: "Tweaks"
+ case .terminal: "Terminal"
case .history: "History"
}
}
@@ -89,6 +91,7 @@ nonisolated enum Tool: String, CaseIterable, Identifiable {
case .extensions: "puzzlepiece.extension"
case .plugins: "powerplug"
case .tweaks: "slider.horizontal.3"
+ case .terminal: "terminal"
case .history: "clock.arrow.circlepath"
}
}
diff --git a/Peel/PeelApp.swift b/Peel/PeelApp.swift
index 6429e84d..46b20ff9 100644
--- a/Peel/PeelApp.swift
+++ b/Peel/PeelApp.swift
@@ -37,6 +37,7 @@ struct PeelApp: App {
@State private var projects: ProjectLibrary
@State private var installers: InstallerLibrary
@State private var tweaks = TweakLibrary()
+ @State private var terminal = TerminalLibrary()
@State private var extensions = ExtensionLibrary()
@State private var cloud = CloudLibrary()
@State private var backgroundItems = BackgroundItemLibrary()
@@ -321,6 +322,7 @@ struct PeelApp: App {
.environment(projects)
.environment(installers)
.environment(tweaks)
+ .environment(terminal)
.environment(extensions)
.environment(cloud)
.environment(backgroundItems)
diff --git a/Peel/Views/ContentView.swift b/Peel/Views/ContentView.swift
index c68f05e5..91385719 100644
--- a/Peel/Views/ContentView.swift
+++ b/Peel/Views/ContentView.swift
@@ -57,11 +57,11 @@ struct ContentView: View {
.fixedSplitViewColumn(width: sidebarWidth)
}
- /// Home, Tweaks, iCloud Drive, Settings, and About are each one page rather than a list beside a detail, so
- /// they are shown in a split view with no content column: `NavigationSplitViewVisibility` cannot hide one of
- /// three. iCloud Drive's list is all it has, and its rows are the widest in the app.
+ /// Home, Tweaks, Terminal, iCloud Drive, Settings, and About are each one page rather than a list beside a
+ /// detail, so they are shown in a split view with no content column: `NavigationSplitViewVisibility` cannot hide
+ /// one of three. iCloud Drive's list is all it has, and its rows are the widest in the app.
private var isWholePage: Bool {
- drawn.page != nil || drawn.tool == .home || drawn.tool == .tweaks || drawn.tool == .cloud
+ drawn.page != nil || [Tool.home, .tweaks, .terminal, .cloud].contains(drawn.tool)
}
@ViewBuilder
@@ -79,6 +79,8 @@ struct ContentView: View {
case .tool, nil:
if drawn.tool == .tweaks {
TweakPage()
+ } else if drawn.tool == .terminal {
+ TerminalPage()
} else if drawn.tool == .cloud {
CloudView()
} else {
@@ -275,8 +277,8 @@ struct ContentView: View {
case .intel:
IntelList()
.listColumn()
- // Tweaks is shown as a whole page, never as a column.
- case .tweaks:
+ // Tweaks and Terminal are shown as whole pages, never as a column.
+ case .tweaks, .terminal:
EmptyView()
case .history:
HistoryList()
@@ -322,7 +324,7 @@ struct ContentView: View {
spaceDetail
case .intel:
intelDetail
- case .tweaks:
+ case .tweaks, .terminal:
EmptyView()
case .history:
historyDetail
diff --git a/Peel/Views/Terminal/TerminalPage.swift b/Peel/Views/Terminal/TerminalPage.swift
new file mode 100644
index 00000000..0a689e7f
--- /dev/null
+++ b/Peel/Views/Terminal/TerminalPage.swift
@@ -0,0 +1,143 @@
+import AppKit
+import PeelCore
+import SwiftUI
+
+struct TerminalPage: View {
+ @Environment(TerminalLibrary.self) private var terminal
+
+ var body: some View {
+ Form {
+ Section("In Use") {
+ TerminalThemeInUse()
+ }
+ Section("Themes") {
+ TerminalThemeGrid()
+ }
+ }
+ .formStyle(.grouped)
+ .navigationTitle(Text(Tool.terminal.title))
+ .task {
+ terminal.refresh()
+ }
+ .onReceive(NotificationCenter.default.publisher(for: NSApplication.didBecomeActiveNotification)) { _ in
+ terminal.refresh()
+ }
+ .onReceive(NSWorkspace.shared.notificationCenter.publisher(for: NSWorkspace.didLaunchApplicationNotification)) { _ in
+ terminal.refresh()
+ }
+ .onReceive(NSWorkspace.shared.notificationCenter.publisher(for: NSWorkspace.didTerminateApplicationNotification)) { _ in
+ terminal.refresh()
+ }
+ .alert("Quit Terminal first?", isPresented: isWaitingForTerminal, presenting: terminal.waitingForTerminal) { action in
+ Button("Quit Terminal") {
+ Task { await terminal.quitTerminal(andThen: action) }
+ }
+ Button("Cancel", role: .cancel) {}
+ } message: { _ in
+ Text("While Terminal is open, it doesn’t see a new theme, and can undo it the next time it saves its settings.")
+ }
+ .alert("Terminal didn’t quit.", isPresented: Bindable(terminal).terminalDidNotQuit) {
+ Button("OK", role: .cancel) {}
+ } message: {
+ Text("It may be asking whether to stop a command that is still running.")
+ }
+ }
+
+ private var isWaitingForTerminal: Binding<Bool> {
+ Binding(
+ get: { terminal.waitingForTerminal != nil },
+ set: { if !$0 { terminal.waitingForTerminal = nil } }
+ )
+ }
+}
+
+private struct TerminalThemeInUse: View {
+ @Environment(TerminalLibrary.self) private var terminal
+
+ var body: some View {
+ ViewThatFits(in: .horizontal) {
+ HStack(alignment: .center, spacing: 18) {
+ preview
+ .frame(width: 300)
+ words
+ }
+ VStack(alignment: .leading, spacing: 14) {
+ preview
+ words
+ }
+ }
+ .padding(.vertical, 6)
+ }
+
+ @ViewBuilder
+ private var preview: some View {
+ if let theme = terminal.themeInUse {
+ TerminalSession(theme: theme)
+ } else {
+ Image(systemName: "terminal")
+ .font(.system(size: 40))
+ .foregroundStyle(.secondary)
+ .frame(maxWidth: .infinity, minHeight: 120)
+ .background(.quaternary, in: .rect(cornerRadius: 10))
+ .accessibilityHidden(true)
+ }
+ }
+
+ private var words: some View {
+ VStack(alignment: .leading, spacing: 6) {
+ Text(verbatim: terminal.themeInUse?.name ?? terminal.profileInUse ?? String(localized: Tool.terminal.title))
+ .font(.title3.weight(.semibold))
+ Text(terminal.themeInUse == nil
+ ? "Choose a theme below, and Terminal opens with it."
+ : "Terminal opens with this theme, and every new window uses it.")
+ .foregroundStyle(.secondary)
+ .fixedSize(horizontal: false, vertical: true)
+ FlowLayout(spacing: 8) {
+ Button(terminal.isTerminalOpen ? "Open a New Window" : "Open Terminal") {
+ terminal.openTerminal()
+ }
+ if terminal.canPutBack {
+ Button("Put Back") {
+ terminal.perform(.putBack)
+ }
+ .transition(.opacity)
+ }
+ }
+ .buttonStyle(.bordered)
+ .disabled(terminal.isQuittingTerminal)
+ .padding(.top, 4)
+ if terminal.problem == .managed {
+ Label("Locked by a profile", systemImage: "lock")
+ .font(.caption)
+ .foregroundStyle(Color.accentColor)
+ } else if terminal.problem == .refused {
+ Label("macOS refused it", systemImage: "exclamationmark.triangle")
+ .font(.caption)
+ .foregroundStyle(Color.accentColor)
+ }
+ }
+ .motion(value: terminal.canPutBack)
+ }
+}
+
+private struct TerminalThemeGrid: View {
+ @Environment(TerminalLibrary.self) private var terminal
+
+ var body: some View {
+ LazyVGrid(columns: [GridItem(.adaptive(minimum: 116), spacing: 14)], spacing: 16) {
+ ForEach(TerminalThemeCatalog.all) { theme in
+ let isInUse = terminal.themeInUse == theme
+ Button {
+ terminal.perform(.use(theme))
+ } label: {
+ TerminalThemeCard(theme: theme, isInUse: isInUse)
+ }
+ .buttonStyle(.plain)
+ .accessibilityLabel(Text(verbatim: theme.name))
+ .accessibilityAddTraits(isInUse ? .isSelected : [])
+ }
+ }
+ .disabled(terminal.isQuittingTerminal)
+ .padding(.vertical, 8)
+ }
+}
diff --git a/Peel/Views/Terminal/TerminalPreview.swift b/Peel/Views/Terminal/TerminalPreview.swift
new file mode 100644
index 00000000..1b28b1ed
--- /dev/null
+++ b/Peel/Views/Terminal/TerminalPreview.swift
@@ -0,0 +1,117 @@
+import PeelCore
+import SwiftUI
+
+extension Color {
+ init(terminal color: UInt32) {
+ self.init(.sRGB, red: Double(color >> 16 & 0xFF) / 255, green: Double(color >> 8 & 0xFF) / 255, blue: Double(color & 0xFF) / 255)
+ }
+}
+
+struct TerminalSession: View {
+ let theme: TerminalTheme
+
+ var body: some View {
+ VStack(alignment: .leading, spacing: 3) {
+ line(prompt("ls"))
+ line(run("Peel/", 4) + run(" ") + run("PeelCLI/", 4) + run(" README.md ") + run("build.sh*", 2))
+ line(prompt("git status -s"))
+ line(run(" M", 1) + run(" ContentView.swift"))
+ line(run("??", 1) + run(" notes.md"))
+ line(prompt("swift test"))
+ line(run("✓", 2) + run(" 1549 tests passed ") + run("(17 s)", 8))
+ line(run("⚠", 3) + run(" 2 warnings"))
+ line(run("✗ 1 failure", 1) + run(":", 8) + run(" ThemeTests"))
+ swatches(0..<8)
+ .padding(.top, 4)
+ swatches(8..<16)
+ HStack(spacing: 0) {
+ line(prompt(""))
+ Rectangle()
+ .fill(Color(terminal: theme.cursor))
+ .frame(width: 7, height: 13)
+ }
+ .padding(.top, 4)
+ }
+ .font(.system(size: 11, design: .monospaced))
+ .padding(12)
+ .frame(maxWidth: .infinity, alignment: .leading)
+ .background(Color(terminal: theme.background), in: .rect(cornerRadius: 10))
+ .overlay { RoundedRectangle(cornerRadius: 10).strokeBorder(.separator) }
+ .accessibilityHidden(true)
+ }
+
+ private func line(_ text: AttributedString) -> some View {
+ Text(text)
+ .lineLimit(1)
+ .fixedSize()
+ }
+
+ private func run(_ text: String, _ slot: Int? = nil) -> AttributedString {
+ var run = AttributedString(text)
+ run.foregroundColor = Color(terminal: slot.map { theme.ansi[$0] } ?? theme.text)
+ return run
+ }
+
+ private func prompt(_ command: String) -> AttributedString {
+ run("~/Projects/peel", 6) + run(" main", 3) + run(" ❯ ", 2) + run(command)
+ }
+
+ private func swatches(_ slots: Range<Int>) -> some View {
+ HStack(spacing: 3) {
+ ForEach(slots, id: \.self) { slot in
+ RoundedRectangle(cornerRadius: 2)
+ .fill(Color(terminal: theme.ansi[slot]))
+ .frame(width: 18, height: 9)
+ }
+ }
+ }
+}
+
+struct TerminalThemeCard: View {
+ let theme: TerminalTheme
+ let isInUse: Bool
+
+ var body: some View {
+ VStack(spacing: 7) {
+ VStack(alignment: .leading, spacing: 5) {
+ bars([(6, 34), (3, 14), (2, 8)])
+ bars([(4, 22), (nil, 40)])
+ bars([(1, 12), (8, 30)])
+ Spacer(minLength: 0)
+ HStack(spacing: 2) {
+ ForEach([1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14], id: \.self) { slot in
+ RoundedRectangle(cornerRadius: 1)
+ .fill(Color(terminal: theme.ansi[slot]))
+ .frame(width: 6, height: 6)
+ }
+ }
+ }
+ .padding(8)
+ .frame(maxWidth: .infinity, minHeight: 64, maxHeight: 64, alignment: .topLeading)
+ .background(Color(terminal: theme.background), in: .rect(cornerRadius: 8))
+ .overlay { RoundedRectangle(cornerRadius: 8).strokeBorder(.separator) }
+ .overlay {
+ if isInUse {
+ RoundedRectangle(cornerRadius: 11)
+ .inset(by: -3)
+ .strokeBorder(Color.accentColor, lineWidth: 2)
+ }
+ }
+ Text(verbatim: theme.name)
+ .font(.caption)
+ .lineLimit(1)
+ .truncationMode(.tail)
+ }
+ .contentShape(.rect)
+ }
+
+ private func bars(_ parts: [(slot: Int?, width: CGFloat)]) -> some View {
+ HStack(spacing: 3) {
+ ForEach(parts.indices, id: \.self) { index in
+ Capsule()
+ .fill(Color(terminal: parts[index].slot.map { theme.ansi[$0] } ?? theme.text))
+ .frame(width: parts[index].width, height: 4)
+ }
+ }
+ }
+}
diff --git a/Peel/Views/ToolSummaries.swift b/Peel/Views/ToolSummaries.swift
index 0f5ad261..14b6084a 100644
--- a/Peel/Views/ToolSummaries.swift
+++ b/Peel/Views/ToolSummaries.swift
@@ -33,7 +33,7 @@ extension Tool {
?? AttributedString(localized: "^[\(count) item](inflect: true).")
case .intel:
return AttributedString(localized: "^[\(count) item](inflect: true) built for Intel.")
- case .home, .packages, .backgroundItems, .extensions, .plugins, .tweaks, .history:
+ case .home, .packages, .backgroundItems, .extensions, .plugins, .tweaks, .terminal, .history:
return nil
}
}
@@ -50,7 +50,7 @@ extension Tool {
case .projects: AttributedString(localized: "^[\(count) project](inflect: true)")
case .space: AttributedString(localized: "^[\(count) area](inflect: true)")
case .installers, .cloud, .fileSearch, .intel: AttributedString(localized: "^[\(count) item](inflect: true)")
- case .home, .packages, .backgroundItems, .extensions, .plugins, .tweaks, .history: nil
+ case .home, .packages, .backgroundItems, .extensions, .plugins, .tweaks, .terminal, .history: nil
}
return words.map { String($0.characters) }
}