summaryrefslogtreecommitdiff
path: root/spotify-widget-v4/spotify.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spotify-widget-v4/spotify.lua')
-rw-r--r--spotify-widget-v4/spotify.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/spotify-widget-v4/spotify.lua b/spotify-widget-v4/spotify.lua
new file mode 100644
index 0000000..83fdca9
--- /dev/null
+++ b/spotify-widget-v4/spotify.lua
@@ -0,0 +1,18 @@
+local wibox = require("wibox")
+local awful = require("awful")
+
+spotify_widget = wibox.widget.textbox()
+spotify_widget:set_font('Play 9')
+
+function updateSpotifyWidget(widget)
+ awful.spawn.easy_async([[bash -c 'sp current-oneline']],
+ function(stdout, stderr, reason, exit_code)
+ widget:set_text(stdout)
+ end)
+end
+
+spotify_timer = timer ({timeout = 10})
+spotify_timer:connect_signal ("timeout", function() updateSpotifyWidget(spotify_widget) end)
+spotify_timer:start()
+
+spotify_timer:emit_signal("timeout")