diff --git a/OpenInTerminal/Terminals/TerminalApp.swift b/OpenInTerminal/Terminals/TerminalApp.swift index 1fc1e82..8a83ead 100644 --- a/OpenInTerminal/Terminals/TerminalApp.swift +++ b/OpenInTerminal/Terminals/TerminalApp.swift @@ -17,7 +17,7 @@ final class TerminalApp : Terminal { throw OITError.wrongUrl } - let terminal = SBApplication(bundleIdentifier: "com.apple.Terminal")! as TerminalApplication + let terminal = SBApplication(bundleIdentifier: TerminalType.terminal.rawValue)! as TerminalApplication guard let open = terminal.open else { throw OITError.cannotAccessTerminal diff --git a/README-zh.md b/README-zh.md index 3646533..d1ca823 100644 --- a/README-zh.md +++ b/README-zh.md @@ -1,8 +1,8 @@ # OpenInTerminal -一个可以在终端(iTerm 或 Hyper)中打开当前目录的访达工具栏应用程序。 +一个可以在终端([`iTerm`](https://www.iterm2.com/) 或 [`Hyper`](https://github.com/zeit/hyper))中打开当前目录的访达工具栏应用程序。 -## 如何使用 +## 如何使用 🚀 ### 1) 在终端中打开当前目录 @@ -12,20 +12,28 @@ ![run2](./screenshots/run2.gif) -### 3) 其他 +### 3) 设置默认终端 -如果既没有打开访达窗口,也没有选中文件夹,那么程序将会在 `Terminal` 或者 `iTerm` 里打开 `Home` 目录。 +在第一次运行应用的时候,你需要选择默认终端。 -## 如何安装 +![selector](/Users/jianing/Program/GitHub/OpenInTerminal/screenshots/selector.png) + +当你设置了默认终端之后,选择框将不会再出现。如果你想要重新设置默认终端,请在终端中输入以下命令。然后重新运行应用。 + +``` +defaults remove wang.jianing.OpenInTerminal OIT_TerminalBundleIdentifier +``` + +## 如何安装 🖥 1. 从 [release](https://github.com/Ji4n1ng/OpenInTerminal/releases) 中下载。 2. 将应用移动到 `应用程序` 文件夹. -3. 右键点击`访达`工具栏,选择`自定义工具栏`。将应用拖到工具栏中。 +3. 按住 `Cmd` 键,然后将应用拖到访达工具栏中。 4. 完成。 > ⚠️ 当您第一次运行应用程序时,macOS 将要求访问 `访达` 和 `终端`(或 `iTerm`)的权限。请给予应用程序权限。 -![toolbar](./screenshots/toolbar-zh.gif) +![toolbar](./screenshots/toolbar.gif) ### 如果你正在使用深色模式 (Dark Mode) diff --git a/README.md b/README.md index 2826f75..2eb20d0 100644 --- a/README.md +++ b/README.md @@ -14,18 +14,26 @@ ![run2](./screenshots/run2.gif) -### 3) Other +### 3) Set default terminal -If neither Finder window is opened nor the folder is selected, this app will open `home directory` in `Terminal`, `iTerm` or `Hyper`. +You are asked to set the default terminal to open after first launch. + +![selector](./screenshots/selector.png) + +The selection box will not appear after you have set the default terminal. If you want to reset the default terminal, please enter the following command in the terminal. Then just run the application again. + +``` +defaults remove wang.jianing.OpenInTerminal OIT_TerminalBundleIdentifier +``` ## How to Install 🖥 1. Download from [release](https://github.com/Ji4n1ng/OpenInTerminal/releases). 2. Move the app into `/Applications`. -3. Right click on the Finder toolbar. Choose `Customize Toolbar`. Drag the app into Finder Toolbar. +3. Hold down the `Cmd` key and drag the app into Finder Toolbar. 4. Done. -> ⚠️ macOS will ask your permissions to access Finder and Terminal (or iTerm) when you run the app for the first time. Please give the application permissions. +> ⚠️ macOS will ask your permissions to access Finder and Terminal (iTerm or Hyper) when you run the app for the first time. Please give the application permissions. ![toolbar](./screenshots/toolbar.gif) @@ -51,6 +59,11 @@ xcodebuild ## Changes 🗒 +**version 0.2.0** + +- Add terminal selector +- Cancel running `clear` command when opening iTerm + **version 0.1.1** - Support `Hyper` @@ -62,6 +75,12 @@ xcodebuild ## Special Thanks to ❤️ +### Contributors + +- [Camji55](https://github.com/Camji55) + +### Reference projects + - [jbtule/cdto](https://github.com/jbtule/cdto) - [es-kumagai/OpenTerminal](https://github.com/es-kumagai/OpenTerminal) - [tingraldi/SwiftScripting](https://github.com/tingraldi/SwiftScripting) \ No newline at end of file diff --git a/screenshots/selector.png b/screenshots/selector.png new file mode 100644 index 0000000..4b46168 Binary files /dev/null and b/screenshots/selector.png differ diff --git a/screenshots/toolbar.gif b/screenshots/toolbar.gif index bf02d0c..d7705f2 100644 Binary files a/screenshots/toolbar.gif and b/screenshots/toolbar.gif differ diff --git a/screenshots/toolbar2.gif b/screenshots/toolbar2.gif new file mode 100644 index 0000000..bf02d0c Binary files /dev/null and b/screenshots/toolbar2.gif differ