refactor
This commit is contained in:
parent
66c05f9093
commit
45d6f4b0f3
205 changed files with 9040 additions and 342 deletions
14
modules/darwin/desktop/addons/skhd/scripts/open-iterm2.sh
Normal file
14
modules/darwin/desktop/addons/skhd/scripts/open-iterm2.sh
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Detects if iTerm2 is running
|
||||
if ! pgrep -f "iTerm" > /dev/null 2>&1; then
|
||||
open -a "/Applications/Nix Apps/iTerm2.app"
|
||||
else
|
||||
# Create a new window
|
||||
script='tell application "iTerm2" to create window with default profile'
|
||||
! osascript -e "${script}" > /dev/null 2>&1 && {
|
||||
# Get pids for any app with "iTerm" and kill
|
||||
while IFS="" read -r pid; do
|
||||
kill -15 "${pid}"
|
||||
done < <(pgrep -f "iTerm")
|
||||
open -a "/Applications/Nix Apps/iTerm2.app"
|
||||
}
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue