Created
January 25, 2018 18:04
-
-
Save wallacesilva/07b7e13e59433fd1cbf832bd6849e7cf to your computer and use it in GitHub Desktop.
Shell Script to play/pause multiple media players
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
is_started() | |
{ | |
qtd=$(ps aux | grep $1 | wc -l) | |
if test "$qtd" = 1 | |
then | |
return 0 | |
else | |
$2 | |
fi | |
} | |
# Audacious | |
is_started audacious 'audacious --play-pause' | |
# Guayadeque | |
is_started guayadeque 'dbus-send --print-reply --type=method_call --dest=org.mpris.guayadeque /Player org.freedesktop.MediaPlayer.Pause' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment