示例#1
0
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])
示例#2
0
def fantastical(*words):
    run([expand_path("~/bin/fantastical.sh")] + list(words))
示例#3
0
def dvorak():
    run('keyboardSwitcher select Dvorak')
示例#4
0
def qwerty():
    run('keyboardSwitcher select U.S.')
示例#5
0
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)
示例#6
0
def okc(clip_profile):
    profile = profile_URL(clip_profile)
    if profile:
        run(["open", "-a", "Safari", profile])
示例#7
0
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)
示例#8
0
def notes():
    run(
        ["/usr/local/Caskroom/google-chrome/latest/Google Chrome.app/Contents/MacOS/Google Chrome",
        "--incognito",
        expand_path("~/projects/dotfiles/notes.html")]
        )
示例#9
0
def editor(path):
    path = expand_path(path)
    run(["/usr/local/bin/atom", path])
示例#10
0
def calc():
    run("open -a Calculator")
示例#11
0
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")