Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spotify widget not working #1

Closed
muammar opened this issue Aug 21, 2016 · 4 comments
Closed

Spotify widget not working #1

muammar opened this issue Aug 21, 2016 · 4 comments

Comments

@muammar
Copy link

muammar commented Aug 21, 2016

I have followed the instructions to install the widget, but it does not show anything. Below, you may see the diff of the changes that I did. Note that the only difference is that I used bottom_layout:add(spotify_widget) instead of right_layout:add(spotify_widget).

diff --git a/rc.lua b/rc.lua
index 0ab896d..e062ce1 100644
--- a/rc.lua
+++ b/rc.lua
@@ -12,6 +12,8 @@ local naughty = require("naughty")
 local menubar = require("menubar")
 -- Vicious
 local vicious = require("vicious")
+-- Spotify
+require("spotify")

 -- Load Debian menu entries
 require("debian.menu")
@@ -297,6 +299,7 @@ vicious.register(batwidget, vicious.widgets.bat, ' | Bat:<span color="#CC9933">
     bottom_layout:add(batwidget)
     bottom_layout:add(cpuwidget)
     bottom_layout:add(cpuwidget2)
+    bottom_layout:add(spotify_widget)

     -- Widgets that are aligned to the right
     local right_layout = wibox.layout.fixed.horizontal()
diff --git a/spotify.lua b/spotify.lua
new file mode 100644
index 0000000..828d3e6
--- /dev/null
+++ b/spotify.lua
@@ -0,0 +1,15 @@
+local wibox = require("wibox")
+local awful = require("awful")
+
+spotify_widget = wibox.widget.textbox()
+
+function updateSpotifyWidget(widget)
+  local current = awful.util.pread('sp current-oneline')
+  widget:set_text(current)
+end
+
+spotify_timer = timer ({timeout = 10})
+spotify_timer:connect_signal ("timeout", function() updateSpotifyWidget(spotify_widget) end) 
+spotify_timer:start()
+
+spotify_timer:emit_signal("timeout")
\ No newline at end of file

@muammar
Copy link
Author

muammar commented Aug 21, 2016

I found the problem, sorry for the noise. I needed sp script in my $PATH. I am closing this report.

@muammar muammar closed this as completed Aug 21, 2016
@streetturtle
Copy link
Owner

Another way to make it runnable is to put sp script in /usr/local/bin/. I think this way it would be better and you would keep your path clean.

@muammar
Copy link
Author

muammar commented Aug 22, 2016

@streetturtle I implemented as shown here: https://github.com/muammar/awesome/blob/master/spotify.lua#L7 Thanks for replying :).

@streetturtle
Copy link
Owner

Ok, this would work as well) Good luck!

streetturtle pushed a commit that referenced this issue Nov 30, 2020
streetturtle pushed a commit that referenced this issue Nov 24, 2023
Revert "calendar-widget: added option to show week numbers, possible …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants