-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMusic.py
More file actions
26 lines (22 loc) · 737 Bytes
/
Music.py
File metadata and controls
26 lines (22 loc) · 737 Bytes
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
import os
def run_query(query, platform):
if platform == 'windows':
# requires musicbee
if 'pause' in query:
os.system('start musicbee /PlayPause')
elif 'next' in query:
os.system('start musicbee /Next')
elif 'previous' in query or 'prev' in query:
os.system('start musicbee /Previous')
elif 'play' in query:
os.system('start musicbee /PlayResume')
if platform == 'linux':
# requires cmus and cmus-remote to be installed
if 'pause' in query:
os.system('cmus-remote --pause')
elif 'next' in query:
os.system('cmus-remote --next')
elif 'previous' in query or 'prev' in query:
os.system('cmus-remote --prev')
elif 'play' in query:
os.system('cmus-remote --play')