dotfiles/dot_config/waybar/modules/mpris/executable_get_status_paused.sh
Hydroxycarbamide 1ff2d77058 Add waybar
2024-05-14 19:47:03 +02:00

18 lines
418 B
Bash

#!/bin/bash
# manually go through players
read -d'\n' -ra PLAYERS <<<"$(playerctl -l 2>/dev/null)"
declare -a PAUSED
for player in "${PLAYERS[@]}"; do
[ "$player" = "playerctld" ] && continue;
p_status=$(playerctl -p "$player" status 2>/dev/null)
# if we have one playing, we'll use it and EXIT
if [ "$p_status" = "Playing" ]; then
echo "Playing"
exit 0;
fi
done
echo "Paused"