04-28-2010, 08:13 PM | #1 |
Guru
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
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 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 |
05-02-2010, 12:41 PM | #2 |
Guru
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). |
Advert | |
|
05-09-2010, 01:01 PM | #3 |
Guru
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 Last edited by Iņigo; 05-10-2010 at 05:56 PM. Reason: Added icons.py script |
05-16-2010, 07:26 PM | #4 |
Guru
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. |
Tags |
desktop files, global.db, icon |
|
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 |