Created
December 5, 2022 02:04
-
-
Save thevar1able/6fd1587ae4092e0da9a2be835af28b9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ ❱ cat .bin/open-iterm2 | |
#!/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 | |
~ ❱ cat .skhdrc | |
# Open iTerm2 | |
cmd - return : open -a /Applications/iTerm.app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment