From cda3a6448fa1790176db3854d5dbf51d67646b86 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Mon, 31 Aug 2015 20:28:15 +0200 Subject: [PATCH] spotify: switch back to MPRIS2 DBUS interface One less daemon to run. --- lib/spotify.lua | 8 +++----- rc/start.lua | 4 +--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/spotify.lua b/lib/spotify.lua index 3e0182f..50823a9 100644 --- a/lib/spotify.lua +++ b/lib/spotify.lua @@ -32,10 +32,8 @@ end local function cmd(command) local client = spotify() if client then - os.execute("dbus-send --print-reply --reply-timeout=1000 --dest=org.gnome.SettingsDaemon " - .. "/org/gnome/SettingsDaemon/MediaKeys " - .. "org.gnome.SettingsDaemon.MediaKeys.PressMediaKey " - .. "string:" .. command) + os.execute("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify " .. + "/org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player." .. command) end end @@ -54,7 +52,7 @@ function show() end function playpause() - cmd("Play") + cmd("PlayPause") end function play() diff --git a/rc/start.lua b/rc/start.lua index ff89a3c..70a3f39 100644 --- a/rc/start.lua +++ b/rc/start.lua @@ -16,9 +16,7 @@ local execute = { "text/html", -- Default MIME types "xdg-mime default evince.desktop application/pdf", - "xdg-mime default gpicview.desktop image/png image/x-apple-ios-png image/jpeg image/jpg image/gif", - -- dbus-mediakeys - "dbus-mediakeys &" + "xdg-mime default gpicview.desktop image/png image/x-apple-ios-png image/jpeg image/jpg image/gif" } os.execute(table.concat(execute, ";"))