From 495994d7836a328b90a4cb7b51892cadc676a9cf Mon Sep 17 00:00:00 2001 From: Pavel Makhov Date: Fri, 9 Jun 2017 11:33:37 -0400 Subject: Adds more mouse actions to spotify widget --- spotify-widget/spotify.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'spotify-widget') 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 -- cgit v1.2.3