Shiny New E-Book Gizmo: The Amazon Kindle


View Full Version : Could you make a script for changing button shortcut for me?


harpum
02-03-2007, 05:27 PM
Because I do not know programming, I cannot change button shortcut.
For example, I want to assign CF-card to news.
I guess it will not be difficult to expert.

Thanks.

Antartica
02-05-2007, 02:27 AM
Because I do not know programming, I cannot change button shortcut.
For example, I want to assign CF-card to news.

AFAIK, the attached scripts should do the trick.

For connecting the news button to the compactflash slot, use the script
newsbutton2cf.sh

To undo the previous script, that is, for re-connecting the news button to the newspapers folder, use the script
newsbutton2newspapers.sh

Hope it works (have not tried it...). You will need to have installed the sh exec support package; if you don't have it, request it here: http://developer.irexnet.com/

Matthijs
02-05-2007, 02:48 AM
That should indeed do the trick.

doctorwes
02-05-2007, 07:17 AM
The script does work - thank you - though it still says "Newspapers" at the top of the screen.

Matthijs
02-05-2007, 07:19 AM
No way to change that, I'm afraid.

splat
02-05-2007, 08:19 AM
For connecting the news button to the compactflash slot, use the script
newsbutton2cf.sh[/url]

Should it not link to the newspapers directory on the CF card rather than the root dir?

eg:
ln -s /mnt/cf/newspapers /opt/content/newspapers

instead of

ln -s /mnt/cf /opt/content/newspapers

yokos
02-05-2007, 08:58 AM
Should it not link to the newspapers directory on the CF card rather than the root dir?

harpum "want[ed] to assign CF-card to news [button]", this is what the script does. :scholar:

templario
02-05-2007, 01:33 PM
Is it posible to assign the news button to (for example) flip pages, or any other button. If so, how could be done? and would it be dangerous to the Iliad?. Unfourtunately i have no formation or skills to do this (i even donīt know if it is doable?)

Thanks a lot.

splat
02-05-2007, 02:10 PM
harpum "want[ed] to assign CF-card to news [button]", this is what the script does.

Ah that makes more sense, I guess I should sign up for the shell hack so I can see these things for my self


Is it posible to assign the news button to (for example) flip pages, or any other button.


This would be a great option to have.

Matthijs
02-06-2007, 01:35 AM
Is it posible to assign the news button to (for example) flip pages, or any other button.
That is not possible.

raevyn1
02-06-2007, 04:13 AM
Another non-programmer here. Thanks for this script, Antartica. Could the News button point to the MMC card instead?

Antartica
02-06-2007, 06:42 AM
Another non-programmer here. Thanks for this script, Antartica. Could the News button point to the MMC card instead?

Of course X-D.

Attached is an upgraded package, with more scripts:
newsbutton2cf.sh for connecting the news button to the compact flash slot
newsbutton2cf.sh for connecting the news button to the SD/MMC slot
newsbutton2usb.sh for connecting the news button to the USB-stick port
newsbutton2newspapers.sh to restore the original connection to the newspapers folder

Hope that covers all the needed functionality. I would never though that a two-line script would be so gladly received :crowngrin

Matthijs
02-06-2007, 06:46 AM
Maybe you could help Tribble by writing another 2-liner one that moves Settings and Profiles to the end of the Device Manager? ;) :D

yokos
02-06-2007, 06:57 AM
All-in-one-Package with Contentlister GUI.
Script recognizes the directory [on MMC, CF, USB] - in root or subfolder - you want to link to. All 4 buttons are included.

contents of readme.txt in zip-file:
:: why this? ::
...................
Because you want to hack iLiad's news/books/docs/notes button without any risks.
You want to link a self choosen directory to a button.


:: Needed steps for news button hack::
......................................
[1] Copy the folder link_news_button_2_CF_MMC_USB to a directory which you want to link to the news button.
[2] Insert CF, MMC, or USB stick in iLiad & navigate to your choosen folder.
[3] Click on the entry "Link CF, MMC, or MMC to news button"
[4] Happy news button pressing. ;-)
[4] Click on the entry "Restore default settings of news button." to get back default settings.

tribble
02-06-2007, 07:46 AM
Maybe you could help Tribble by writing another 2-liner one that moves Settings and Profiles to the end of the Device Manager? ;) :D

OH YES! I would so love that :D

yokos
02-06-2007, 07:52 AM
Maybe you could help Tribble by writing another 2-liner one that moves Settings and Profiles to the end of the Device Manager? ;) :D
Where is the information of entries' arrangement stored?

mtas
02-06-2007, 10:27 AM
Where is the information of entries' arrangement stored?

It looks like you can find it under "/usr/share/contentlister/mode/en/" for English. In this dir you have the following directories:
1_setup/
2_profiles/
3_reference/
4_recentdocs/
a_CF/
b_MMC/
c_USB/
d_main/

Where each directory containing a manifest.xml and an icon.

So, it seems to be quite simple to change the order in which the items are listed. :)

Matthijs
02-06-2007, 11:10 AM
Indeed, they are sorted on directory name. Be sure to change it either for all languages, or only the current one:

lang=`grep "language" /var/er_registry.txt |cut -d'=' -f 2 |cut -d'_' -f 1`


Oh and you should probably access it via the /var/mode/ symlink

splat
02-06-2007, 12:13 PM
That is not possible.

While it may not be possible with a sript, what would the possability of you guys (iRex) adding it as an OS feature.

One think I liked about the librie is there were a number of ways to change the page. two buttons on the left side, two buttons on the bottom and a scroll wheel.

The biggest problem I find with the iLiad is that there is only one way to change the page and after a while it can get tiresome, or you just want to hold the page in your right hand.

What I would like to see would be perhaps an onscreen icon (when in book mode) that would toggle the hard buttons (category and arrows) so that they would act as a page back page forward.

This would allow for more comfort when using the device for extended periods and also extend the life of the page turn bar.

Hoepfully some food for thought :)

harpum
02-06-2007, 05:16 PM
Thanks alot.
I tried to find best crop size for iliad using latex program.
So I did check it for a long time.
Thanks again. I am very happy.

mtas
02-07-2007, 10:16 AM
Maybe you could help Tribble by writing another 2-liner one that moves Settings and Profiles to the end of the Device Manager? ;) :D
Well, it's not a 2-liner but in this zip file there is two scripts that can be used for reorganising the listing in Device Manager.

Unzip the file, copy the directory reorganise_main_menu to the iLiad and select Reorganise Main Menu in the Content Lister. This will change the order of the entries in Device Manager from Setup, Profiles, Reference, Recent Docs, CF, MMC, USB, Main Memory to Recent Docs, CF, Main Memory, MMC, USB, Reference, Setup ,Profiles.

To restore to the original order select Restore Original Main Menu in the Content Lister.

Orion
02-07-2007, 03:01 PM
@yokos
I hope you don't mind, that I modified your scripts a bit to link to "Recent Documents" folder instead.

By the way, great job on the script and thanks for sharing with us :)


As with yokos scripts, all 4 buttons are included here too.

tribble
02-07-2007, 06:06 PM
Well, it's not a 2-liner but in this zip file there is two scripts that can be used for reorganising the listing in Device Manager.

Unzip the file, copy the directory reorganise_main_menu to the iLiad and select Reorganise Main Menu in the Content Lister. This will change the order of the entries in Device Manager from Setup, Profiles, Reference, Recent Docs, CF, MMC, USB, Main Memory to Recent Docs, CF, Main Memory, MMC, USB, Reference, Setup ,Profiles.

To restore to the original order select Restore Original Main Menu in the Content Lister.

THANK YOU, mtas!
Hey Matthijs, if it is that easy, why isnt it already available as an option on the iLiad? ;)

vranghel
02-07-2007, 11:22 PM
All-in-one-Package with Contentlister GUI.
Script recognizes the directory [on MMC, CF, USB] - in root or subfolder - you want to link to. All 4 buttons are included.

contents of readme.txt in zip-file:

Another great release by yokos!

Thanks man! I just realized that this would be useful.

mtas
02-08-2007, 02:20 AM
THANK YOU, mtas!
Hey Matthijs, if it is that easy, why isnt it already available as an option on the iLiad? ;)
You're welcome, I'll try to make the script a little more flexible. Right now it's too easy to mess it up if you try to change it.

raevyn1
02-08-2007, 04:32 AM
Thank you, Antartica, yokos, and mtas! Such seemingly simple changes make the iLiad that much more user friendly. Hope these changes will be incorporated into 2.9. I'd hate to lose 'em.

yokos
02-08-2007, 07:43 AM
Thank you, mtas. This is working. :cool:
Your script was written for the English iLiad menu, so I changed the line "DIR=/usr/share/contentlister/mode/en" to get support for German [de], Nederlands [nl], & simplified Chinese [zh].

[EDIT I] @orion: Cool, I just forgot the "Recent Documents".
[EDIT II] Attached script is now obsolete, because mtas has updated the script.

mtas
02-08-2007, 08:23 AM
Thank you, mtas. This is working. :cool:
Your script was written for the English iLiad menu, so I changed the line "DIR=/usr/share/contentlister/mode/en" to get support for German [de], Nederlands [nl], & simplified Chinese [zh].

@orion: Cool, I just forgot the "Recent Documents".

You're welcome, regarding the language issue I'm working on a language agnostic version with a separate configuration file where the order of the items can be defined. The earlier one is really a bit too risky, too easy to mess something up if you try to edit it.

mtas
02-09-2007, 04:03 AM
Thank you, mtas. This is working. :cool:
Your script was written for the English iLiad menu, so I changed the line "DIR=/usr/share/contentlister/mode/en" to get support for German [de], Nederlands [nl], & simplified Chinese [zh].
Here's a new and safer version of the script. This one checks what language that is used and uses a config file (new_order.txt) where the desired menu order can be defined.

Also, it adds some sanity checks such as verifying that all menu entries are defined in the config file. If the sanity check finds an error a log file named error_log.txt will be created.

yokos
02-09-2007, 05:01 AM
Here's a new and safer version of the script. This one checks what language that is used and uses a config file (new_order.txt) where the desired menu order can be defined. [...]
Well done. :cool: It's much more flexible & saver now.

templario
04-14-2007, 05:51 PM
The "reorder" from Mtas. doesnīt work for me. Here it is the message in error_log.txt:
"Number of lines in the file new_order differs from the number of entries in Device Manager menu.r 0 entries in Device Manager menu.r 8 in the file new_order.r The following line(s) does not exist in Device Manager menu.r recentdocsr CFr USBr MMCr
setupr profilesr referencer mainr"

Anyway thanks for your effort to improve the Iliad.

mtas
04-16-2007, 01:40 AM
The "reorder" from Mtas. doesnīt work for me. Here it is the message in error_log.txt:
"Number of lines in the file new_order differs from the number of entries in Device Manager menu.r 0 entries in Device Manager menu.r 8 in the file new_order.r The following line(s) does not exist in Device Manager menu.r recentdocsr CFr USBr MMCr
setupr profilesr referencer mainr"

Anyway thanks for your effort to improve the Iliad.Odd, could you zip together the files new_order.txt and original_order from the directory where you have installed the reorder script and post them? I'll take a look at it and try to see what's wrong.

templario
04-16-2007, 04:51 AM
Ok, iīll do it when i get home. Anyway, could it be that iīm running the script from the CF card?

Thanks for your help and your scripts.

mtas
04-16-2007, 07:18 AM
Ok, iīll do it when i get home. Anyway, could it be that iīm running the script from the CF card?

Thanks for your help and your scripts.Well, I'm running it from my CF card so thats not the problem. Would it be possible for you to just zip the whole reorder directory and mail i to me?

I'm quite intrigued by this problem because this should "just work" (I know, famous last words and all :wink: )

templario
04-16-2007, 12:38 PM
Here i attach a zip of the whole reorder directory, it is very strange as i think i didnīt change anything from your script, i hope you can fix it, because it is a very useful script.


Thanks

Edit 1. I tried your script (without modifying anything) in the internal memory and the result is the same, nothing happens and the logerror file is the same as in the cf that is in the zip.

Edit 2. I did notice that the size of the file "original_order" is 0 kb. Maybe is normal that i donīt know.

mtas
04-17-2007, 02:53 AM
Here i attach a zip of the whole reorder directory, it is very strange as i think i didnīt change anything from your script, i hope you can fix it, because it is a very useful script.


Thanks

Edit 1. I tried your script (without modifying anything) in the internal memory and the result is the same, nothing happens and the logerror file is the same as in the cf that is in the zip.

Edit 2. I did notice that the size of the file "original_order" is 0 kb. Maybe is normal that i donīt know.This is really odd, the only thing I can think of is that the language variable LANG is not set correctly in the script. Also, the trailing r on each line should not be there.

Enclosed is a new version of the script with some extra error logging, could you please run this one and let me know what the result is?

templario
04-17-2007, 04:59 AM
I run the script and still is not working. This time i only could try from the usb key. Here it is the whole reorder directory with the error logging.

Thanks

templario
04-17-2007, 08:22 AM
I think i found what the problem was, after some time i realised i had running other script (lind_docs_button_2_cf), which i used to link the docs button to the docs folder in the cf card, so i restored the script in tried the reorder one and this time it worked. So there must be any kind of conflict between those two scrips.
Iīm sorry if this caused you (mtas) any lose of time and hope at least this could help to find out a little bit about posible problems.

Thanks for taking the time to worry about "my problem".

mtas
04-17-2007, 08:56 AM
I think i found what the problem was, after some time i realised i had running other script (lind_docs_button_2_cf), which i used to link the docs button to the docs folder in the cf card, so i restored the script in tried the reorder one and this time it worked. So there must be any kind of conflict between those two scrips.
Iīm sorry if this caused you (mtas) any lose of time and hope at least this could help to find out a little bit about posible problems.

Thanks for taking the time to worry about "my problem".I'm glad that you managed to get it working. Regarding any eventual loss of time on my side, that's no issue.

I should rather thank you for this since this problem have highlighted a bug in my script. I'll install the re-mapping of the docs button myself and see what must be done to fix this problem.

wagnerian
06-07-2007, 03:43 AM
Of course X-D.

Attached is an upgraded package, with more scripts:
newsbutton2cf.sh for connecting the news button to the compact flash slot
newsbutton2cf.sh for connecting the news button to the SD/MMC slot
newsbutton2usb.sh for connecting the news button to the USB-stick port
newsbutton2newspapers.sh to restore the original connection to the newspapers folder

Hope that covers all the needed functionality. I would never though that a two-line script would be so gladly received :crowngrin

These scripts are not compatible with OS 2.10.
The /opt/content/ directory does not exist any more.

wagnerian
06-07-2007, 08:29 AM
These scripts are not compatible with OS 2.10.
The /opt/content/ directory does not exist any more.

I've succeeded to change the button shortcuts under OS 2.10 by modifying the er_registry.txt file.
Don't try this risky thing if you don't know how to enable ssh connection to your iLiad.


[BOOKS_CATEGORY]
locationArray=/var/recentdocuments;
searchType=or
searchRecursive=false
searchStringArray=;
searchFieldArray=;
sortFieldType=fsname
sortAscending=false
[NEWSPAPERS_CATEGORY]
locationArray=/mnt/cf;
searchType=or
searchRecursive=false
searchStringArray=;
searchFieldArray=;
sortFieldType=fsname
sortAscending=true
[DOCUMENTS_CATEGORY]
locationArray=/mnt/cf/Programs;
searchType=or
searchRecursive=false
searchStringArray=;
searchFieldArray=;
sortFieldType=fsname
sortAscending=true

realityloop
06-13-2007, 11:56 PM
Well, it's not a 2-liner but in this zip file there is two scripts that can be used for reorganising the listing in Device Manager.

Unzip the file, copy the directory reorganise_main_menu to the iLiad and select Reorganise Main Menu in the Content Lister. This will change the order of the entries in Device Manager from Setup, Profiles, Reference, Recent Docs, CF, MMC, USB, Main Memory to Recent Docs, CF, Main Memory, MMC, USB, Reference, Setup ,Profiles.

To restore to the original order select Restore Original Main Menu in the Content Lister.

Will this still work on 2.10?

Edit: apparently so :)

dreadengineer
07-13-2008, 01:00 AM
Wagnerian's shortcut key method above basically works for version 2.12 also; the change is that er_registry.txt has a different name; it's now /mnt/settings/registry/registry.xml

For example, I edited the location entry below to make the Docs button go to /mnt/cf rather than the default.


<category type="DOCUMENTS">
<location>/mnt/cf</location>
<sort>
<field>FSNAME</field>
<ascending>true</ascending>
</sort>
</category>


You have to restart the Iliad for the change to take effect. Probably the easiest way to edit the registry.xml file is to use mrxvt to copy it to a user-accessible place, edit it on your PC, and use mrxvt to copy it back.