
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
AmarokScreenSaver
Displays information about the currently playing song as a screensaver
I often use my computer to play music when I am having visitors or when I am just not in front of the monitor. I wanted some way to still be able to see what song was playing. As my TV is connected to the computer I decided to make a screensaver that would do just this. (you don't need to even own a TV to use this script, but my TV is in my living room and my computer is not...)
This script creates an image based on the currently playing song in Amarok, then changes your screensaver to KSlideshow and tells it to display this particular image. It restores your original screensaver settings when you stop the script or exit Amarok.
The script has some basic settings configurable via a dialog:
Party / safe - mode:
The script can be configured to lock the screensaver, you will need your password to return to the desktop. This is great if you are having a party and don't want everybody to use the computer for surfing or changing track every other minute.
DPMS:
I use display power management to turn off my monitor after a given period of time. This did not work well with my idea. Therefore I created an option to turn off DPMS, and turning it back on when the script is exited or Amarok is shut down.
Rotate image placement:
To prevent damage to the screen the images can be placed at random position, or fixed.
Screen width:
Enter the width of your screen in pixels
Screen height:
Enter the height of your screen in pixels
Cover factor:
Size of the cover relative to the size of your screen (in percent).
Requirements:
- Amarok (duh...)
- KDE, not sure if it will work with anything else, at least KScreensaver and KSlideshow is needed
- ImageMagick
- PyQt (Only to configure the script, this can also be done manually by editing a textfile)
12 years ago
Version 0.5.0:
- Works with KDE4 (>= 4.0.5)
- Does not start the screensaver if computer is in use (KDE4 only)
Version 0.4.1:
- Restores your original screensaver settings when you stop or pause playback (as well as when you exit Amarok).
Version 0.4.0:
- More config options
- Added reflection
- xwininfo and bc no longer needed
- Settings not lost when you reconfigure
- Tracknumber not shown when there is none
Version 0.3.1:
- Fixed bug where screensaver did not find any images after being active for a while
Version 0.3:
- Takes care of Kopete status. No longer changes status on each trackchange.
- The screensaver stays active on trackchange. Amarok is no longer shown
- Changed the name from KoverSS to AmarokScreenSaver
Version 0.2.1:
- Regression fix, images have better quality again!
Version 0.2:
- Better configuredialog
- More screen-friendly. Creates more than one image with the text and cover art in different places.
- Various fixes and speed improvements
Version 0.1.2:
- Works even if user has no screensaver set (Thanks to David Hugas Germí )
Version 0.1.1:
- Cover image now has better quality
Version 0.1:
Here we go!
12 years ago
Version 0.5.0:
- Works with KDE4 (>= 4.0.5)
- Does not start the screensaver if computer is in use (KDE4 only)
Version 0.4.1:
- Restores your original screensaver settings when you stop or pause playback (as well as when you exit Amarok).
Version 0.4.0:
- More config options
- Added reflection
- xwininfo and bc no longer needed
- Settings not lost when you reconfigure
- Tracknumber not shown when there is none
Version 0.3.1:
- Fixed bug where screensaver did not find any images after being active for a while
Version 0.3:
- Takes care of Kopete status. No longer changes status on each trackchange.
- The screensaver stays active on trackchange. Amarok is no longer shown
- Changed the name from KoverSS to AmarokScreenSaver
Version 0.2.1:
- Regression fix, images have better quality again!
Version 0.2:
- Better configuredialog
- More screen-friendly. Creates more than one image with the text and cover art in different places.
- Various fixes and speed improvements
Version 0.1.2:
- Works even if user has no screensaver set (Thanks to David Hugas Germí )
Version 0.1.1:
- Cover image now has better quality
Version 0.1:
Here we go!
nebbus
13 years ago
I chose to stay with the name for a number of reasons. There are a lot of technologies already that have SS in their name (ssh, css, ssl comes to mind), and even tough the Nazis did a lot of horrible things I still think the world has to go on. We should not forget what they did, but neither should we be afraid for using 'SS' in names or any other objects that might resemble any Nazi organisation.
Any way; I will change the name if I five or more persons make a post that they will not use the script because of the name. Please post also if you do not want me to change it! AmarokSaver is one alternative, but pleas give me ideas if you can think of anything else.
Report
gecko
14 years ago
But I've had a problem because my kopete generates everytime the Song changes an away and a back message. So I just made the lines 268 and 269 to a comment. So there is also no Desktop visable between the songs, while the screensaver is runing.
Tankyou
Report
nebbus
13 years ago
I hadn't thought about the kopete problem. It is easily fixed either your way or with some more dcop-magic! I wil take care of that in an upcoming release!
About the two lines you commented out:
This will fix the kopete problem, but it will also prevent the screensaver from starting on a track-change. The screensaver will start after the time you have sett in you preferences. This will also make the "lock screensaver" function of the script not work. But if you like it more this way that is just fine!
But all of this got me thinking quite a bit! And I have some new ideas for the next release, taking care of these problems. It should not be difficult!
Anyway: Glad you like the script, and glad you could make it work the way you want! Thanks for the feedback, this will make the script better and better!
nebbus
Report
gecko
13 years ago
Thank you for the answer.
Report
Emeric
14 years ago
However, on my fresh gentoo install, i had trouble with it (images were not created) simply because xwininfo and bc were not installed...
You should add them to the list of requirements...
Report
nebbus
14 years ago
nebbus
Report
deloco
14 years ago
But I have one problem... I have a Dual-Screen Setup, with an Ati Radeon 9500... So my Desktop is actually 2560x1024 Pixels... The Problem with KoverSS is, that it is displayed in the Middle of both Screens...
Is there a way to tell it, that the created image-size shall be 2560x1024 and to configure it so, that the Cover-Art will be displayed on the right Screen, and the SOnginfos on the left screen?
I already looked into the script, but I'm no good in finding out how such scripts work...
Report
nebbus
14 years ago
Yes, I think I can help you with your problem.
On line 37 and 38 the screen resolution is set. Change HEIGHT and WIDTH to your values. (HEIGHT=1024 and WIDTH=2560)
On line 117 you can change '-gravity center' to '-gravity east'. This should put the cover art on your right screen. You could also try adding '-geometry -x-y' where x and y are integers (try x=400 and y=300 as a start).
I have not tried this as I do not have a dual-display like this (my second display is my TV, and that is a clone of my primary display).
Hope this helps!
Even
Report
deloco
14 years ago
How does this option work?
Report
nebbus
14 years ago
On line 117 change:
composite -compose atop -gravity center $WORKDIR/cover.png $WORKDIR/song.png /$FINALDIR/final.png
into
composite -compose atop -geometry "+x+y" $WORKDIR/cover.png $WORKDIR/song.png /$FINALDIR/final.png
Now use x values bigger than the width of your left screen, and y value a bit smaller than your screen height. With '+' composite places the cover x and y pixels from the left and top edges. With '-' it was supposed to place it according to the bottom and right edges. But this did not work for me either.
Hope this helps!
Report
deloco
14 years ago
Report
nebbus
14 years ago
That's the spirit of Linux!
Report
deloco
14 years ago
Dude, you totally rock!
That's a real cool script!
That is the thing I love about Linux! Such simpe things are possible and there is someone (YOU) o did it (or will do it)!
A little tuning and the Script is perfect!
Thanks a lot!
Report
freefred
14 years ago
bye
Report
amigib
14 years ago
anyway script works very good :)
Report
nebbus
14 years ago
Open up the script and on line 33 you will find a variable "COVERFACTOR", change it to something bigger and the image will be bigger.
The variable is the size if the image relative to your screen resolution.
If you comment out line 98 the image will not be resized at all.
nebbus
Report
amigib
14 years ago
still its a shame that the image quality is so low, you know maybe why is this?
Report
nebbus
14 years ago
Turns out, Amarok's dcop function to get the URL of the cover image returns the URL of a small version of the image. When the image is resized the quality is heavily degraded. I have updated the script a bit. It now checks if a larger image exists and uses this instead of the small one. But I have found no way to do this if the image resides inside the album folder, it must have been retrieved with Amarok's amazon.com function.
Report