Skip to content

Instantly share code, notes, and snippets.

@githubhy
Forked from lg0/toggleiTerm2icon
Last active March 27, 2016 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save githubhy/0c57c23a21f6d94b73d9 to your computer and use it in GitHub Desktop.
Save githubhy/0c57c23a21f6d94b73d9 to your computer and use it in GitHub Desktop.
show/hide iTerm2 Dock icon
# 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 'iTerm2' to exit, and then relaunch it"
break
;;
'Cancel' )
break
;;
esac
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment