mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-24 18:58:33 +02:00
spotify: use playerctl instead of dbus commands
The module is still spotify-specific, but a bit less
This commit is contained in:
parent
194da94c77
commit
bff16a840a
2 changed files with 10 additions and 11 deletions
|
@ -6,6 +6,8 @@
|
|||
-- To get the complete interface:
|
||||
-- mdbus2 org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2
|
||||
|
||||
-- Updated to use playerctl instead.
|
||||
|
||||
local awful = require("awful")
|
||||
local dbg = dbg
|
||||
local pairs = pairs
|
||||
|
@ -30,11 +32,7 @@ end
|
|||
|
||||
-- Send a command to spotify
|
||||
local function cmd(command)
|
||||
local client = spotify()
|
||||
if client then
|
||||
awful.util.spawn("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify " ..
|
||||
"/org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player." .. command, false)
|
||||
end
|
||||
awful.util.spawn("playerctl " .. command, false)
|
||||
end
|
||||
|
||||
-- Show spotify
|
||||
|
@ -52,27 +50,27 @@ function show()
|
|||
end
|
||||
|
||||
function playpause()
|
||||
cmd("PlayPause")
|
||||
cmd("play-pause")
|
||||
end
|
||||
|
||||
function play()
|
||||
cmd("Play")
|
||||
cmd("play")
|
||||
end
|
||||
|
||||
function pause()
|
||||
cmd("Pause")
|
||||
cmd("pause")
|
||||
end
|
||||
|
||||
function stop()
|
||||
cmd("Stop")
|
||||
cmd("stop")
|
||||
end
|
||||
|
||||
function next()
|
||||
cmd("Next")
|
||||
cmd("next")
|
||||
end
|
||||
|
||||
function previous()
|
||||
cmd("Previous")
|
||||
cmd("previous")
|
||||
end
|
||||
|
||||
function mixer()
|
||||
|
|
|
@ -18,3 +18,4 @@ alsa-utils
|
|||
pavucontrol
|
||||
pulseaudio
|
||||
numlockx
|
||||
playerctl
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue