From 582c7ad0569e4bc52a86b38e9a51f07f41842e15 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Mon, 2 Sep 2024 17:36:35 +0800 Subject: init hyprland scripts --- song-status | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 song-status (limited to 'song-status') 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" -- cgit v1.2.3