@@ -129,7 +129,8 @@ def write_output(text=None, class_=None, tooltip=""):
129129 global config
130130 # Default values if not explicitly set
131131 if not text :
132- text = "" + (" " * (config ["widget_length" ] - 1 ))
132+ # text = "r" + (" " * (config["widget_length"] - 1))
133+ text = (" " * (config ["widget_length" ]))
133134 if not class_ :
134135 class_ = gen_class (0.0 )
135136 if not tooltip :
@@ -167,7 +168,7 @@ def gen_widget_text(player):
167168 global last_rot , last_rot_time , is_text_rotating
168169
169170 metadata = player .props .metadata
170- # artist = player.get_artist()
171+ artist = player .get_artist ()
171172 # artist = metadata["xesam:artist"][0]
172173 title = player .get_title () or ""
173174 # title = metadata["xesam:title"]
@@ -181,10 +182,10 @@ def gen_widget_text(player):
181182 ):
182183 song_info = "AD PLAYING"
183184 else :
184- song_info = title .strip ()
185+ song_info = f" { title .strip ()} - { artist . strip () } "
185186
186187 if not is_text_rotating :
187- text = left_text ( icon + song_info )
188+ text = icon + song_info
188189 else :
189190 song_info += " " + config ["sepchar" ] + " "
190191 elapsed = (time .time () - last_rot_time ) * 1000
@@ -362,15 +363,6 @@ def get_new_lyrics(artist, title):
362363 lyrics ["secs" ].append (lyrics ["secs" ][- 1 ] + 1 )
363364
364365
365- def left_text (s ):
366- le = len (s )
367- if le > config ["widget_length" ]:
368- return s
369- missing = config ["widget_length" ] - le
370- s = s + " " * (missing )
371- return s
372-
373-
374366def center_text (s , ml = None ):
375367 if not ml :
376368 ml = max ([len (x ) for x in s ])
0 commit comments