gnomeのお気に入りのコンテキストメニューからSpotifyをコントロール(次、前など)

gnomeのお気に入りのコンテキストメニューからSpotifyをコントロール(次、前など)

Spotifyランチャーを追加しましたGnome シェル ダッシュこれでお気に入りのアプリになりました。コンテキスト メニュー
に次 / 前 / 再生一時停止 / 停止コマンドを追加するにはどうすればよいですか?Spotify


まだ不明瞭な点がある人のために、ここでの目標は次のようになります。

ここに画像の説明を入力してください

答え1

答えを探し回るのにしばらく時間を費やした後、ようやくうまく動作するようになりました。

spotify.desktop以下のファイルを編集してください/usr/share/applications

ここに画像の説明を入力してください

[Desktop Entry]
Name=Spotify
GenericName=Music Player
Comment=Spotify streaming music client
Icon=spotify-client
Exec=spotify %U
TryExec=spotify
Terminal=false
Type=Application
Categories=Audio;Music;Player;AudioVideo;
MimeType=x-scheme-handler/spotify;

Actions=PlayPause;Next;Previous;Stop

[Desktop Action PlayPause]
Name=Play-Pause
Exec=dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause

[Desktop Action Next]
Name=Next
Exec=dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next

[Desktop Action Previous]
Name=Previous
Exec=dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous

[Desktop Action Stop]
Name=Stop
Exec=dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop

関連情報