summaryrefslogtreecommitdiff
path: root/spotify-widget
diff options
context:
space:
mode:
authorChristopher Crockett <git@chray.cc>2022-07-13 14:03:53 -0400
committerChristopher Crockett <git@chray.cc>2022-07-13 14:03:53 -0400
commitcd162c9a1734e448514f16e0037d949bfafe3c84 (patch)
treece858e49152e7b508a3c67a5d36a07198cb150ed /spotify-widget
parent83914c91c86eee4d70120a2849e752f7762908d7 (diff)
Added sp_bin option to spotify-widget
Allows specifying a custom location for the sp binary via widget config. This is intended for users who don't want to add the sp binary to their system PATH.
Diffstat (limited to 'spotify-widget')
-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 = ''