#!/bin/bash playerstatus=$(playerctl status) echo "$playerstatus" if [[ "$playerstatus" = "Playing" ]] then playerctl -a stop exit 0 fi if [[ "$playerstatus" = "Stopped" ]] then playerctl play exit 0 fi