View Single Post
Old 07/22/2009, 08:56 PM   #3 (permalink)
dbgod
Member
 
Join Date: Jun 2009
Posts: 17
Likes: 0
Thanks: 9
Thanked 3 Times in 1 Post

Default

The images are in /var/luna/data/browser/icons . For the "built-in" bookmarks, there are 3 files each:
  • bookmark-icon-{name}.png - 32x32 px icon you see in the bookmark list
  • {name}-bookmark-icon.png - 64x64 px icon that doesn't seem to appear anywhere
  • {name}-bookmark-thumbnail.png - 90x120 px thumbnail that appears when you start the browser

I'm not happy with the way the Pre tries to make images for you, so I created some of my own. (I also use a better naming convention for the files).

To add your own images:

1. Copy the default bookmark images from /var/luna/data/browser/images to you PC (use WinSCP or copy them to /media/internal and then use the USB cable). They make good templates for creating new images.

2. Create some new images. Here are mine for m.cnn.com:


(cnn-icon32.png)


(cnn-icon64.png)


(cnn-thumbnail.png)

3. Copy the images to your Pre under /var/luna/data/browser/images .

4. Become root and make your filesystem read-write:

[CODE]
$ sudo -i

# rootfs_open -w
[/CODE]

5. Open the bookmark database with the sqlite utility:

[CODE]
# /usr/bin/sqlite3 /var/palm/data/file_.usr.palm.applications.com.palm.app.browser_0/0000000000000004.db
[/CODE]

6. Add a bookmark, save, and exit sqlite:

[CODE]
sqlite> begin transaction;

sqlite> insert into bookmarks (url,title,defaultEntry,iconFile32,iconFile64,thumbnailFile)
values ('http://m.cnn.com','CNN',1,'/var/luna/data/browser/icons/cnn-icon32.png','/var/luna/data/browser/icons/cnn-icon64.png','/var/luna/data/browser/icons/cnn-thumbnail.png');

sqlite> commit;

sqlite> .exit
[/CODE]

Note: the bookmarks are keyed on title, so if you already have a bookmark titled "CNN", the above code will simply update the existing bookmark.


To view all you bookmarks in the database:

[CODE]
sqlite> .header on

sqlite> select * from bookmarks;
[/CODE]

Columns:
  • id - numeric ID
  • url - URL
  • title - Title
  • date - numeric representing the date-time the bookmark was added
  • parent - ?
  • idx - numeric controlling sort order of the bookmarks (when two or more bookmarks have the same idx value, the browser sorts on title)
  • defaultEntry - numeric: 0 for bookmarks you add through the browser, 1 for "built-in" bookmarks (Pre won't mess with the images)
  • iconFile32 - path to the 32x32 px icon
  • iconFile64 - path to the 64x64 px icon
  • visitCount - number of times you selected the bookmark
  • thumbnameFile - path to the thumnail
  • lastVisited - numeric representing the date-time last time you selected the bookmark
  • startIdx - ?
dbgod is offline   Reply With Quote