diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-03 10:39:12 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-03 10:39:12 +0900 |
| commit | d89e317c89420c3b71e7905581a6eefcbe69eb87 (patch) | |
| tree | 71710080ac3b17a088522f6c0e87ae7af2d3fa8a /ar | |
| parent | 976a2d00fba046c47aa841f32bb19270214aedcc (diff) | |
Diffstat (limited to 'ar')
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-music | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ar/.local/bin/statusbar/sb-music b/ar/.local/bin/statusbar/sb-music index 2c37cdd..de29ef8 100755 --- a/ar/.local/bin/statusbar/sb-music +++ b/ar/.local/bin/statusbar/sb-music @@ -132,8 +132,17 @@ fi case $BLOCK_BUTTON in 1) setsid -f "$TERMINAL" -e ncmpcpp ;; # left click, opens ncmpcpp -2) mpc toggle ;; # middle click, pause/unpause -3) # right click +2) # middle click, pause/unpause + mpc toggle 2>/dev/null + while IFS= read -r player; do + if [[ "$player" == chromium.instance* ]]; then + pid="${player#chromium.instance}" + proc_name=$(cat /proc/"$pid"/cmdline 2>/dev/null | tr '\0' '\n' | grep -i "youtube-music\|pear-desktop" | head -1) + [ -n "$proc_name" ] && playerctl --player="$player" play-pause 2>/dev/null + fi + done < <(playerctl -l 2>/dev/null) + ;; +3) # right click { [ -n "$(mpc current)" ] && [ -n "$(mpc queued)" ]; } && notify-send "🎵 $(mpc current)" "⏭ $(mpc queued)" notify-send "🎵 Music module" "\- Shows mpd song playing and status - 🎵 if playing |
