This repository has been archived on 2023-04-23. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Korbs 4d9440d01b
Update README.md
2021-04-03 03:02:00 -04:00
src Create install-dock-controls.sh 2021-03-30 21:29:21 -04:00
README.md Update README.md 2021-04-03 03:02:00 -04:00

spotify-media-controls-eos

It appears sometimes, that you can't control Spotify with your media controls on elementary OS, which gets annoying sometimes. So I plan to write a script that updates your keyboard shortcuts, where you media controls can control Spotify no matter what. Although your media controls will be locked in with Spotify only, unless you remove the custom keyboard shortcuts.

Until then, here are the controls:

Pause/Play

dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause

Next Track

dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next

Previous Track

dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous

Add Controls to Dock

You can add controls when you right click on Spotify from your dock. Install it with this:

sudo bash <(wget -qO- https://raw.githubusercontent.com/KorbsStudio/spotify-media-controls-eos/main/src/script/install-dock-controls.sh)

Above command not working? Use this:

clear
echo "Creating a backup..."
sudo mkdir /usr/share/korbs-studio/
sudo cp /usr/share/applications/spotify.desktop /usr/share/korbs-studio/
echo "Installing..."
cd /usr/share/applications/
sudo rm spotify.desktop
sudo wget "https://raw.githubusercontent.com/KorbsStudio/spotify-media-controls-eos/main/src/desktop/spotify.desktop"
echo "Done."
sleep 1;
echo "Did an issue occur? Report it to https://github.com/KorbsStudio/spotify-media-controls-eos/issues"
sleep 1;

What this script does?

  • Creates a new folder to back up spotify.desktop file to /usr/share/korbs-studio/
  • Copies spotify.desktop to /usr/share/korbs-studio
  • Download and install new spotify.desktop file to /usr/share/applications/

Extra

Assumed keybinds: Previous XF86AudioPrev Next XF86AudioNext