File tree 1 file changed +7
-3
lines changed 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 9
9
import lyricwikia
10
10
from subprocess import Popen , PIPE , check_output
11
11
12
+
12
13
def main ():
13
14
if len (sys .argv ) == 1 :
14
15
start_shell ()
15
16
return 0
16
-
17
+
17
18
global client
18
19
args = add_arguments ()
19
20
client = args .client
@@ -121,6 +122,7 @@ def show_status():
121
122
artist , title = get_song ()
122
123
print (f'{ artist } - { title } ' )
123
124
125
+
124
126
def show_status_short ():
125
127
artist , title = get_song ()
126
128
artist = artist [:15 ] + (artist [15 :] and '...' )
@@ -173,10 +175,12 @@ def show_album():
173
175
album = metadata ['xesam:album' ]
174
176
print (f'{ album } ' )
175
177
178
+
176
179
def show_art_url ():
177
180
metadata = get_spotify_property ("Metadata" )
178
181
print ("%s" % metadata ['mpris:artUrl' ])
179
182
183
+
180
184
def get_spotify_property (spotify_property ):
181
185
try :
182
186
session_bus = dbus .SessionBus ()
@@ -195,8 +199,8 @@ def get_spotify_property(spotify_property):
195
199
196
200
197
201
def perform_spotify_action (spotify_command ):
198
- Popen ('dbus-send --print-reply --dest=org.mpris.MediaPlayer2."%s" ' %
199
- client +
202
+ Popen ('dbus-send --print-reply --dest=org.mpris.MediaPlayer2."%s" ' %
203
+ client +
200
204
'/org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player."%s"' %
201
205
spotify_command , shell = True , stdout = PIPE )
202
206
You can’t perform that action at this time.
0 commit comments