C++ for polybars spotify playbutton control instead of python, just to play around C++ a little bit.

This commit is contained in:
Tuan-Dat Tran
2018-03-27 02:04:19 +02:00
parent 0fadd81c68
commit 0212d21755
9 changed files with 126 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ import subprocess
import time
import os
def find_proc(proc_name):
this_proc = "pythonspotify-play.py"
proc_path = '/proc'
@@ -25,8 +26,9 @@ def spotify_running():
def main():
state = -1
home = os.path.expanduser("~")
while spotify_running():
with open('~/.scripts/playstate', 'r') as f:
with open(home + '/.scripts/playstate', 'r') as f:
try:
file_state = int(f.readline().strip('\n'))
except ValueError: