summaryrefslogtreecommitdiff
path: root/spotify-widget/spotify.lua
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@users.noreply.github.com>2022-07-16 20:50:10 -0400
committerGitHub <noreply@github.com>2022-07-16 20:50:10 -0400
commit1245ea43cde656228d9a5c0744695adecc78b077 (patch)
treedeb8de85ffe57b96faec89e794317937cb7dc9b4 /spotify-widget/spotify.lua
parent7467480c5873c4a6536d685e46b7ed763fc9b49f (diff)
parent5d50fe7fab8dcfcf649bafdcd4197219b76bc0b9 (diff)
Merge pull request #364 from chaorace/spotify-local-sp
Allow specifying a custom location for the sp binary used by spotify-widget
Diffstat (limited to 'spotify-widget/spotify.lua')
-rw-r--r--spotify-widget/spotify.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/spotify-widget/spotify.lua b/spotify-widget/spotify.lua
index f8df1ea..85ea6b4 100644
--- a/spotify-widget/spotify.lua
+++ b/spotify-widget/spotify.lua
@@ -12,9 +12,6 @@ local awful = require("awful")
local wibox = require("wibox")
local watch = require("awful.widget.watch")
-local GET_SPOTIFY_STATUS_CMD = 'sp status'
-local GET_CURRENT_SONG_CMD = 'sp current'
-
local function ellipsize(text, length)
-- utf8 only available in Lua 5.3+
if utf8 == nil then
@@ -39,6 +36,10 @@ local function worker(user_args)
local max_length = args.max_length or 15
local show_tooltip = args.show_tooltip == nil and true or args.show_tooltip
local timeout = args.timeout or 1
+ local sp_bin = args.sp_bin or 'sp'
+
+ local GET_SPOTIFY_STATUS_CMD = sp_bin .. ' status'
+ local GET_CURRENT_SONG_CMD = sp_bin .. ' current'
local cur_artist = ''
local cur_title = ''