Пример #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
Пример #2
0
def press_space():
    myosascript.run(TMPL_K % '49')
Пример #3
0
def press_esc():
    myosascript.run(TMPL_K % '53')
Пример #4
0
def brightness_down():
    myosascript.run(TMPL_K_U % ('107', 'function down'))
Пример #5
0
def brightness_up():
    myosascript.run(TMPL_K_U % ('113', 'function down'))
Пример #6
0
def keystroke_return():
    myosascript.run(TMPL_KS % 'return')
Пример #7
0
def keystroke(val):
    myosascript.run(TMPL_KS % '"' + val + '"')
Пример #8
0
def press_return():
    myosascript.run(TMPL_K % '36')
Пример #9
0
def press_enter():
    myosascript.run(TMPL_K % '76')
Пример #10
0
def press_right():
    myosascript.run(TMPL_K % '124')
Пример #11
0
def press_left():
    myosascript.run(TMPL_K % '123')
Пример #12
0
def press_up():
    myosascript.run(TMPL_K % '126')
Пример #13
0
def press_down():
    myosascript.run(TMPL_K % '125')
Пример #14
0
def press_delete():
    myosascript.run(TMPL_K % '51')
Пример #15
0
def unlock():
    myosascript.run(TMPL % 'click at {0, 0}')
    myosascript.run(TMPL_KS % '2002')
    myosascript.run(TMPL_K % '76')
Пример #16
0
def set_input_volume(val):
    myosascript.run('set volume input volume %s' % val)