Skip to content

Instantly share code, notes, and snippets.

@andriyslyusar
Forked from lg0/toggleiTerm2icon
Last active August 29, 2015 14:17
Show Gist options
  • Save andriyslyusar/cc527aa6c32646ebd752 to your computer and use it in GitHub Desktop.
Save andriyslyusar/cc527aa6c32646ebd752 to your computer and use it in GitHub Desktop.
# toggle iTerm Dock icon
# add this to your .bash_profile or .zshrc
function toggleiTerm() {
pb='/usr/libexec/PlistBuddy'
iTerm='/Applications/iTerm.app/Contents/Info.plist'
echo "Do you wish to hide iTerm in Dock?"
select ync in "Hide" "Show" "Cancel"; do
case $ync in
'Hide' )
$pb -c "Add :LSUIElement bool true" $iTerm
echo "relaunch iTerm to take effectives"
break
;;
'Show' )
$pb -c "Delete :LSUIElement" $iTerm
echo "run killall 'iTerm' to exit, and then relaunch it"
break
;;
'Cancel' )
break
;;
esac
done
}
## .bash_profile does not exist
## 1) cd ~/
## 2) create: touch .bash_profile
## 3) reload: . .bash_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment