Image 01
profile-image

bhing

Bhing Jaaveralasam
test
AmarokScreenSaver

Amarok 1.x Scripts 68 comments

Score 50.0%
Jun 25 2008
Once again, many thanks for your reply.

The listing of fonts only gives you the names and not the path to them. I tried it earlier, but it didn't work.

But I got it to work now anyway, and it seems the bug I mentioned was the problem:

https://bugs.launchpad.net/ubuntu/+source/imagemagick/+bug/69531

type.xml points to type-ghostscript.xml which in turn points to the wrong search path for all fonts. The only thing I was left with, was a very basic default font. Looking through

/usr/lib/ImageMagick-6.3.7/config/type-ghostscript.xml

I found the correct paths to all fonts and used one of them like this:

convert -size 500x120 xc:black track.png

mogrify -quality 100 -fill white -pointsize 20 -font /usr/share/fonts/type1/gsfonts/n021003l.pfb -draw "text 100,80 \"$(dcop amarok player album)\"" track.png

I replaced line number 161 in AmarokScreenSaver.sh with the last part and everything works perfectly! I see every letter there is to see.

Again, magnificent script! I will continue to use it daily. And thanks a lot for helping out! Very much appreciated.



- Dec 12 2008
Well thank u again!

It most likely seems to be a font issue. The result:

convert -size 500x120 xc:black track.png
mogrify -quality 100 -fill white -pointsize 20 -draw "text 100,80 \"$(dcop amarok player album)\"" track.png

mogrify: unable to read font `/usr/local/lib/ImageMagick-6.4.3/config//usr/share/ghostscript/fonts/n019003l.pfb'.
mogrify: unable to read font `/usr/local/lib/ImageMagick-6.4.3/config//usr/share/ghostscript/fonts/n019003l.pfb'.

TWICE... for some reason. Now, I only need to change the font. Any input there? I'm not really good at this. Just putting in -font Blablabla doesn't seem to do it.

the file:
/usr/lib/ImageMagick-6.3.7/config/type-ghostscript.xml

tells me that n019003l.pfb is Helvetica, and that it is located here:
/usr/share/fonts/type1/gsfonts/n019003l.pfb
and not where it is looking.

I just found a bug report here:
https://bugs.launchpad.net/ubuntu/+source/imagemagick/+bug/69531

Do you know a way to change the font (or the search path of the script) without replacing type.xml

Looks like I'm headed in the right direction!

Again THANKS!

- Dec 11 2008
Sorry...

The actual input/output is supposed to be like this:

bla@bla-desktop:~$ convert -size 500x120 xc:black track.png
mogrify -quality 100 -fill white -pointsize 20 -draw "text 100,50 \"${dcop amarok player artist}\"" -draw "text 100,80 \"${dcop amarok player album}\"" track.png
bash: text 100,50 "${dcop amarok player artist}": bad substitution

still the same result. - Dec 08 2008
Quote:
Try to just run those commands in a terminal and see how track.png turns out, and remember the \ before some of the ".


Result:

~$ mogrify -quality 100 -fill white -pointsize 20 -draw "text 100,50 \"${dcop amarok player artist}\"" -draw "text 100,80 \"${dcop amarok player album}\"" track.png
bash: text 100,50 "${dcop amarok player artist}": bad substitution

The \ is there as far as I see it, and track.png is all empty black.

Quote:

Could you also post the output of

echo $LANG
and
locale


en_US.UTF-8

and

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

- Dec 08 2008
Sorry, doesn't seem to work.

The script 'AmarokScreenSaver' exited with error code: 1

AmarokScreenSaver/AmarokScreenSaver.sh: line 149: text 100,50 "${dcop amarok player artist}": bad substitution
call failed - Dec 08 2008
Sure thing. It is not a Screen Saver but a system monitor: Sigma System Monitor

http://www.kde-look.org/content/show.php/Sigma+System+Monitor?content=80170

The Amarok part looks like this:

Quote:

# Track informations
#
text x=80 y=22 value="Artist :"
text x=115 y=22 sensor=program program="dcop amarok player artist" interval=1000
text x=80 y=34 value="Title :"
text x=115 y=34 sensor=program program="dcop amarok player title" interval=1000
text x=80 y=46 value="Time :"
text x=115 y=46 sensor=program program="dcop amarok player currentTime" interval=1000
text x=145 y=46 value="/"
text x=155 y=46 sensor=program program="dcop amarok player totalTime" interval=1000


And it turns out like this:
http://img134.imageshack.us/img134/1213/sigmaqx5.png

Looks like it does roughly the same settings as your script, although it doesn't turn text into an image. But I can't see how that would matter.

I tried running your script and Superkaramba, both separate, and at the same time to see if that was messing with something. No difference at all.

Any other suggestions will be very welcome.
Thanks again
- Dec 06 2008
Quote:
Try this:
convert -size 500x120 xc:black track.png
artist="`dcop amarok player artist`"
album="`dcop amarok player album`"
mogrify -quality 100 -fill white -pointsize 20 -draw -draw "text 100,50 \"$artist\"" -draw "text 100,80 \"$album\"" track.png


track.png still displays the exact same problem with letters. (had to remove one "-draw" to display both artist and album in track.png ;) )

Quote:
Then:
convert -size 500x120 xc:black track.png
artist="æøåÆØÅ"
album="æøåÆØÅ"
mogrify -quality 100 -fill white -pointsize 20 -draw -draw "text 100,50 \"$artist\"" -draw "text 100,80 \"$album\"" track.png

And see if the same problem is still there.


Still the same problem, æøåÆØÅ turning out really crazy. So the problem does not seem to be with dcop...

Quote:
What version of KDe and Amarok are you using?


Kubuntu 8.04.1
KDE 3.5.10
QT 3.3.8b
Amarok 1.4.9.1

On a side note; I tried a similar script using a theme in Superkaramba and that displayed everything correctly using dcop.

Don't know if that helps at all, but thanks for staying with me...

- Dec 05 2008
Thanx alot for the fast reply.

Amarok displays the names correctly with ALL the correct characters, regardless of language and letter type.

dcop amarok player title
dcop amarok player artist

Gives me exactly the same CORRECT output in terminal, as in Amarok.

I just inserted a Norwegian song to show you the difference. (Lousy song by the way ;) ) The top of the image is the print screen from the Amarok playlist, the bottom part is from the screen saver image final.png:

http://img78.imageshack.us/img78/2875/amarokandscreenij4.png

Any help is highly appreciated.
Again, thanx for a beautiful script.


- Dec 04 2008
Really great... I use it all the time. Would anyone know a way to show text like - Dec 04 2008
Swedish Internet Radio Stations

Amarok 1.x Scripts 12 comments

Score 50.0%
Mar 30 2009

en enkel och smart liten xml-modifiering.
1-0 till dej! - Dec 04 2008