finally fixed a ton of shit about waybar and added music and weather widget

This commit is contained in:
opal
2024-06-03 21:27:06 -07:00
parent 108349b074
commit f5cbaf2c30
5 changed files with 119 additions and 77 deletions
+22
View File
@@ -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}")