summaryrefslogtreecommitdiff
path: root/spotify-widget/spotify.lua
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@users.noreply.github.com>2023-01-17 22:16:27 -0500
committerGitHub <noreply@github.com>2023-01-17 22:16:27 -0500
commit72d53d1e871b30326f070127796e9672559e4046 (patch)
tree9ae9a051f4b5be93a3ab9292e10fd1871aba6b75 /spotify-widget/spotify.lua
parent3bb3d56c26ac3500aab33381af0cccebf6aaa05c (diff)
parentd1195d0e262969b34b7fdcc81a288023cf8368a6 (diff)
Merge pull request #382 from SkylarGill/spotifywidget-mouseevent-spbin
Spotify Widget - Use sp_bin setting when registering mouse events
Diffstat (limited to 'spotify-widget/spotify.lua')
-rw-r--r--spotify-widget/spotify.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/spotify-widget/spotify.lua b/spotify-widget/spotify.lua
index 2c30685..0ea7cfd 100644
--- a/spotify-widget/spotify.lua
+++ b/spotify-widget/spotify.lua
@@ -40,6 +40,9 @@ local function worker(user_args)
local GET_SPOTIFY_STATUS_CMD = sp_bin .. ' status'
local GET_CURRENT_SONG_CMD = sp_bin .. ' current'
+ local PLAY_PAUSE_CMD = sp_bin .. ' play'
+ local NEXT_SONG_CMD = sp_bin .. ' next'
+ local PREVIOUS_SONG_CMD = sp_bin .. ' prev'
local cur_artist = ''
local cur_title = ''
@@ -135,11 +138,11 @@ local function worker(user_args)
-- - scroll down - play previous song
spotify_widget:connect_signal("button::press", function(_, _, _, button)
if (button == 1) then
- awful.spawn("sp play", false) -- left click
+ awful.spawn(PLAY_PAUSE_CMD, false) -- left click
elseif (button == 4) then
- awful.spawn("sp next", false) -- scroll up
+ awful.spawn(NEXT_SONG_CMD, false) -- scroll up
elseif (button == 5) then
- awful.spawn("sp prev", false) -- scroll down
+ awful.spawn(PREVIOUS_SONG_CMD, false) -- scroll down
end
awful.spawn.easy_async(GET_SPOTIFY_STATUS_CMD, function(stdout, stderr, exitreason, exitcode)
update_widget_icon(spotify_widget, stdout, stderr, exitreason, exitcode)