From cd162c9a1734e448514f16e0037d949bfafe3c84 Mon Sep 17 00:00:00 2001 From: Christopher Crockett Date: Wed, 13 Jul 2022 14:03:53 -0400 Subject: 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. --- spotify-widget/spotify.lua | 7 ++++--- 1 file 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 = '' -- cgit v1.2.3