Configure spotifyd waybar
This commit is contained in:
parent
5a00da9239
commit
c2e851fbcf
5 changed files with 80 additions and 21 deletions
|
|
@ -311,6 +311,37 @@
|
|||
source = ../configs/waybar/air_control.py;
|
||||
executable = true;
|
||||
};
|
||||
".config/waybar/spotify_status.sh" = {
|
||||
executable = true;
|
||||
text = ''
|
||||
#!/usr/bin/env sh
|
||||
|
||||
player="$(playerctl -l 2>/dev/null | rg '^spotifyd\.instance' -m1 || true)"
|
||||
|
||||
if [ -z "$player" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
status="$(playerctl -p "$player" status 2>/dev/null || true)"
|
||||
text="$(playerctl -p "$player" metadata --format '{{artist}} - {{title}}' 2>/dev/null || true)"
|
||||
|
||||
if [ -z "$text" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "$status" in
|
||||
Playing)
|
||||
printf ' %s\n' "$text"
|
||||
;;
|
||||
Paused)
|
||||
printf ' %s\n' "$text"
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
'';
|
||||
};
|
||||
".config/waybar/launch.sh" = {
|
||||
source = ../configs/waybar/launch.sh;
|
||||
executable = true;
|
||||
|
|
@ -371,6 +402,14 @@
|
|||
fi
|
||||
'';
|
||||
|
||||
services.spotifyd = {
|
||||
enable = true;
|
||||
settings.global = {
|
||||
backend = "pulseaudio";
|
||||
use_mpris = true;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.openclaw-gateway = {
|
||||
Service.EnvironmentFile =
|
||||
"${config.home.homeDirectory}/.config/openclaw/gateway.env";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue