
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
This is a script for amarok (you need amarok >= 1.2beta4). The script shows the cover of the album you are listening embedded in your desktop.
It also adds a lightning effect (this is configurable by the user)
NOTE: this is not a karamba script
You need pyqt and pykde to run it.
16 years ago
0.2:
-Now it hides the cover if amarok is stopped (Thanks to Pierre Habouzit).
-Hides itself if there is no cover defined.
-It shows an alert if you dont have PyQT or PyKDE installed (Thanks to Mark Kretschmann).
-The light filter is a little bit smoother now
-Real cd-box borders instead the old gray borders
0.1a:
-Get the coverImage using "dcop amarok player" instead of "dcop amarok playlist"
-Fixed the tab order in the config dialog
-Now it's correctly packaged
0.1:
-Initial release
16 years ago
0.2:
-Now it hides the cover if amarok is stopped (Thanks to Pierre Habouzit).
-Hides itself if there is no cover defined.
-It shows an alert if you dont have PyQT or PyKDE installed (Thanks to Mark Kretschmann).
-The light filter is a little bit smoother now
-Real cd-box borders instead the old gray borders
0.1a:
-Get the coverImage using "dcop amarok player" instead of "dcop amarok playlist"
-Fixed the tab order in the config dialog
-Now it's correctly packaged
0.1:
-Initial release
fchristophersen
11 years ago
You have to replace:
popen("dcop amarok player showOSD")
in line 305 of desktop.py with:
if e.button() == Qt.LeftButton:
popen("dcop amarok player prev")
if e.button() == Qt.MidButton:
popen("dcop amarok player playPause")
if e.button() == Qt.RightButton:
popen("dcop amarok player next")
note: the "if e.button()..." lines must have 8 blank spaces before them.
and the "popen("dcop..." lines must have 12 blank spaces before them.
after doing this you will be able to:
*left click: change to previous song
*middle click: pause or stop
*right click: skip to next song
by the way, i'm no programmer, i just read a small python tutorial a few weeks ago, but thanks to google i managed to get this done! i hope someone find this useful.
Report
tonybeccar
12 years ago
Report
Pappice
12 years ago
edit the file desktop.py, in /home/yourusername/.kde/share/apps/amarok/scripts/desktop, and go to the the line n.51
just change that line with
net = NETRootInfo(0xFFFFFF)
It will work!!!
At least, it works in my case... BTW I use GNOME.
IMPORTANT: no idea of what I've done!! Use this at your risk!
Report
fchristophersen
11 years ago
Report
hubfred
12 years ago
the script itself is working but where can I alter the settings of it? I cannot relocate the cover and it is too big. Using configure in the script manager has no effect at all, neither has edit in the context menu. This holds for any script installed. On the screenshot I can see that resizing is actually possible. Is this a bug that came up recently or am I completely on the wrong track?
Report
Sathors
12 years ago
I'm on gnome
Thank you
Report
gardar
14 years ago
I am currently running amarok on gnome... When I try this script, nothing happens....
Has anyone managed it to work?
Report
angstmachine
13 years ago
My issue: The configuration button in the script manager in Amarok does not load a configuration window. I assume this a gnome/kde compatabilty issue, but does anyone know how i can correct it?
All I want to do is re-position the cd cover on my desktop, however clicking and dragging doesn't work, and changing the script is way out of my league. Any ideas?
Report
JayCArrow
13 years ago
I have installed the latest versions of SIP, pyQT3 and PyKDE and the configuration window won't open on my KDE-Desktop 3 either.
The script protocol tells me about some errors. Maybe someone can take a look to the problem...
Yours,
Jay
Protocol (after calling configuration):
Traceback (most recent call last):
File "/home/jay/.kde/share/apps/amarok/scripts/desktop/desktop.py", line 260, in timerEvent
self.configure()
File "/home/jay/.kde/share/apps/amarok/scripts/desktop/desktop.py", line 299, in configure
self.dia = ConfigDialog(self)
File "/home/jay/.kde/share/apps/amarok/scripts/desktop/desktop.py", line 51, in __init__
net = NETRootInfo(qt_xdisplay())
TypeError: argument 1 of NETRootInfo() has an invalid type
[Desktop Script] configure
Report
netswipe
14 years ago
but a little feature I miss: The cover should be resizable ;)
regards, netti
Report
stuif
14 years ago
sh: kdialog: not found
Traceback (most recent call last):
file "/home/kasper/.kde/share/apps/amarok/scripts/desktop/desktop.py", line 37, in ?
from kdecore import*
importError: No module named kdecore
What should I do??
thanks a lot
Report
Typhon
14 years ago
Report
rynop
14 years ago
change any refrence of :
self.x = 50
self.y = 50
to your desired values. Save file and put it back in the bz2 package (overwite old one). Then install in amarok.
There is an error in the python script 'TypeError: argument 1 of NETRootInfo() has an invalid type' - i do not know python but i am working on fixing it right now...
Report
adny
13 years ago
"Fixed" it by commenting out:
# net = NETRootInfo(qt_xdisplay())
and then later on replacing the net.desktopGeometry(0).width and net.desktopGeometry(0).height with 4096 (i.e. a value larger than the size of the desktop).
Now the config dialog works just fine :)
Report
dennismdk
14 years ago
Report
gardenmouth
14 years ago
Report
rabauke
14 years ago
After that I started amarok and endless instances of amarokapp were created blocking KDE. killing amarok and the script solved the problem. Yet after starting amarok again it began again. So I removed the script manually from amarokrc and now it works as expected.
Not sure what could cause this.
Report
StewieG
14 years ago
I like the script, but it has a drawback. If gets the cover from the Amarok miniature cache instead of from the real cover file. If we have Amarok set up to use 100 pixels for the covers, they will look bad when the scaling is done.
You may change the paintImage function to get the real cover file, like this:
def paintImage (self,force):
artist = popen("dcop amarok player artist").read()[0:-1]
album = popen("dcop amarok player album").read()[0:-1]
coverImage = popen("dcop amarok collection query \"select path from images where artist='" + artist + "' and album='" + album + "'\"").read()[0:-1]
if coverImage == "":
self.hasCover = False
self.__hide()
elif (self.actual != coverImage or force):
self.hasCover = True
cover = self.__getCover(coverImage)
if self.filter:
cover = self.__filter(cover)
self.image.setPixmap(self.__box(QPixmap(cover)))
self.__show()
self.actual = coverImage
Report
iamFIREcracker
14 years ago
because of i'm not a script developer...i dont' know very well where to insert the correction for the "strange artist name patch"; u told before the quere...but were?
def paintImage (self,force):
artist = popen("dcop amarok player artist").read()[0:-1]
album = popen("dcop amarok player album").read()[0:-1]
artist = artist.replace('\'', '\'\'');
album = album.replace('\'', '\'\'');
coverImage = popen("dcop amarok collection query \"select path from images where artist='" + artist + "' and album='" + album + "'\"").read()[0:-1]
if coverImage == "":
self.hasCover = False
self.__hide()
elif (self.actual != coverImage or force):
self.hasCover = True
cover = self.__getCover(coverImage)
#if self.filter:
# cover = self.__filter(cover)
self.image.setPixmap(self.__box(QPixmap(cover)))
self.__show()
self.actual = coverImage
is it correct? if so..it doesnt work.. :(
M@
Report
mariahoney
14 years ago
Though, I did successfully get the original script to work by simply adding the following 3 lines of code beneath line:
song=popen("dcop amarok player coverImage").read()[0:-1]
and above line:
If OString(song).contains("nocover.png"):
------ This is the new code -----
large=song[:song.find('cache')]+"large/"+song[song.find('@')+1:]
if path.exists(large):
    song=large
---------------------------------
Theses three lines of code assume that you have not renamed your 'cache' and 'large' directories in ~/.kde3.5/share/apps/amarok/albumcovers
Report
StewieG
14 years ago
artist = artist.replace('\'', '\'\'');
album = album.replace('\'', '\'\'');
That goes before the SQL query.
Report
dta
14 years ago
Report
CaceK
14 years ago
Report
mahen
14 years ago
this plugin works well about 70% of the time... However, sometimes, with some albums pictures, I displays a black picture, or some "trash" (seemingly random picture). It must have something to do with the picture format, however, it just ought to be some standard png pictures... Any idea ?
Thanks a lot !
PS : apart from that, this is a great script :)
Report
bitcrazy
14 years ago
got the same problem here. I've opened some of the images in a hexeditor and saw, that they were corrupted. Seems that amarok sometimes adds a bit to the image.
You can fix it by either removing these files from your personal amarok dir or repair them with a hexeditor.
Greetings
m0nk
Report