Skip to content

Instantly share code, notes, and snippets.

@artnikbrothers
Created January 17, 2017 23:26
Show Gist options
  • Save artnikbrothers/c08a7892265fbc909882232679f88fb7 to your computer and use it in GitHub Desktop.
Save artnikbrothers/c08a7892265fbc909882232679f88fb7 to your computer and use it in GitHub Desktop.
# toggle iTerm Dock icon
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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment