#!/usr/bin/env bash # check if any player has status "Playing" playerctl -a status | pkgs.ripgrep Playing -q # only suspend if nothing is playing if [ $? == 1 ]; then bash -c $1 fi