summaryrefslogtreecommitdiff
path: root/spotify-widget
diff options
context:
space:
mode:
Diffstat (limited to 'spotify-widget')
-rw-r--r--spotify-widget/README.md1
-rw-r--r--spotify-widget/spotify.lua5
2 files changed, 4 insertions, 2 deletions
diff --git a/spotify-widget/README.md b/spotify-widget/README.md
index e52e58f..2ae8dfc 100644
--- a/spotify-widget/README.md
+++ b/spotify-widget/README.md
@@ -33,6 +33,7 @@ It is possible to customize widget by providing a table with all or some of the
| `dim_opacity` | `0.2` | Widget's opacity when dimmed, `dim_when_paused` should be set to `true` |
| `max_length` | `15` | Maximum lentgh of artist and title names. Text will be ellipsized if longer. |
| `show_tooltip` | `true`| Show tooltip on hover with information about the playing song |
+| `timeout` | 1 | How often in seconds the widget refreshes |
### Example:
diff --git a/spotify-widget/spotify.lua b/spotify-widget/spotify.lua
index eea9b0b..abd19ef 100644
--- a/spotify-widget/spotify.lua
+++ b/spotify-widget/spotify.lua
@@ -35,6 +35,7 @@ local function worker(args)
local dim_opacity = args.dim_opacity or 0.2
local max_length = args.max_length or 15
local show_tooltip = args.show_tooltip == nil and false or args.show_tooltip
+ local timeout = args.timeout or 1
local cur_artist = ''
local cur_title = ''
@@ -106,8 +107,8 @@ local function worker(args)
end
end
- watch(GET_SPOTIFY_STATUS_CMD, 1, update_widget_icon, spotify_widget)
- watch(GET_CURRENT_SONG_CMD, 1, update_widget_text, spotify_widget)
+ watch(GET_SPOTIFY_STATUS_CMD, timeout, update_widget_icon, spotify_widget)
+ watch(GET_CURRENT_SONG_CMD, timeout, update_widget_text, spotify_widget)
--- Adds mouse controls to the widget:
-- - left click - play/pause