Created
March 14, 2011 17:56
-
-
Save bmorton/869549 to your computer and use it in GitHub Desktop.
iTunes workaround to keep it from launching with the play key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys, os, subprocess | |
launch = True | |
blocker = "" | |
apps = ["Vox", "VLC"] | |
ps = subprocess.Popen("/bin/ps -x", shell=True, stdout=subprocess.PIPE) | |
for line in ps.stdout.read().split("\n"): | |
for app in apps: | |
if app in line: | |
launch = False | |
blocker = app | |
ps.stdout.close() | |
if launch : | |
os.spawnvp(os.P_WAIT, '/Applications/iTunes.app/Contents/MacOS/iTunesX', sys.argv) | |
else : | |
print "Not launching iTunes while %s is running." % blocker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /Applications/iTunes.app/Contents/MacOS | |
sudo mv iTunes iTunesX | |
sudo curl https://gist.github.com/raw/869549/9a0c66bec241afbe04af2aeb72677be5f5d2505d/iTunes -O | |
sudo chmod uog+x iTunes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment