summaryrefslogtreecommitdiff
path: root/spotify-widget
diff options
context:
space:
mode:
authorPavel Makhov <pavel.makhov@savoirfairelinux.com>2017-06-09 11:33:37 -0400
committerPavel Makhov <pavel.makhov@savoirfairelinux.com>2017-06-09 11:33:37 -0400
commit495994d7836a328b90a4cb7b51892cadc676a9cf (patch)
tree2a4892d43b3b5d0ab2746384b55bb2e15e408f33 /spotify-widget
parent5cce26ca95578dc989be23e5826befd655d574e7 (diff)
Adds more mouse actions to spotify widget
Diffstat (limited to 'spotify-widget')
-rw-r--r--spotify-widget/spotify.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/spotify-widget/spotify.lua b/spotify-widget/spotify.lua
index 6420ec6..f9ffa02 100644
--- a/spotify-widget/spotify.lua
+++ b/spotify-widget/spotify.lua
@@ -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) \ No newline at end of file