Current Song

Plasma 4 Widgets

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on git.opendesktop.org

4
Score 77%
Description:

This is intended as a more streamlined analogue of the standard "Now Playing" plasmoid. Instead of a collection of buttons and sliders, only the title and album art of the currently-playing track are shown, and can be clicked to advance to the next track (or resume playback, as appropriate). Obviously, this won't be much use to those that don't use album art, but in my case, I find it to be a more concise way of accessing the playback functionality I most commonly use.

Requires Plasma 4.5. Currently there is no support for placing the plasmoid inside a panel.

The default image shown when no album art is available is thanks to Amarok.

Last changelog:

8 years ago

0.2.3:
- Improved corner rounding of album art.

0.2.2:
- Fixed bug in configuration loading.

0.2.1:
- Added configuration interface for main background.
- Fixed restoration of config settings.

0.2:
- Added configuration interface for text background.
- Better handling of odd Amarok behaviour
- Fixed action-icon glitch when all sources are removed.

0.1:
- Initial release.

iten

8 years ago

There is error that are displayed each seconds in .xsession-errors:

Traceback (most recent call last):
File "/home/toto/.kde4/share/apps/plasma/plasmoids/current-song/contents/code/main.py", line 180, in dataUpdated
songID = self.songIDStr(data)
File "/home/toto/.kde4/share/apps/plasma/plasmoids/current-song/contents/code/main.py", line 310, in songIDStr
return "%s [%i] -- %s, #%i" % (title, length, album, track)
TypeError: %d format: a number is required, not QVariant

Report

Maarty

8 years ago

keystonerose

Nice job! could you increase maximum

size of the plasmoid in future releases?

It looks pretty small on my 27" monitor.

Report

ingvarg

8 years ago

good work, but I find something strange - when I choose to disable the background of plasmoid and then reboot - the background returns

what can I do to fix it?

Report

C

keystonerose

8 years ago

Sorry about that; stupid mistake on my part. It should be fixed now.

Report

ingvarg

8 years ago

hmm

it isn't (:

nvm, all is great, i'm ur fan (;

Report

ingvarg

8 years ago

oh, sry about that, a bit drunked

used old version, I'll test the new version

Report

ingvarg

8 years ago

yeah, everything works perfect

