dbus-send replaced by playerctl
This commit is contained in:
parent
ce05068e7c
commit
17a95daf45
|
@ -6,7 +6,7 @@ This project is a POC for managing a GNU/Linux desktop (with i3-wm). It implemen
|
|||
* `amixer`
|
||||
* `i3-msg`
|
||||
* `xdotool`
|
||||
* `dbus-send`
|
||||
* `playerctl`
|
||||
|
||||
It allows you to:
|
||||
|
||||
|
|
|
@ -71,15 +71,15 @@ $server->addMessageHandler('media', function (ConnectionInterface $from, array $
|
|||
$value = $data['value'] ?? null;
|
||||
|
||||
if ($value === 'playpause') {
|
||||
$cmd = 'PlayPause';
|
||||
$cmd = 'play-pause';
|
||||
} elseif ($value === 'next') {
|
||||
$cmd = 'Next';
|
||||
$cmd = 'next';
|
||||
} elseif ($value === 'prev') {
|
||||
$cmd = 'Previous';
|
||||
$cmd = 'previous';
|
||||
}
|
||||
|
||||
if (!empty($cmd)) {
|
||||
return shell_exec('dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.'.$cmd);
|
||||
return shell_exec('playerctl -p spotify '.$cmd);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue