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