Adds more mouse actions to spotify widget

This commit is contained in:
Pavel Makhov 2017-06-09 11:33:37 -04:00
parent 5cce26ca95
commit 495994d783
1 changed files with 9 additions and 1 deletions

View File

@ -21,6 +21,14 @@ watch(
spotify_widget
)
--[[
-- Adds mouse control to the widget:
-- - left click - play/pause
-- - scroll up - play next song
-- - scroll down - play previous song ]]
spotify_widget:connect_signal("button::press", function(_,_,_,button)
if (button == 1) then awful.spawn("sp play", false) end
if (button == 1) then awful.spawn("sp play", false)
elseif (button == 4) then awful.spawn("sp next", false)
elseif (button == 5) then awful.spawn("sp prev", false)
end
end)