Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex > iRex Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 04-28-2010, 08:13 PM   #1
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
Question Icons for desktop files

Hi there,

EDIT: Look message #4

[message specially targeted to Matthijs or Gertjan ;-]

DR800 does not accept an icon entry in .desktop files to specify the image for the applications. F.e. Osmo.desktop:
Code:
[Desktop Entry]
Name=Osmo
Comment=Personal organizer
Exec=/media/mmcblk0p1/Programs/_osmo/bin/osmo
Icon=/media/mmcblk0p1/Programs/_osmo/share/pixmaps/osmo.png
Type=Application
Encoding=UTF-8
I've tried to manually add the image data to the global.db thumbnails table, but although the images are properly inserted, CTB doesn't show them.

Please, look at the sample lua script attached to this message.
It parses .desktop files on SD/Programs, and store the specified icon image as .png data into the proper DB rows for every .desktop file with a valid icon entry.

Does DR800 use a predefined default icon for .desktop files or am I doing something wrong?

If this is the case, could iRex people extend .desktop files to understand "Icon", please?

Thanks in advance,
Iņigo

Last edited by Iņigo; 05-16-2010 at 07:28 PM. Reason: Deleted script. Look message #4
Iņigo is offline   Reply With Quote
Old 05-02-2010, 12:41 PM   #2
Mackx
Guru
Mackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to behold
 
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
Hi Iņigo,

I experimented with SQLite2009Pro (Freeware version) and added two png files to the shortcut. On my DR1000 (with first R2 beta) it shows the correct thumbnail in the SD Card view. (Although its name is still Osmo.desktop and not the name specified in the desktop file.)
I opened the global.db file and searched for the Osmo.desktop file in file_metadata-table. I used its file_id and added a new row in the thumbnails-table with the same file_id. I created two thumbnails of size 60x60 and 120x120 with gimp and added them to the new row as well.
So the mechanism seems to work, I suspect the lua script still does something wrong (or maybe something changed in the 2nd beta that breaks the mechanism).
Mackx is offline   Reply With Quote
Advert
Old 05-09-2010, 01:01 PM   #3
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
Hi,

yes, it was a problem with the lua code.

The problem here is how to escape the images data before inserting into the BLOB field.
Similar code in python works ok, as you can use sqlite3.Binary(img_data).

In fact, there is a bug in ldbi, the sqlite3 bindings for lua I'm using, conn:escape don't escape the binary data properly.

So I'm now waiting here...
The idea is to make this lua script work in order to be able to do it from inside the DR.

Stay tunned ;-)

EDIT: btw, it works even with images of any size, but obviously we should use proper sizes, 60x60 for small and 120x120 for medium

EDIT2: I've included the sample python script.
Mount your DR device in your Linux computer and run as:
# python icons.py <path_to_your_DR_mount_point>
f.e.
# python icons.py /media/DR800
Eject device and that's all.

EDIT3: added a screenshot
Attached Thumbnails
Click image for larger version

Name:	ss.png
Views:	591
Size:	75.6 KB
ID:	51361  
Attached Files
File Type: gz icons.py.gz (1.1 KB, 542 views)

Last edited by Iņigo; 05-10-2010 at 05:56 PM. Reason: Added icons.py script
Iņigo is offline   Reply With Quote
Old 05-16-2010, 07:26 PM   #4
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
Functional sample script and screenshots

Working icons.lua script and some nice screenshots attached.

Note that currently released lua package, v1, contains a bug in ldbi.sqlite so this script won't work by now. I'll post a new lua package once I finish some helper tools.
Attached Thumbnails
Click image for larger version

Name:	ss-icons-1.png
Views:	561
Size:	88.2 KB
ID:	51653   Click image for larger version

Name:	ss-icons-2.png
Views:	521
Size:	45.7 KB
ID:	51654  
Attached Files
File Type: gz icons.lua.gz (1.2 KB, 504 views)
Iņigo is offline   Reply With Quote
Reply

Tags
desktop files, global.db, icon


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does anyone use Copernic Desktop or Mendeley to manage pdf files? fantasyvn Reading and Management 1 05-22-2010 02:49 PM
Custom Icons for Your ePub Files Zero9 ePub 1 06-09-2009 08:45 PM
GUI desktop emulates papers and books on physical desktop Bob Russell News 2 06-25-2006 08:42 PM
Access files on your desktop with Google and SoonR Brian Lounge 4 10-28-2005 09:35 AM
no desktop icons on boot-up Unregistered Lounge 11 08-16-2005 01:47 PM


All times are GMT -4. The time now is 02:34 AM.


MobileRead.com is a privately owned, operated and funded community.