From 2d2684587d61b294ef1f0c7f1a1d251a0aaf884a Mon Sep 17 00:00:00 2001 From: Pavel Makhov Date: Mon, 23 Jan 2017 11:01:16 -0500 Subject: Move v4 compatible widget in this repo --- spotify-widget-v4/spotify.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 spotify-widget-v4/spotify.lua (limited to 'spotify-widget-v4/spotify.lua') 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") -- cgit v1.2.3