diff options
author | Pavel Makhov <pavel.makhov@savoirfairelinux.com> | 2017-01-23 11:01:16 -0500 |
---|---|---|
committer | Pavel Makhov <pavel.makhov@savoirfairelinux.com> | 2017-01-23 11:01:16 -0500 |
commit | 2d2684587d61b294ef1f0c7f1a1d251a0aaf884a (patch) | |
tree | 4f9400b3d7ce328355e43fc262819ea96132d8ac /spotify-widget-v4 | |
parent | 130813a6e2ed9e74526a67a44e5829b7b22eb8c2 (diff) |
Move v4 compatible widget in this repo
Diffstat (limited to 'spotify-widget-v4')
-rw-r--r-- | spotify-widget-v4/spotify.lua | 18 |
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") |