diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-09-02 17:36:35 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-09-02 17:36:35 +0800 |
| commit | 582c7ad0569e4bc52a86b38e9a51f07f41842e15 (patch) | |
| tree | 49bd07d6e6cfc85ee9d825ead224fbaed98160b4 /song-status | |
| parent | 4bafe49e51237da9f4f92c935912426d3661cc11 (diff) | |
init hyprland scripts
Diffstat (limited to 'song-status')
| -rwxr-xr-x | song-status | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/song-status b/song-status new file mode 100755 index 0000000..6550d0d --- /dev/null +++ b/song-status @@ -0,0 +1,17 @@ +#!/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}}') + fi +fi + +echo "$song_info" |
