10-26-2012, 09:11 PM | #1 |
20% cooler.
Posts: 93
Karma: 364674
Join Date: Oct 2012
Location: Poznań, Poland
Device: Kindle Paperwhite 1
|
Python + PyGTK for Kindle Touch and Paperwhite
Hi,
I couldn't find already packaged PyGTK for Kindle, so I decided to do it on my own. And I've just got PyGTK running on my Paperwhite. I've used latest Debian sid armel packages. There is GTK+ provided (and few others) despite of Kindle having its own version - I was too lazy to recompile everything to fix missing symbols issues. All symlinks and hard links in package are dereferenced, which means that it can be safely unpacked on /mnt/us, but it also means that there are copies instead of links and they take more space. Download: http://dosowisko.net/kindle/python.tar.gz Usage: Unpack python.tar.gz package in /mnt/us/extensions (or if you're in USB disk mode - in /extensions). If you really want to, you can place it somewhere else, but you'll need to tweak paths in pythonenv file. You can setup environment with ". pythonenv" command. After that you can just call "python", or run python files just like any other executable. There are test files bundled - type "python demos/gtk-test.py" to run one. (please note that windows have to have proper X11 class names in order to be correctly displayed by Awesome - refer to https://www.mobileread.com/forums/sho...hp?t=162022#10 for more info) It probably won't work on any other Kindle than Paperwhite, but you can still try (update: thanks to twobob we now know that it works on Touch too ) Cheers Last edited by dos1; 10-27-2012 at 06:07 PM. |
10-26-2012, 11:37 PM | #2 | ||
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Kindle 5.
result okay I DID have to move my previous install of python out of the path. note to others: If you get... Quote:
[root@kindle python]# strace -fF -o /mnt/us/pyGTKstrace.txt ./test.py revealed my other ones location. Code:
5451 getuid32() = 0 5451 execve("/mnt/us/usr/bin/python", ["python", "./test.py"], [/* 25 vars */]) = 0 5451 brk(0) = 0x11000 Thanks for the funky toy EDIT: I also amended the pythonenv to be a bit more forgiving since we are sourcing it to the main shell. (with whitespace for clarity, obviously make it valid) Quote:
Last edited by twobob; 10-26-2012 at 11:57 PM. Reason: pythonenv |
||
Advert | |
|
10-27-2012, 08:44 AM | #3 |
20% cooler.
Posts: 93
Karma: 364674
Join Date: Oct 2012
Location: Poznań, Poland
Device: Kindle Paperwhite 1
|
Yay! Updated topic name to reflect it (update: didn't work I guess only mods can do that.)
Thanks, I've updated package to contain your changes |
10-27-2012, 09:54 AM | #4 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
The way to do that, is to navigate to your first post of the thread, use the "report post" button, request in the text box for the name change.
|
10-27-2012, 11:45 AM | #5 |
Guru
Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
|
PyWebKitGtk? Does this support glade?
Those two would be a dream, as I could have quiet a few apps ported... |
Advert | |
|
10-27-2012, 06:06 PM | #6 |
20% cooler.
Posts: 93
Karma: 364674
Join Date: Oct 2012
Location: Poznań, Poland
Device: Kindle Paperwhite 1
|
I've just uploaded updated version with python-glade included, enjoy
Unfortunately, PyWebkitGTK is a bit problematic. Package with it takes much more space (about 50MB unpacked without, and about 150MB with webkit) and programs using it segfault as soon as some page is loaded. It's not included in the package, buuuut... ...I've created python script for creating Python package for Kindle You can specify which Debian packages you want to have included and generate such package by yourself - so if you want to test and/or debug webkit, you can use it. I've already listed all needed dependencies in the script, so you just have to uncomment proper line. Script is available at http://dosowisko.net/kindle/build-python.py (it needs unix-like userspace, so on Windows you'll need something like Cygwin) TODO list: - integrate on-screen keyboard with PyGTK - menus don't work, probably Awesome configuration is breaking them somehow - investigate why webkit segfaults Last edited by dos1; 10-27-2012 at 06:10 PM. |
10-27-2012, 11:24 PM | #7 |
Guru
Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
|
Nice! I could do without webkit for now. Am working on an mplayer gui. I hope I can finish it this time
|
01-06-2013, 09:57 PM | #8 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
|
01-07-2013, 06:09 AM | #9 |
Guru
Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
|
It will be finished, but right now, I don't get much time for anything (exams)
|
03-23-2013, 04:40 PM | #10 |
Enthusiast
Posts: 39
Karma: 132550
Join Date: Aug 2012
Device: Kindle Touch
|
Could anyone tell me how to use this? i extracted python.tar.gz to the extensions folder on my KT, but how do i use it on the kindle? (for reference, the file in the extensions folder is python.tar)
|
03-23-2013, 05:12 PM | #11 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
right...
need to untar that also mate are you a windows user then? |
03-24-2013, 01:06 PM | #12 |
Enthusiast
Posts: 39
Karma: 132550
Join Date: Aug 2012
Device: Kindle Touch
|
ahh, yes a windows user ;D i did un-tar it, and put it in extensions, but then nothing Oo
|
03-24-2013, 10:39 PM | #13 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
well. what did you expect it do?
Did you build something from the demos folder and run it? need more info as to YOUR actual steps... it does "nothing" on its own... |
03-25-2013, 11:40 PM | #14 |
Enthusiast
Posts: 39
Karma: 132550
Join Date: Aug 2012
Device: Kindle Touch
|
hmmm maybe ive got this all wrong. i was sort of expecting a app where i could run py files? or possible make/edit them? im sorry im bad at this
|
03-25-2013, 11:45 PM | #15 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
no worries mate. I did much the same..
like I said in https://www.mobileread.com/forums/sho...52&postcount=2 look for the test.py in the subfolder (it's in there) that will get you started. you can check my notes. : ) We all start somewhere. |
Tags |
gtk, k5 tools, kindle, paperwhite, pw tools, pygtk, python |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindle Paperwhite | Marc_liest | Amazon Kindle | 360 | 01-17-2014 06:24 AM |
Python for kindle | Matan | Kindle Developer's Corner | 8 | 01-04-2013 02:54 PM |
Amazon launches Kindle Paperwhite and Kindle Lending Library in Europe | HarryT | News | 18 | 10-13-2012 11:24 AM |
Python + pyGTK package for the DR v3.0 | Mr. X | iRex | 22 | 03-19-2012 06:49 AM |
iLiad pyGTK | rudysplif | iRex Developer's Corner | 2 | 12-23-2007 07:29 AM |