-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatusBar.py
32 lines (28 loc) · 1.06 KB
/
statusBar.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/local/bin/python3
#coding: utf-8
import rumps, selectPlayer
class statusBar(rumps.App):
def __init__(self):
super(statusBar, self).__init__("Now Playing")
self.menu = ["Inform player"]
rumps.debug_mode(True)
self.player = ""
self.tuple = ""
@rumps.clicked("Inform player")
def informPlayer(self, _):
playerName = rumps.Window(title='Inform player', message='Write the name of your desired player and the index to the opened audio file. Note: the player name you type need to be equal to the process name')
window = playerName.run()
if window.clicked:
self.player = window.text.split(",")[0]
self.tuple = int(window.text.split(",")[1])
return
@rumps.timer(1)
def getMusic(self, _ ):
if self.player == '':
return
else:
objPlayer = selectPlayer.Player(self.player, self.tuple)
song = objPlayer.getSong()
self.title = song
if __name__ == '__main__':
statusBar().run()