finally fixed a ton of shit about waybar and added music and weather widget
This commit is contained in:
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess
|
||||
|
||||
|
||||
def get_playerctl_metadata(field):
|
||||
result = subprocess.run(
|
||||
["playerctl", "--player=strawberry", "metadata", field],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
text=True,
|
||||
)
|
||||
if result.returncode == 0:
|
||||
return result.stdout.strip()
|
||||
return None
|
||||
|
||||
|
||||
artist = get_playerctl_metadata("artist")
|
||||
title = get_playerctl_metadata("title")
|
||||
|
||||
if artist and title:
|
||||
print(f" {artist} - {title}")
|
||||
Reference in New Issue
Block a user