all repos — dotfiles @ 132998af8625888303ba5b7997d1c64349e9b0c2

my *nix dotfiles

bin/spoti.py (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
#!/usr/bin/python 

import os

cmd = os.popen('playerctl -p spotify status').read()
cmd = cmd.split('\n')
cmd = cmd[0]

meta_artist = os.popen('playerctl -p spotify metadata xesam:artist').read()
meta_title = os.popen('playerctl -p spotify metadata xesam:title').read()

if cmd == "Playing":
    print(' ' + meta_title + ' - ' + meta_artist)

elif cmd == 'Paused':
    print(' ' + meta_title + ' - ' + meta_artist)

else:
    print(' no music playing')