Files
dotfiles/hypr/bin/hyprlock/song-status
T
2026-08-12 15:58:54 +07:00

20 lines
748 B
Bash
Executable File

#!/bin/bash
player_name=$(playerctl metadata --format '{{playerName}}')
player_status=$(playerctl status)
if [[ "$player_status" == "Playing" ]]; then
if [[ "$player_name" == "spotify" ]]; then
song_info=$(playerctl metadata --format '{{title}} 󰓇 {{artist}}')
elif [[ "$player_name" == "firefox" ]]; then
song_info=$(playerctl metadata --format '{{title}} 󰈹 {{artist}}')
elif [[ "$player_name" == "mpd" ]]; then
song_info=$(playerctl metadata --format '{{title}} 󰎆 {{artist}}')
elif [[ "$player_name" == "chromium" ]]; then
song_info=$(playerctl metadata --format '{{title}} 󰊯 {{artist}}')
else
song_info=$(playerctl metadata --format '{{title}} ♬ {{artist}}')
fi
fi
echo "$song_info"