Exemplo n.º 1
0
def main():
    meta = {
        'artist': str(sh.playerctl('metadata', 'artist').wait()),
        #'album': str(sh.playerctl('metadata', 'album').wait()),
        'track': str(sh.playerctl('metadata', 'title').wait()),
    }
    print('  {artist} - {track} '.format(**meta))
Exemplo n.º 2
0
def now_playing():
    META_FILE_REGEX=re.compile(b"xesam:url.+file://(.+)")
    ### Grab the URLEncoded file path from the 'playerctl meta' command
    command = sh.playerctl('metadata')

    from urllib.parse import unquote

    encoded_filepath = META_FILE_REGEX.search(command.stdout).groups()[0]
    filepath = unquote(encoded_filepath)
    filename = filepath.split('/')[-1]

    return '.'.join(filename.split('.')[:-1])
Exemplo n.º 3
0
def previous(qtile):
    sh.playerctl('previous')
Exemplo n.º 4
0
def next(qtile):
    sh.playerctl('next')
Exemplo n.º 5
0
def stop(qtile):
    sh.playerctl('stop')
Exemplo n.º 6
0
def play_pause(qtile):
    sh.playerctl('play-pause')