AmarokScreenSaver

Amarok 1.x Scripts

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

2
5.0
Description:

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)
Last changelog:

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!

Kostyan

12 years ago

Hello!

I want to use this script, but have some problems. When script start screensaver, i see a "frozen" desktop (simple screenshot) without anything album cover or name of track: image of screensaver is a screenshot of my desktop. Please, help me.

System:

openSuSE 11.0
KDE 3.5.9
amarok 1.4.9.1
ImageMagick 6.4.0

P.S. Sorry for my bad English

Report

C

nebbus

12 years ago

That is _strange_!

Could you start the script and leave it until the screensaver starts. Then in the scriptmanager right click the script and select show output (or similar). Paste the output in a reply below.

It might be your imagemagick version that changes something, I am running 6.3.7. This happened before and should be no problem to fix!

Report

Kostyan

12 years ago

i have this logs:
1) start the script, play music:

call failed

2) start the script, play music, get a screenshot instead of cover:

call failed

Report

C

nebbus

12 years ago

Something is wrong, that's for sure!

It is strange that you get a screenshot as a screensaver. Nothing in the script will do that.

Could you, while playing a track in Amarok issue the following five commands and post the output (two of them will produce images in your workdir):

1. dcop amarok player artist
2. convert -size 60x60 gradient:none-black gradient: -channel A -fx v.R "gradient.png"
3. convert -quality 100 -resize 100x20%! "gradient.png" "shadow.png"
4. dcop kdesktop KScreensaverIface save
5. xset -q

Report

Kostyan

12 years ago

images in my work directory are created successfully

Report

C

nebbus

12 years ago

OK

It might be something wrong with the detection of the kde version.

Please post the output of the following command:

echo KDE_SESSION_VERSION

while you are using KDE 3.5.9

Report

C

nebbus

12 years ago

Ah, good to hear that it works for you! I just tested with my openSUSE VM and it worked there too.

Good to hear that you like the script too!

Report

Kostyan

12 years ago

I did reinstall kdeartwork3 and restart X. After that your script began to work correctly! Problem is solved. Thanks for your work and help. This script is very good!

Report

C

nebbus

12 years ago

OK, those seem to work fine then!

I am dl'ing opensuse right now. Will try to get it installed in a VM tomorrow. Anything special with your installation? I have never used opensuse before so I might use some time to get around it. Is ImageMagic and Amarok installed by default?

Report

Kostyan

12 years ago

openSuSE 11.0 with KDE 4.0 (not used because it's unstable) and KDE 3.5.9 (used by default). ImageMagic and Amarok is installed by default. Thank you for support!

Report

Kostyan

12 years ago

kostyan@linux-cc9x:~> dcop amarok player artist
Steel Pulse
kostyan@linux-cc9x:~> convert -size 60x60 gradient:none-black gradient: -channel A -fx v.R "gradient.png"
kostyan@linux-cc9x:~> convert -quality 100 -resize 100x20%! "gradient.png" "shadow.png"
kostyan@linux-cc9x:~> dcop kdesktop KScreensaverIface save
kostyan@linux-cc9x:~> xset -q
Keyboard Control:
auto repeat: on key click percent: 0 LED mask: 00000002
auto repeat delay: 250 repeat rate: 30
auto repeating keys: 00feffffdffffbbf
fadfffffffdfe5ef
fffffefde9fffbff
bfffffff7fe9ffff
bell percent: 50 bell pitch: 400 bell duration: 100
Pointer Control:
acceleration: 20/10 threshold: 4
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 70 cycle: 600
Colors:
default colormap: 0x20 BlackPixel: 0 WhitePixel: 16777215
Font Path:
/usr/share/fonts/misc:unscaled,/usr/share/fonts/75dpi:unscaled,/usr/share/fonts/100dpi:unscaled,/usr/share/fonts/Type1,/usr/share/fonts/URW,/usr/share/fonts/Speedo,/usr/share/fonts/cyrillic,/usr/share/fonts/truetype,/opt/kde3/share/fonts,/usr/share/fonts/misc:unscaled,/usr/share/fonts/Type1/,/usr/share/fonts/100dpi:unscaled,/usr/share/fonts/75dpi:unscaled,/home/kostyan/.fonts
Bug Mode: compatibility mode is disabled
DPMS (Energy Star):
Standby: 420 Suspend: 780 Off: 1140
DPMS is Enabled
Monitor is On
Font cache:
Server does not have the FontCache Extension
File paths:
Config file: /etc/X11/xorg.conf
Modules path: /usr/lib/xorg/modules/updates,/usr/lib/xorg/modules
Log file: /var/log/Xorg.0.log
kostyan@linux-cc9x:~>

Report

BorgQueen

12 years ago

This is GREAT! This and AmarokFullScreen make a computer the perfect Juke Box.
Thanks.

Report

AdrianPinks

12 years ago

"It restores your original screensaver settings when you stop the script or exit Amarok.""

Can this be changed so that it also restores your original settings when you PAUSE Amarok?

Report

C

nebbus

12 years ago

Yes, should not be a problem.

I am working an a new veresion of the script and will put it into that. I do not know when I will finish it though. KDE4 is out and I need the script to work with that. Amarok 2 is also in the works and things will need to be prepared for that.

Perhaps a bugfix-release first...

Report

AdrianPinks

12 years ago

Wow, thanks for the quick response. I really appreciate the script you've written.

Report

C

nebbus

12 years ago

Hey! Glad you like the script!

I updated it today, it now does what you wanted. It restores the settings on pause and stop!

Report

AdrianPinks

12 years ago

I'm having a problem with the screensaver!

The screensaver starts automatically after 5 minutes even though I have been using the keyboard and/or mouse during that period. Subsequent movement of the mouse or a key press stops the screensaver, but it activates again after approx 1 second. Subsequent movement of the mouse or a key press then stops the screensaver, however it will start again in 5 minutes despite me using the keyboard/mouse during that time.

Report

C

nebbus

12 years ago

The screensaver starts when Amarok changes track. I know, this can be anoying if you are using the computer. I have not found a way to prevent this with KDE3, but with KDE4 it is easy. I will put this feature into the next release.

I created a small script and made a hotkey to run it. The script turns AmarokScreenSaver on and off. This way it is easy to prevent this problem. The script only has these lines:

#!/bin/bash

if dcop amarok script listRunningScripts | grep $1; then
dcop amarok script stopScript $1;
else
dcop amarok script runScript $1;
fi

save it as toggleamarokscript.sh and run it with 'toggleamarokscript.sh AmarokScreenSaver' to turn my Amarok script on/off.

Report

theheretic

13 years ago

I _love_ the script. What I haven't been able to figure out though is why I can see the album cover art but there's no artist/track data. Looking in the scripts directory it doesn't look to me like the .png files for the text information are being created but I cannot figure what's happening.
I've attempted to run the script from the command line and it fails for various reasons. Before I hack up the script to make that work I thought I'd see if this was something you may have some pointers on.

I'll be one happy camper if I can get that fixed.

Report

theheretic

13 years ago

Okay, I've done some further debugging (I was able to run from the command line with some tweaks).

I think I see where the problem is but I'm not completely positive, yet, how to fix this.

composite: invalid argument for option `"++"': -geometry.

I see this output when running the script from the command line. Evidently the variables for P0, P1, and P2 are causing the composite command to barf. I believe this is the reason behind the track and artist info not showing up in the screensaver. I was getting a similar error for the mogrify -resize argument and I changed that from a "x" x "y" argument to a precentage (i.e., 80x80 to 150%). That seems to have fixed that problem and some of the blurriness of the resized pictures.

I'm exactly sure what the P0,1, and 2 variables are doing so I'm not quite certain how to go about fixing this. Any help would be appreciated.

I have since verified that the .png's for that information are being created but they're getting deleted almost immediately after creation.

Report

C

nebbus

13 years ago

Hi, sorry for not answering your first post.

It might be your imagemagic version. I am using version 6.2.4 with Kubuntu 7.04.

Have you got xwininfo and bc installed? They are needed. The next version will (probably) not need them. Check if they are installed and if not install them. This might be the reason you get blury cover images as well.

If this is not the case:
- In settings disable "Rotate placement"
- In the script, on line 147 replace "${placement[0]}" with "+150+150". Try different values as you see fit.

I am glad you like the script and hope this helps. I am rather busy at the moment but I am hope I will find time to enhance the script in the next two months(!).

Please give feedback if this helps!

Report

denisq

13 years ago

I really like your script, the idea is cool!
However, it would be even cooler with a kind of reflexion like the one in amarokFS. Futhermore, I would remove the tracknumber, because when there is non, it trackname is shown as follow "- title". A larger image as default value would be cool, too! ;)
It is possible to prevent screensaver to be launched on track change? This is quite annoying when working on the desktop.

Report

C

nebbus

13 years ago

I am thinking of putting in a reflection like in AmarokFS, but keep in mind that it would take longer to make the images then.

It should not be difficult to hide the track number when there is none.

I also find it annoying when the screensaver starts when I am working. Therefore I have assigned a shortcut that starts/stops the script. When I am working I don't use the script. But I am thinking of ways to prevent the screensaver from starting like this.

I am afraid it will take some time until I finish a new version, because I just got a second daughter and there is a lot of things to do. I will look into your suggestions when I have the time though!

Report

tobsen

13 years ago

I would appreciate another name for this script. The name reminds me of the nazi organisation SS (Schutzstaffel, have a look on http://en.wikipedia.org/wiki/SS for further information) that was responsible for plenty of barbarous wear crimes during the Second World War.

Report

C

nebbus

13 years ago

Ahhh

I renamed it anyway. I found out that the name did not say anything about what the script did. The new name is AmarokScreenSaver. Hope you like it!

Report

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!

12345678910
Be the first to comment
koqep
Jan 29 2010
DaiVied
Dec 30 2009
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
0.5.0
updated Jun 25 2008
added Sep 30 2006
downloads 24h
0
mediaviews 24h 0
pageviews 24h 1
System Tags addon