aboutsummaryrefslogtreecommitdiff
path: root/.config/yabai/iterm2_open
diff options
context:
space:
mode:
authorNicholas Tay <nkt@outlook.kr>2021-04-10 17:06:11 +1000
committerNicholas Tay <nkt@outlook.kr>2021-04-10 17:06:11 +1000
commita0d7689b1e3c7fd74fab9df1ae74e2a6de62fe9b (patch)
treef3f1afbfabc83ca286516020431ad57322d284f4 /.config/yabai/iterm2_open
parentc1aae3af259b6ea254d66c334f3d398c19029518 (diff)
downloaddotlite-a0d7689b1e3c7fd74fab9df1ae74e2a6de62fe9b.tar.gz
dotlite-a0d7689b1e3c7fd74fab9df1ae74e2a6de62fe9b.tar.bz2
dotlite-a0d7689b1e3c7fd74fab9df1ae74e2a6de62fe9b.zip
Add basic osx yabai+skhd conf
Diffstat (limited to '.config/yabai/iterm2_open')
-rwxr-xr-x.config/yabai/iterm2_open13
1 files changed, 13 insertions, 0 deletions
diff --git a/.config/yabai/iterm2_open b/.config/yabai/iterm2_open
new file mode 100755
index 0000000..fd9efe4
--- /dev/null
+++ b/.config/yabai/iterm2_open
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+# Detects if iTerm2 is running
+if ! pgrep -f "iTerm" > /dev/null; then
+ open -a "/Applications/iTerm.app"
+else
+ # Create a new window
+ if ! osascript -e 'tell application "iTerm2" to create window with default profile' > /dev/null; then
+ # Get pids for any app with "iTerm" and kill
+ for i in $(pgrep -f "iTerm"); do kill -15 "$i"; done
+ open -a "/Applications/iTerm.app"
+ fi
+fi