Beispiel #1
0
def get_current_volume(type='output'):
    cmd = 'get volume settings'
    settings = myosascript.run(cmd)
    # assert len(settings) == 1, "Wrong output: %s" % cmd
    # assert type(settings[0]) == str, "Wrong type of: %s" % settings[0]
    # assert len(settings[0].split(', ')) == 4, "Wrong format of: %s" % settings[0].split(', ')
    # assert len(settings[0].split(', ')[0].split(':')) == 2, "Wrong format of: %s" % settings[0].split(', ')[0]
    # assert type(settings[0].split(', ')[0].split(':')[1]) == str, "Wrong type of: %s" % settings[0].split(', ')[0].split(':')[1]
    return int(
        settings[0].split(', ')[0].split(':')[1]) if type == 'output' else int(
            settings[0].split(', ')[1].split(':')[1]) if type == 'input' else 0
Beispiel #2
0
def press_space():
    myosascript.run(TMPL_K % '49')
Beispiel #3
0
def press_esc():
    myosascript.run(TMPL_K % '53')
Beispiel #4
0
def brightness_down():
    myosascript.run(TMPL_K_U % ('107', 'function down'))
Beispiel #5
0
def brightness_up():
    myosascript.run(TMPL_K_U % ('113', 'function down'))
Beispiel #6
0
def keystroke_return():
    myosascript.run(TMPL_KS % 'return')
Beispiel #7
0
def keystroke(val):
    myosascript.run(TMPL_KS % '"' + val + '"')
Beispiel #8
0
def press_return():
    myosascript.run(TMPL_K % '36')
Beispiel #9
0
def press_enter():
    myosascript.run(TMPL_K % '76')
Beispiel #10
0
def press_right():
    myosascript.run(TMPL_K % '124')
Beispiel #11
0
def press_left():
    myosascript.run(TMPL_K % '123')
Beispiel #12
0
def press_up():
    myosascript.run(TMPL_K % '126')
Beispiel #13
0
def press_down():
    myosascript.run(TMPL_K % '125')
Beispiel #14
0
def press_delete():
    myosascript.run(TMPL_K % '51')
Beispiel #15
0
def unlock():
    myosascript.run(TMPL % 'click at {0, 0}')
    myosascript.run(TMPL_KS % '2002')
    myosascript.run(TMPL_K % '76')
Beispiel #16
0
def set_input_volume(val):
    myosascript.run('set volume input volume %s' % val)