def unmount(): vols = "/Volumes" for name in os.listdir(vols): if name == "Macintosh HD": continue path = join(vols, name) if os.path.isdir(path): run(["diskutil", "unmount", path])
def fantastical(*words): run([expand_path("~/bin/fantastical.sh")] + list(words))
def dvorak(): run('keyboardSwitcher select Dvorak')
def qwerty(): run('keyboardSwitcher select U.S.')
def chrome(*URIs): URIs = [URI for URI in URIs if URI != "-"] URLs = [commander.helpers.add_protocol(URI) for URI in URIs] run(["open", "-a", "Google Chrome"] + URLs)
def okc(clip_profile): profile = profile_URL(clip_profile) if profile: run(["open", "-a", "Safari", profile])
def firefox(*URIs): URIs = [URI for URI in URIs if URI != "-"] URLs = [commander.helpers.add_protocol(URI) for URI in URIs] run(["open", "-a", "firefox"] + URLs)
def notes(): run( ["/usr/local/Caskroom/google-chrome/latest/Google Chrome.app/Contents/MacOS/Google Chrome", "--incognito", expand_path("~/projects/dotfiles/notes.html")] )
def editor(path): path = expand_path(path) run(["/usr/local/bin/atom", path])
def calc(): run("open -a Calculator")
def te(): # helpers.run is a convenient way to run command line stuff # It can take a string or a list of string arguments run("open -a Textedit")