Register Guidelines E-Books Search Today's Posts Mark Forums Read

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, 07: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: 710
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, in love with iRex DR800S. Also a K4NT. Now a Kobo Aura
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 06:28 PM. Reason: Deleted script. Look message #4
Iņigo is offline   Reply With Quote
Old 05-02-2010, 11:41 AM   #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: 998
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
Old 05-09-2010, 12: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: 710
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, in love with iRex DR800S. Also a K4NT. Now a Kobo Aura
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:	220
Size:	75.6 KB
ID:	51361  
Attached Files
File Type: gz icons.py.gz (1.1 KB, 200 views)

Last edited by Iņigo; 05-10-2010 at 04:56 PM. Reason: Added icons.py script
Iņigo is offline   Reply With Quote
Old 05-16-2010, 06: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: 710
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, in love with iRex DR800S. Also a K4NT. Now a Kobo Aura
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:	177
Size:	88.2 KB
ID:	51653   Click image for larger version

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

Tags
desktop files, global.db, icon

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:49 PM
Custom Icons for Your ePub Files Zero9 ePub 1 06-09-2009 07:45 PM
GUI desktop emulates papers and books on physical desktop Bob Russell News 2 06-25-2006 07:42 PM
Access files on your desktop with Google and SoonR Brian Lounge 4 10-28-2005 08:35 AM
no desktop icons on boot-up Unregistered Lounge 11 08-16-2005 12:47 PM


All times are GMT -4. The time now is 03:36 PM.


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