コード例 #1
0
ファイル: commander.py プロジェクト: focusaurus/dotfiles
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
ファイル: commander.py プロジェクト: focusaurus/dotfiles
def fantastical(*words):
    run([expand_path("~/bin/fantastical.sh")] + list(words))
コード例 #3
0
ファイル: commander.py プロジェクト: focusaurus/dotfiles
def dvorak():
    run('keyboardSwitcher select Dvorak')
コード例 #4
0
ファイル: commander.py プロジェクト: focusaurus/dotfiles
def qwerty():
    run('keyboardSwitcher select U.S.')
コード例 #5
0
ファイル: commander.py プロジェクト: focusaurus/dotfiles
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
ファイル: commander.py プロジェクト: focusaurus/dotfiles
def okc(clip_profile):
    profile = profile_URL(clip_profile)
    if profile:
        run(["open", "-a", "Safari", profile])
コード例 #7
0
ファイル: commander.py プロジェクト: focusaurus/dotfiles
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
ファイル: commander.py プロジェクト: focusaurus/dotfiles
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
ファイル: commander.py プロジェクト: focusaurus/dotfiles
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")