all repos — dotfiles @ de4be0e38864ac8fc2b7821a7d6c6e1d9fecb6b2

my *nix dotfiles

scripts/spoti.py (view raw)

 1#!/usr/bin/python 
 2
 3import os
 4
 5cmd = os.popen('playerctl -p spotify status').read()
 6cmd = cmd.split('\n')
 7cmd = cmd[0]
 8
 9meta_artist = os.popen('playerctl -p spotify metadata xesam:artist').read()
10meta_title = os.popen('playerctl -p spotify metadata xesam:title').read()
11
12if cmd == "Playing":
13    print('' + meta_title + ' - ' + meta_artist)
14
15elif cmd == 'Paused':
16    print('' + meta_title + ' - ' + meta_artist)
17
18else:
19    print(' no music playing')
20