Hi, I'm developing a GTK application for control the LCD and the G-Keys of the G15.
It can show information from Amarok(Exaile and Audacious in next revisions), the processes that consume more, Gmail, Emesene(Pidgin and Kmess in next revisions) and more. It also can bind tasks to the G-Keys.
Only needs g15daemon, g15composer, g15stats, python, python-dbus and python-keybinder
More info here: https://launchpad.net/g15manager
First of all, thanks for
First of all, thanks for this. It works, overall, quite nicely. I've been using the audacious applet (for songbird), and happened to notice if the length exceeded the maximum for the smallest font (being 42 characters), it got cut of. Furthermore, I noticed the length of the title was always used to calculate the needed font size, which caused a problem with artist/album names that were longer than the title, which was the case with some of my albums.
To resolve this I made some small changes to the code, using the longest of the three (Title, Artist and Album) to calculate the length, and implementing scrolling for the strings that exceed the maximum length. I couldn't find a good way to upload a patch or anything to launchpad, so I'll just paste the changes I made here, and then you can see if they're of any use to you.
for entry in cu:
Title = Title.replace(entry, cn[cu.index(entry)])
Artist = Artist.replace(entry, cn[cu.index(entry)])
Album = Album.replace(entry, cn[cu.index(entry)])
# Start of changes
maxlen = max([len(Title), len(Artist), len(Album)]) # Title isn't always the longest string. Or perhaps using the average length instead of the max length would give better results? I didn't test this much.
if maxlen <= 20:
text_size = 2
maxlen = 20
elif maxlen <= 32:
text_size = 1
maxlen = 32
else:
text_size = 0
maxlen = 40
def scroll(str):
if len(str) <= maxlen:
return str
return str[(int(poss) % (len(str) - maxlen + 1)):] + " " * (maxlen - len(str))
Title = scroll(Title)
Artist = scroll(Artist)
Album = scroll(Album)
# End of changes
text = "MC 1\n" + \
"PC 0\n" + \
"TO 0 2 %i 1 \"%s\"\n" % (text_size, Title) + \
"DL 0 11 158 11 1\n" + \
"TO 0 14 %i 1 \"%s\"\n" % (text_size, Artist) + \
"TO 0 22 %i 1 \"%s\"\n" % (text_size, Album) + \
"DB 0 32 159 32 1 %i %i \n" % (position, time) + \
"TO 0 36 1 0\"%i:%s\"\n" % (posm, poss) + \
"TO 0 36 1 1 \"%s\"\n" % Year + \
"TO 0 36 1 2 \"%i:%s\"\n" % (totm, tots) + \
"MC 0\n";
Thanks, I didn't know how do
Thanks, I didn't know how do it ;)