but plasma tells me it is version 0.2.1 (:

Report

vexxed

8 years ago

The plasmoid works much better now. Excellent job. The only thing that I wouldn't mind is the ability to pause the current song.

And for anyone who needs to use my method (described above) to make it work on Plasma 4.4 or lower, the line that needs to be commented out is at 191.

For future reference (and so I don't have to repost this with every update), just search the file for

self.iconWidget.setMaximumIconSize(QSizeF(self.MAX_ICON_SIZE, self.MAX_ICON_SIZE))

and comment it out by putting a # infront of it. Save, install, voila.

Report

C

keystonerose

8 years ago

Mm, I was considering that. The trick would be to somehow visually distinguish the primary action performed by clicking on the album art from any secondary actions available as overlay icons. Perhaps the icon for the primary action should appear in the centre of the image rather than in the corner? It'd be kinda tricky to implement, though, but should work.

Report

vexxed

8 years ago

Well, the way you have it now has two spaces, right? You've got the Album Art and then the Song Title. Click the art and the song changes. Why not make it pause when you click the song name?

Report

C

keystonerose

8 years ago

Even though they appear separate, they're parts of a singular IconWidget entity. Plus, it's difficult to draw a semantic difference between activating text representing a song, and an image representing a song.

Report

vexxed

8 years ago

What about a line between the text and the art? So, when a person clicks, the program checks to see where the click was and runs the appropriate function. Of course, the line would have to be relative, but that shouldn't be too difficult.

def onClick
If mouse.y is less-than middleLine
change song;
if mouse.y is equal-to or greater-than middleLine
pause song;

(Forgive me if I'm way off the mark here.)

Report

Githzerai

8 years ago

Thanks for this one, very simple, but also very efficient.

However, would it be possible to add some sort of font config dialog (even the most simplest one)?

Depending on used plasma theme and wallpaper, it might become difficullt to read song titles, like here:

http://tinyurl.com/356avj4

Cheers.

Report

C

keystonerose

8 years ago

Good point. Unfortunately the widget that I am using does not support changing the font, but I have added a configuration interface for changing the text background, which may help you.

Report

Githzerai

8 years ago

Thanks, this is much, much better.

I think that that this would be more than enough for majority of plasma theme/background combinations, or at least for those I've tried.

Great job,
Cheers.

Report

vexxed

8 years ago

I got it to install fine, but whenever I drag the widget to the desktop it just says

This object could not be created for the following reason: Script initialisation failed.

Any solutions?

Mandriva 2010.1
KDE 4.4.3

Report

C

keystonerose

8 years ago

Huh, that's not so good... Unfortunately, I can't reproduce here, but I recall having had a similar problem with some other plasmoids that came right upon restarting Plasma.

I haven't tested the plasmoid with Plasma 4.4, either, so perhaps that's it? I'm not sure what different that would make, though.

Report

vexxed

8 years ago

Did some poking around and found a solution to this problem.

Plasma <4.5 has a problem with line 146 in main.py. So, you have to extract the plasmoid, go in to the folder /129891-current-song-0.1/contents/code and then open main.py and comment out line 146 by putting a # infront of it. It should look like this:


#self.iconWidget.setMaximumIconSize(QSizeF(self.MAX_ICON_SIZE, self.MAX_ICON_SIZE))

Save the file, then cd back until you're outside of the plasmoid folder. Finally, just do

plasmapkg -i /129891-current-song-0.1/

and it should install. The only bug I've encountered so far is that most of the time the album art doesn't show up.

Report

vexxed

8 years ago

Correction:

Album art AND song title don't show up.

Report

C

keystonerose

8 years ago

I've been able to reproduce some strange behaviour with Amarok -- it will sometimes report that it has stopped playing when it is just changing tracks -- which for me occasionally caused the plasmoid to become blank. I made some changes to the way the play-state is tracked, and haven't observed the problem since, so hopefully this may address your issue.

Report

Lole

8 years ago

I tried to install this plasmaoid on kde 4.5.1 from shell with "plasmapkg -i 129891-current-song-0.1.plasmoid" but then I see this error:

"KConfigIni: In file /tmp/kde-lorenzo/plasmapkgScHPSm/metadata.desktop, line 1: " Invalid entry (missing '=')
"KConfigIni: In file /tmp/kde-lorenzo/plasmapkgScHPSm/metadata.desktop, line 2: " Invalid entry (missing '=')
"KConfigIni: In file /tmp/kde-lorenzo/plasmapkgScHPSm/metadata.desktop, line 3: " Invalid entry (missing ']')
"KConfigIni: In file /tmp/kde-lorenzo/plasmapkgScHPSm/metadata.desktop, line 4: " Invalid entry (missing '=')
"KConfigIni: In file /tmp/kde-lorenzo/plasmapkgScHPSm/metadata.desktop, line 7: " Invalid entry (missing '=')
"KConfigIni: In file /tmp/kde-lorenzo/plasmapkg9vjd5g/metadata.desktop, line 1: " Invalid entry (missing '=')
"KConfigIni: In file /tmp/kde-lorenzo/plasmapkg9vjd5g/metadata.desktop, line 2: " Invalid entry (missing '=')
"KConfigIni: In file /tmp/kde-lorenzo/plasmapkg9vjd5g/metadata.desktop, line 3: " Invalid entry (missing ']')
"KConfigIni: In file /tmp/kde-lorenzo/plasmapkg9vjd5g/metadata.desktop, line 4: " Invalid entry (missing '=')
"KConfigIni: In file /tmp/kde-lorenzo/plasmapkg9vjd5g/metadata.desktop, line 7: " Invalid entry (missing '=')
plasmapkg(1961)/libplasma Plasma::Package::installPackage: Package plugin name not specified
Installazione di /home/lorenzo/129891-current-song-0.1.plasmoid non riuscita.

Report

bitcrazy

8 years ago

Same here.
openSUSE 11.3
KDE 4.5.1
Qt 4.6.3

Report

C

keystonerose

8 years ago

As far as I know, this is a packaging problem with Plasma 4.5:

https://bugs.kde.org/show_bug.cgi?id=249980
https://bbs.archlinux.org/viewtopic.php?pid=820108

As a workaround, you can extract the contents of the .plasmoid file (which is actually a ZIP archive), then run plasmapkg -i . in the extracted directory.

Report

Lole

8 years ago

Thank you! Now it works! You should add to the description this way to install it (plasmapkg -i .)

Report

8 years ago

0.2.3:
- Improved corner rounding of album art.

0.2.2:
- Fixed bug in configuration loading.

0.2.1:
- Added configuration interface for main background.
- Fixed restoration of config settings.

0.2:
- Added configuration interface for text background.
- Better handling of odd Amarok behaviour
- Fixed action-icon glitch when all sources are removed.

0.1:
- Initial release.

product-maker Sload May 06 2012

product-maker BlackDal Jan 09 2012

product-maker pars1938 Dec 23 2011

product-maker e1nste1n Sep 16 2011

product-maker DenisSeidel Jul 23 2011

product-maker lonerocker Jun 01 2011

product-maker Roadrunnerbs May 31 2011

product-maker FraMari May 30 2011

product-maker luizrmc Apr 29 2011

product-maker darkmas Apr 11 2011

product-maker philipvdm Mar 23 2011

product-maker jeast Mar 05 2011

product-maker robten Feb 07 2011

product-maker fabiomessina Feb 06 2011

product-maker matejv Feb 06 2011

product-maker alltiptop Dec 20 2010

product-maker jamboarder Nov 14 2010

product-maker rangerGR Nov 07 2010

product-maker Maarty Oct 11 2010

product-maker deabru Oct 07 2010

product-maker Saleel Sep 22 2010

product-maker ingvarg Sep 21 2010

product-maker 8 34

File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
Details
license
version
0.2.3
updated Oct 09 2010
added Sep 06 2010
downloads today
0
page views today 2