Skip to content

Instantly share code, notes, and snippets.

@rohmann
Last active March 18, 2017 20:25
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 rohmann/d019846549fd3dfe59ce to your computer and use it in GitHub Desktop.
Save rohmann/d019846549fd3dfe59ce to your computer and use it in GitHub Desktop.
Cleanup cmd+tab and the dock by launching apps in the background. You can still open their main windows with Alfred/Spotlight.
# Go away
defaults write "$(mdfind kMDItemCFBundleIdentifier = 'com.skype.skype')/Contents/Info.plist" "LSUIElement" -string "1" && killall Skype
# Come back
defaults write "$(mdfind kMDItemCFBundleIdentifier = 'com.skype.skype')/Contents/Info.plist" "LSUIElement" -string "0" && killall Skype
# If you get any requests to use the keychain, they should go away the next time you restart your mac. You may be asked to sign into Skype again.
# Go away
defaults write "$(mdfind kMDItemCFBundleIdentifier = 'com.spotify.client')/Contents/Info.plist" "LSUIElement" -string "1" && killall Spotify
# Come back
defaults write "$(mdfind kMDItemCFBundleIdentifier = 'com.spotify.client')/Contents/Info.plist" "LSUIElement" -string "0" && killall Spotify
@rohmann
Copy link
Author

rohmann commented Oct 26, 2015

To determine a bundle ID for any given application you can use mdls. Here's an example of how to do it for Skype:

cd /Applications # Or if you're using Homebrew Cask it will be more like: /opt/homebrew-cask/Caskroom/Skype/latest
mdls Skype.app | grep CFBundleIdentifier

You'll see the bundle identifier show up in quotes

@mgroth0
Copy link

mgroth0 commented Mar 18, 2017

Spotify crashes on startup for me if LSUIElement is set to 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment