Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-19-2021, 06:05 PM   #196
NiMa
Evangelist
NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.
 
NiMa's Avatar
 
Posts: 469
Karma: 2390534
Join Date: Jun 2020
Location: Somewhere in the Universe
Device: Kobo Libra, Glo HD, Touch C/B, Mini, Glo, Aura SE, Clara HD, KT
@Acorn

Or; install NiLuJe's stuff
and open up two SSH shells
one for command input
and the other for Vim/Nano

*shell 1*
ESC+:w or ^O

*shell 2*
./some_script.sh

voilà! It's done!
NiMa is offline   Reply With Quote
Old 01-20-2021, 10:10 AM   #197
Acorn
Connoisseur
Acorn is on a distinguished road
 
Posts: 56
Karma: 74
Join Date: Oct 2010
Device: Kindle 3
Is there a better way to draw simple filled rectangles than using images? I saw that PoP posted an example doing that but I don't see any source code.
Acorn is offline   Reply With Quote
Advert
Old 01-20-2021, 10:57 AM   #198
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,478
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
fbink_cls/fbink_grid_clear (with a background color set).

(And there was a script attached to that post, @PoP used the CLI frontend's -k, --cls flag, which calls fbink_cls).

Last edited by NiLuJe; 01-20-2021 at 10:59 AM.
NiLuJe is offline   Reply With Quote
Old 01-21-2021, 09:39 AM   #199
Acorn
Connoisseur
Acorn is on a distinguished road
 
Posts: 56
Karma: 74
Join Date: Oct 2010
Device: Kindle 3
Thanks that's perfect!

If I'm going the admittedly hacky route of stealing input and drawing my app over the top of everything, am I going to have problems with nickel trying to draw things over the top of me? If so is there a reasonable way to prevent this? Also, is there a way to get everything back onto the screen when my application is closed?

Is it a matter of stopping nickel and then starting it again when the app is closed?

I see kobo dashboard does this..

Code:
# Flush the disks: might help avoid damaging nickel's DB...
sync
# Stop kobo software because it's running
killall nickel hindenburg sickel fickel fmon > /dev/null 2>&1
Don't see anything that would then try and start nickel again.. I guess the user is just expected to power cycle the device.. that's an easy solution I suppose

Also, I've been having a bit of a play with using touch input.. and I was wondering if using libinput would be the proper way to do it, rather than the low level hacking that Kobo-Input-Python does.. looks like it would make it quite easy to have plug and play usb input devices if you were so inclined too..

Would libinput be hard to build for the kobo? Maybe it could be included in the almighty Stuff bundle?

Might be a total red herring, I'm not sure if it would necessarily understand the kobo's touch screen, not fully clear on how nix works with input devices / drivers etc.

Cheers!

Last edited by Acorn; 01-21-2021 at 10:00 AM.
Acorn is offline   Reply With Quote
Old 01-21-2021, 09:44 AM   #200
NiMa
Evangelist
NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.NiMa ought to be getting tired of karma fortunes by now.
 
NiMa's Avatar
 
Posts: 469
Karma: 2390534
Join Date: Jun 2020
Location: Somewhere in the Universe
Device: Kobo Libra, Glo HD, Touch C/B, Mini, Glo, Aura SE, Clara HD, KT
Quote:
Originally Posted by Acorn View Post
Thanks that's perfect!

If I'm going the admittedly hacky route of stealing input and drawing my app over the top of everything, am I going to have problems with nickel trying to draw things over the top of me? If so is there a reasonable way to prevent this? Also, is there a way to get everything back onto the screen when my application is closed?

Is it a matter of stopping nickel and then starting it again when the app is closed?

I see kobo dashboard does this..

Code:
# Flush the disks: might help avoid damaging nickel's DB...
sync
# Stop kobo software because it's running
killall nickel hindenburg sickel fickel fmon > /dev/null 2>&1
Don't see anything that would then try and start nickel again.. I guess the user is just expected to power cycle the device.. that's an easy solution I suppose

Also, I've been having a bit of a play with using touch input.. and I was wondering if using libinput would be the proper way to do it, rather than the low level hacking that Kobo-Input-Python does.. looks like it would make it quite easy to have plug and play usb input devices if you were so inclined too..

Would libinput be hard to build for the kobo? Maybe it could be included in the almighty Stuff bundle?

Cheers!
Check my development environment guide : https://www.mobileread.com/forums/sh...d.php?t=336175
You could bind-mount /dev and be able to interact with input even if you're in a chroot.
Also, you can install gcc/g++/clang/meson/ninja/etc. flawlessly with the built-in package manager.

Last edited by NiMa; 01-21-2021 at 09:47 AM.
NiMa is offline   Reply With Quote
Advert
Old 01-21-2021, 10:21 AM   #201
Acorn
Connoisseur
Acorn is on a distinguished road
 
Posts: 56
Karma: 74
Join Date: Oct 2010
Device: Kindle 3
Interesting! Might have a play with that..
Acorn is offline   Reply With Quote
Old 01-21-2021, 12:12 PM   #202
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,478
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@Acorn: Yeah, the current approach is to kill all the things and restart Nickel on exit (c.f., KOReader).

And, no, unfortunately, libinput is not usable on the Kobo, for... reasons. (Mainly, it requires an up to date kernel & userland (mainly, udev), which, much to my dismay, is... *really* not a thing on Kobo ;p).

libevdev does work, on the other hand, but it's much lower level than libinput. (I use it in KoboUSBMS, although not for touch input, because touch input is hell on Kobo. And, also, I don't need it ^^).
[Given the mess you'll have to parse and make sense of, it's not necessarily a bad thing, though].

tslib, a much older project, can also be coerced into behaving, but it's slightly old-school, and is potentially less amenable (without dirty, dirty hackery at the C level) to the kind of trickery needed to translate the mess that is generated by the various Kobo input devices to something it understands than libinput might have been .

Last edited by NiLuJe; 01-21-2021 at 12:20 PM.
NiLuJe is offline   Reply With Quote
Old 01-21-2021, 01:47 PM   #203
Acorn
Connoisseur
Acorn is on a distinguished road
 
Posts: 56
Karma: 74
Join Date: Oct 2010
Device: Kindle 3
Interesting insights, thanks! Where can I find libevdev? Had a rummage through KOReader, but it doesn't seem to be there. Is there anywhere I can find it compiled for Kobo?

Aha, also just saw that KFMon automatically restarts Nickel on exit.. that explains things.

Last edited by Acorn; 01-21-2021 at 02:05 PM.
Acorn is offline   Reply With Quote
Old 01-21-2021, 02:25 PM   #204
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,478
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Err, libevdev is just... fdo's libevdev?

I was going to say I'm pretty sure that anything I build that depends on it (e.g., evemu/evtest) is linking to it statically, but, hey, that's no longer true, so it is in fact in KoboStuff.

And, no, it's not KFMon that restarts Nickel, it's KOReader (c.f., what I linked to in my previous answer, specifically the koreader.sh -> nickel.sh interaction).

Last edited by NiLuJe; 01-21-2021 at 02:28 PM.
NiLuJe is offline   Reply With Quote
Old 01-21-2021, 02:40 PM   #205
Acorn
Connoisseur
Acorn is on a distinguished road
 
Posts: 56
Karma: 74
Join Date: Oct 2010
Device: Kindle 3
Oh right! I was misreading the comments in koreader.sh, makes total sense now.

Aha, I've found it in KoboStuff! For some reason macos file search wasn't finding it.. oops.
Acorn is offline   Reply With Quote
Old 01-21-2021, 02:50 PM   #206
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 856
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Another trick you can do (if you don't need access to /mnt/onboard) to do stuff without nickel clobbering input/framebuffer is to fake a USBMS session. Once on the "connected" screen, you can do almost anything without worrying too much about Nickel.
sherman is offline   Reply With Quote
Old 01-21-2021, 02:53 PM   #207
Acorn
Connoisseur
Acorn is on a distinguished road
 
Posts: 56
Karma: 74
Join Date: Oct 2010
Device: Kindle 3
Bingo!

Code:
Input device name: cyttsp5_mt

Event: time 150848.651488, type 01 EV_KEY code 145 BTN_TOOL_FINGER      value    1
Event: time 150848.651488, type 01 EV_KEY code 14a BTN_TOUCH            value    1
Event: time 150848.651488, type 03 EV_ABS code 039 ABS_MT_TRACKING_ID   value    0
Event: time 150848.651488, type 03 EV_ABS code 03b ABS_MT_DISTANCE      value    0
Event: time 150848.651488, type 03 EV_ABS code 035 ABS_MT_POSITION_X    value  222
Event: time 150848.651488, type 03 EV_ABS code 036 ABS_MT_POSITION_Y    value  172
Event: time 150848.651488, type 03 EV_ABS code 03a ABS_MT_PRESSURE      value   21
Acorn is offline   Reply With Quote
Old 01-21-2021, 02:55 PM   #208
Acorn
Connoisseur
Acorn is on a distinguished road
 
Posts: 56
Karma: 74
Join Date: Oct 2010
Device: Kindle 3
Quote:
Originally Posted by sherman View Post
Another trick you can do (if you don't need access to /mnt/onboard) to do stuff without nickel clobbering input/framebuffer is to fake a USBMS session. Once on the "connected" screen, you can do almost anything without worrying too much about Nickel.
Is there somewhere I could see what that would look like?
Acorn is offline   Reply With Quote
Old 01-21-2021, 02:59 PM   #209
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 856
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Quote:
Originally Posted by Acorn View Post
Is there somewhere I could see what that would look like?
I used to do that with Kobo-UNCaGED, before v0.5.0. The startup shell scripts show what I did.

EDIT: More specifically, look here.

Last edited by sherman; 01-21-2021 at 03:01 PM. Reason: Added clarification
sherman is offline   Reply With Quote
Old 01-21-2021, 03:09 PM   #210
Acorn
Connoisseur
Acorn is on a distinguished road
 
Posts: 56
Karma: 74
Join Date: Oct 2010
Device: Kindle 3
Quote:
Originally Posted by sherman View Post
I used to do that with Kobo-UNCaGED, before v0.5.0. The startup shell scripts show what I did.

EDIT: More specifically, look here.
That's super handy, thank you!
Acorn is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Aura HD Small tool for filling book library in Kobo Aura Paxerus Kobo Developer's Corner 2 12-31-2013 07:05 PM
Small print Broadback Conversion 12 12-12-2011 02:31 PM
Small Tool to change book order (PRS-x50) goaspy Sony Reader 113 10-14-2011 03:28 PM
small print breezeman Introduce Yourself 13 07-03-2011 09:02 AM


All times are GMT -4. The time now is 08:26 AM.


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