skhd: Switch to an iTerm2 script

It now tries to tell an existing iT2 process to open a window instead
This commit is contained in:
Salt 2020-04-06 06:51:49 -05:00
parent cef5669577
commit 3283aa4889
2 changed files with 16 additions and 1 deletions

View File

@ -1,5 +1,5 @@
# Open Terminal
cmd - return : /Applications/iTerm.app/Contents/MacOS/iTerm2
cmd - return : ~/.config/yabai/open-iterm2.sh
# Navigation
cmd - h : yabai -m window --focus west

15
.config/yabai/open-iterm2.sh Executable file
View File

@ -0,0 +1,15 @@
#! /bin/sh
#
# open-iterm2.sh
# Copyright (C) 2020 Vintage Salt <rehashedsalt@cock.li>
#
# Distributed under terms of the MIT license.
#
if pgrep -f "iTerm" > /dev/null 2>&1; then
exec open -a "/Applications/iTerm.app"
elif ! osascript -e 'tell application "iTerm2" to create window with default profile' > /dev/null 2>&1; then
killall "iTerm"
exec open -a "/Applications/iTerm.app"
fi