Register Guidelines E-Books Today's Posts Search

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

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 09-21-2023, 05:06 PM   #1
elinkser
Groupie
elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.
 
Posts: 185
Karma: 146236
Join Date: Oct 2022
Device: Kobo Clara HD
(Pre-FBInk) rmkit on my Clara HD

***

(Pre-FBInk) rmkit on my Clara HD

* For official thread, please see:
https://www.mobileread.com/forums/sh...d.php?t=359125



***

RUNNING RMKIT APPS

rmkit-dev/rmkit
https://github.com/rmkit-dev/rmkit

$ wget https://build.rmkit.dev/master/latest/kobo/KoboRoot.tgz

Install to .kobo/

After unmounting power cycling my Kobo reader, I swiped up the verry right OR left edge of my Clara HD, straddling the display and the bezel. I swiped all the way bottom to top. Maybe tap and swipe if you have troubles.

The menu comes up with:
Nickel
animation_demo
dumbskull
input_demo
mines
rpncalc
wordlet

E.g. click to select the mines app.

Swipe up to return to the menu.

Click the menu usage stat to the right of the mines entry to kill the app.

Click the Nickel entry to return to Nickel.

Attempt to install additional packages manually:

Index of /master/latest/kobo/
https://build.rmkit.dev/master/latest/kobo/

$ wget https://build.rmkit.dev/master/lates...release.tar.gz

$ tar zxvf release.tar.gz
apps/
apps/eclear
apps/drawing_demo
apps/mines
apps/rpncalc
apps/sharenote
apps/dumbskull
apps/sha256sum.txt
apps/animation_demo
apps/proc
apps/remux
apps/wordlet
apps/ls.txt
apps/harmony
apps/remux.service
apps/simple
apps/genie
apps/dithering_demo
apps/input_demo
apps/stb.arm.o
apps/lamp
apps/iago
apps/nao.sh
apps/rmkit.h
apps/bufshot


Copied apps/drawing_demo to /mnt/onboard/.adds/rmkit/bin/apps/ on my kobo.
Also copied harmony, lamp, nao.sh, and simple.

The only one of that bunch that appeared to do anything was harmony, which presented a nice menu of tools,etc at bottom.
But when I tried to use ...->new, it froze!

It's seems like it has potential if it gets more developed:
sas: simple app script
https://rmkit.dev/apps/sas
simple is a simple app script for remarkable that lets developers write apps without needing to compile code.
an example layout:
button 50 50 200 50 I'm a button
button 50 150 400 50 I'm a different button
label 50 100 300 50 I'm some text
image 50 200 200 200 /home/root/bomb-solid.png


...

BUILDING RMKIT APPS

rmkit/docs/BUILDING.md
https://github.com/rmkit-dev/rmkit/b...cs/BUILDING.md says:

Individual Projects
You can compile an individual project by running make <project> or make <project>_docker to build the project inside a docker container.

You can change whether you are compiling for the remarkable or a PC by adjusting the TARGET environment variable. See src/actions.make for the list of targets, which include (but is not limited to) dev and arm

Linux
install okp: pip install okp
install resim viewer: pip install rmkit-sim
compile with DEV mode: ARCH=dev make harmony
run harmony with resim ./src/build/harmony

Remarkable
install okp: sudo pip install okp
install arm toolchain
on ubuntu: sudo apt install g++-arm-linux-gnueabihf


***

But in fact, using my distro's g++-arm-linux-gnueabihf cross-platform build environment resulted in a GLIBC that was too new for my venerable Kobo Clara HD.

And trying an older Linaro release like I had done here resulted in a compiler that was too old.

Thankfully, KOReader's koxtoolchain, , like a nice bowl of porridge like you might find in a cabin in the woods , was just right.


We start by trying to build the input_demo app, the same one whose prebuilt binary we tried above.

rmkit-dev/rmkit
https://github.com/rmkit-dev/rmkit

$ mkdir rmkit-build

$ cd rmkit-build/

$ pip install okp

$ pip install rmkit-sim

$ source ~/koxtoolchain/refs/x-compile.sh kobo env bare

$ sudo apt install python3-tk

$ sudo apt install python3-pil.imagetk

$ wget https://github.com/rmkit-dev/rmkit/a...ads/master.zip

$ mv master.zip rmkit-master.zip

$ unzip rmkit-master.zip

$ cd rmkit-master/

$ nano -l src/input_demo/main.cpy
Code:
 76     ds->add_options({"foo", "ba", "baz"})
...
201     ds->add_options({"foot", "bat", "baz"})
$ nano -l src/common.make
Code:
 3 CXX_BIN?=arm-kobo-linux-gnueabihf-g++
 4 CC_BIN?=arm-kobo-linux-gnueabihf-gcc
 5 STRIP_BIN?=arm-kobo-linux-gnueabihf-strip
$ nano -l scripts/build/build_kobo_root.sh
Code:
25   arm-kobo-linux-gnueabihf-strip *
$ ARCH=kobo make input_demo
rmkit.h:19622:14: error: 'ABS_MT_SLOT' was not declared in this scope
rmkit.h:19663:14: error: 'ABS_MT_DISTANCE' was not declared in this scope
rmkit.h:20554:34: error: 'SYN_DROPPED' was not declared in this scope


$ grep -r -n ABS_MT_SLOT
src/.rmkit.h_cpp/input/events.h:251: case ABS_MT_SLOT: {
src/build/rmkit.h:19622: case ABS_MT_SLOT: {
src/rmkit/input/events.cpy:241: case ABS_MT_SLOT:

$ nano -l src/.rmkit.h_cpp/input/events.h
Code:
251 //        case ABS_MT_SLOT: {
252 //          slot = data.value;
253 //          break; }
$ nano -l src/build/rmkit.h
Code:
19622 //        case ABS_MT_SLOT: {
19623 //          slot = data.value;
19624 //          break; }
$ nano -l src/rmkit/input/events.cpy
Code:
241 //        case ABS_MT_SLOT:
242 //          slot = data.value;
243 //          break
$ grep -r -n SYN_DROPPED
src/.rmkit.h_cpp/input/input.h:75: if (ev_data[i].code == SYN_DROPPED) {
src/build/rmkit.h:20554: if (ev_data[i].code == SYN_DROPPED) {
src/rmkit/input/input.cpy:69: if ev_data[i].code == SYN_DROPPED:

$ nano -l src/.rmkit.h_cpp/input/input.h
Code:
 75 //          if (ev_data[i].code == SYN_DROPPED) {
 76 //            syn_dropped = true;
 77 //            event.handle_drop(fd);
 78 //            continue; }
$ nano -l src/build/rmkit.h
Code:
20554 //          if (ev_data[i].code == SYN_DROPPED) {
20555 //            syn_dropped = true;
20556 //            event.handle_drop(fd);
20557 //            continue; }
$ nano -l src/rmkit/input/input.cpy
Code:
 69 //          if ev_data[i].code == SYN_DROPPED:
 70 //            syn_dropped = true
 71 //            event.handle_drop(fd)
 72 //            continue
$ grep -r -n ABS_MT_DISTANCE
src/.rmkit.h_cpp/input/events.h:292: case ABS_MT_DISTANCE: {
src/remux/launcher.cpy:31:#define TOUCH_FLOOD_EVENT ABS_MT_DISTANCE
src/build/rmkit.h:19663: case ABS_MT_DISTANCE: {
src/rmkit/input/events.cpy:282: case ABS_MT_DISTANCE:

$ nano -l src/.rmkit.h_cpp/input/events.h
Code:
292 //        case ABS_MT_DISTANCE: {
293 //          slots[slot].distance = this->distance = data.value;
294 //          if (this->distance > 0) {
295 //            this->left = 0; }
296 //          break; }
$ nano -l src/remux/launcher.cpy
Code:
31 #define TOUCH_FLOOD_EVENT ABS_DISTANCE
$ nano -l src/build/rmkit.h
Code:
19663 //        case ABS_MT_DISTANCE: {
19664 //          slots[slot].distance = this->distance = data.value;
19665 //          if (this->distance > 0) {
19666 //            this->left = 0; }
19667 //          break; }
$ nano -l src/rmkit/input/events.cpy
Code:
282 //        case ABS_MT_DISTANCE:
283 //          slots[slot].distance = self.distance = data.value
284 //          if self.distance > 0:
285 //            self.left = 0
286 //          break

$ grep -r -n NotoMono-Regular.ttf
Binary file src/.input_demo_cpp/main.o matches
src/.rmkit.h_cpp/fb/stb_text.h:37: filename = "/usr/share/fonts/ttf/noto/NotoMono-Regular.ttf";
src/build/rmkit.h:19247: filename = "/usr/share/fonts/ttf/noto/NotoMono-Regular.ttf";
Binary file src/build/input_demo matches
src/rmkit/fb/stb_text.cpy:33: filename = "/usr/share/fonts/ttf/noto/NotoMono-Regular.ttf";


$ nano -l src/.rmkit.h_cpp/fb/stb_text.h
Code:
 37         filename = "/mnt/onboard/.adds/koreader/fonts/noto/NotoSans-Regular.ttf";

$ nano -l src/build/rmkit.h
Code:
19247         filename = "/mnt/onboard/.adds/koreader/fonts/noto/NotoSans-Regular.ttf";
$ nano -l src/rmkit/fb/stb_text.cpy
Code:
 33         filename = "/mnt/onboard/.adds/koreader/fonts/noto/NotoSans-Regular.ttf";

$ nano -l src/common.make
Code:
 2 TARGET?=kobo

$ nano -l src/rmkit/input/events.cpy
Code:
181       invert_y = true
182       invert_x = true
183       swap_xy = false
184       switch version:
185         case util::KOBO_DEVICE_ID_E::DEVICE_KOBO_CLARA_HD:
186           // rotation++
187           rotation %= 4
188           invert_x = true
189           swap_xy = false
190           break


$ ARCH=kobo make input_demo

$ cd ..


Make a backup to your PC of /mnt/onboard/.adds/rmkit/bin/apps/input_demo on your kobo.

Copy input_demo and stb.arm.o(edit-obj file not needed for release,duh) from rmkit-master/src/build/ on your PC to /mnt/onboard/.adds/rmkit/bin/apps/ on your kobo.


Swipe all the way up the edge (right or left) of your Kobo and select the input_demo app.

(Click and swipe inside the box and see the cursor move.)

(Click the Menu, Pager, Overlay, and Options items.)

(Click in the top text entry and type using the onscreen keyboard.)


Swipe up to return to the menu.

Click the menu usage stat to the right of the input_demo entry to kill the app.

Click the Nickel entry to return to Nickel.



***

Now we try to build the Simple framework.


$ source ~/koxtoolchain/refs/x-compile.sh kobo env bare

$ cd rmkit-master/

$ ARCH=kobo make simple


Copy simple from rmkit-master/src/build/ and menu.sh from rmkit-master/src/simple/apps/ on your PC to /mnt/onboard/.adds/rmkit/bin/apps/ on your kobo.

Swipe up the right edge of your Kobo and select the menu.sh app.

(Click the option items.)

Swipe up to return to the menu.

Click the menu usage stat to the right of the menu.sh and simple entries to kill the app.

Click the Nickel entry to return to Nickel.

Now edit the menu.sh without recompiling.

$ nano -l src/simple/apps/menu.sh
Code:
  5 label 0 500 200 50 you pressed: ${option}
  6 [paragraph 0 600 500 500 ${output}]
...
 10   option=`echo "${app}" | /mnt/onboard/.adds/rmkit/bin/apps/simple | grep 'selected:' | sed 's/selected: //'`
 11   output=`cat /mnt/onboard/.kobo/version`

Copy menu.sh from rmkit-master/src/simple/apps/ on your PC to /mnt/onboard/.adds/rmkit/bin/apps/ on your kobo.

Swipe up the right edge of your Kobo and select the menu.sh app.

(Click the option items.)

Swipe up to return to the menu.

Click the menu usage stat to the right of the menu.sh and simple entries to kill the apps.

Click the Nickel entry to return to Nickel.


So we have just modified, without recompiling, an app that works on both Remarkable and Kobo devices.
* Edit - Technically, fbink can do this too, say with lua, if I ever get around to learning lua!
https://github.com/NiLuJe/FBInk

I may now die in peace...

***


Note 1 - rmkit not guaranteed to start at boot:
Since rmkit is started by /etc/udev/rules.d/99-rmkit.rules, which "runs early at boot", and "onboard *might*" (or *might not*) be mounted at that point - says so right in the comments, that means rmkit is not guaranteed to start every boot.
So we take the command from 99-rmkit.rules, and wrap it in a nice NickelMenu item, so we can start it manually:
Code:
menu_item :main    :rmkit              :cmd_spawn          :quiet :/usr/local/rmkit/startup.sh
    chain_success                      :dbg_toast          :Started rmkit
    chain_failure                      :dbg_toast          :Error starting rmkit
And another nice NickelMenu item to check if rmkit is running, before we wear out the right margin trying to swipe the rmkit launcher into life:
Code:
menu_item :main    :rmkit status       :cmd_output         :500:ps | grep remux

Note 2 - rmkit install creates /opt folder as symbolic link to /mnt/onboard/.adds/rmkit, which interferes with other apps.
First, delete the /opt symbolic link to /mnt/onboard/.adds/rmkit:
(*Note WITHOUT the trailing slash, i.e. /opt NOT /opt/)
# rm /opt
Second, recreate /opt as a normal folder:
# mkdir /opt
Then recreate symbolic links for rmkit subfolders:
# ln -s /mnt/onboard/.adds/rmkit/bin/ /opt/bin
# ln -s /mnt/onboard/.adds/rmkit/data/ /opt/data
# ln -s /mnt/onboard/.adds/rmkit/etc/ /opt/etc
# cp /mnt/onboard/.adds/rmkit/enable_remux /opt/
Now, check everything is still there:
# ls /opt/
bin data enable_remux etc
# ls /opt/bin/
apps/ remux.sh

Last edited by elinkser; 02-22-2024 at 03:18 PM. Reason: Notes,title
elinkser is offline  
Old 09-22-2023, 04:11 PM   #2
Szybet
Connoisseur
Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.
 
Posts: 88
Karma: 3892
Join Date: Feb 2022
Device: Kobo nia
That's cool
I wonder if the "simple gui system" on rm will work on smaller screen at all, scalling is no joke

Also looking arround rm qt apps, i don't see any reason why they wouldn't run natively with the kobo platform plugin. If they are reasonably written, porting them to it should be easy.

I don't even see a list of those apps ( Qt ones ), just some old github repos? where is the list? remarkable wiki doesn't work at all

Last edited by Szybet; 09-22-2023 at 04:23 PM. Reason: clarification
Szybet is offline  
Advert
Old 09-22-2023, 08:22 PM   #3
elinkser
Groupie
elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.
 
Posts: 185
Karma: 146236
Join Date: Oct 2022
Device: Kobo Clara HD
I didn't notice much Qt.

https://toltec-dev.org/stable/

https://github.com/reHackable/awesome-reMarkable

https://yduf.github.io/remarkable-dev/


You may check the calculator app, but the build guide link seems to go nowhere, and I think your InkBox one is already better, anyway.
elinkser is offline  
Old 09-23-2023, 07:12 AM   #4
Szybet
Connoisseur
Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.Szybet can teach chickens to fly.
 
Posts: 88
Karma: 3892
Join Date: Feb 2022
Device: Kobo nia
Well that's dissapointing.
Szybet is offline  
Old 09-23-2023, 07:15 PM   #5
raisjn
Member
raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.
 
raisjn's Avatar
 
Posts: 23
Karma: 11102
Join Date: Jan 2022
Device: kobo libra h2o, kobo clara hd, kobo elipsa 2e
hi elinkser, i'm impressed you got it working - really nice work! i'd be glad to add your patches to support any other Kobo devices. i'm a bit confused, though, because i also have a Clara Kobo HD and i'm able to compile and run the rmkit apps on there - maybe it's different firmware? (or maybe its the ARCH vs TARGET issue?)

the one major app you are missing is remarkable_puzzles (https://github.com/mrichards42/remarkable_puzzles), which is a port of simon tatham's puzzles. let me know if you want me to send you a compiled version.

the docs are a bit out of date, because if you use `TARGET=kobo make <project>`, it will compile the font into the binary itself. i will update that now.

let me know if there's anything i can do to help. glad to see people are trying out rmkit
raisjn is offline  
Advert
Old 09-24-2023, 10:34 AM   #6
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,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
The kernel headers used by the "kobo" koxtoolchain target are *very* old (purposefully, they *need* to match the kernel used by the earliest supported device), so, yeah, it's missing a few <linux/input.h> stuff you'd think would have been there forever .

You can either ship an up-to-date header (like libevdev does), patch up the missing defines, or use the kobomk7 koxtoolchain target, which is built against a much less idiotic kernel, a slightly less idiotic glibc, and should still effectively work just fine on 100% of devices, assuming they're running FW >= 4.6. That's a trade we can't make for KOreader, because there's a surprising amount of people on old devices still running FW 3.x, but the target exists specifically to prevent technical debt like that for new stuff.

Last edited by NiLuJe; 09-24-2023 at 10:38 AM.
NiLuJe is offline  
Old 09-24-2023, 05:34 PM   #7
elinkser
Groupie
elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.
 
Posts: 185
Karma: 146236
Join Date: Oct 2022
Device: Kobo Clara HD
***

@NiLuJe:

That's great info. I will try that, but I may need a trip to the library to mooch off their broadband.

Unless there's a way to use my old "./gen-tc.sh kobo" build without having to download a lot more files???


***

@raisjn:

Thanks so much for this project!

I have only my little Clara HD, so I put the enjoyable challenge to any other interested Kobo owners to try rmkit and report back.

Maybe even Pocketbook owners???


There ARE a couple of items that come to mind...

1) Do you have any ideas as to what I'm doing wrong building drawing_demo (I get no output)?
UPDATE : "FIXED" - see below

$ source ~/koxtoolchain/refs/x-compile.sh kobo env bare

$ cd rmkit-build/

$ cd rmkit-master/

$ nano -l src/drawing_demo/main.cpy
Code:
 10     vfb = new framebuffer::FileFB("/mnt/onboard/.adds/koreader/note.raw", self.fb->display_width, self.fb->height)
 17     if input::is_touch_event(ev):
 18 //      return
 19         debug "on_mouse_move debug, ev=", ev.x              
... 
 23 //    if prevx != -1:
...
 29     debug "on_mouse_move debug, prevx=", ev.x
$ ARCH=kobo make drawing_demo

Copy drawing_demo from rmkit-master/src/build/ on my PC to /mnt/onboard/.adds/rmkit/bin/apps/ on my kobo.


When I run from SSH on PC:

# ps | grep remux
1514 root 0:00 sh /opt/bin/remux.sh
1516 root 0:00 /opt/bin/apps/remux
1648 root 0:00 grep remux

# kill -KILL 1514
# kill -KILL 1516

# sh /opt/bin/remux.sh

Then swipe up to start remux, and select the drawing_demo app:
DISPLAYED LAUNCHER FOR 2200 MS
LAUNCHING APP drawing_demo drawing_demo
POWER MANAGEMENT: 1
RESETTING MT GESTURES
CHECKING PROCESS drawing_demo 0
RENDERING drawing_demo
DECOMP TOOK 0.00358233
RUNNING ON CLARA HD
SETTING SCREEN DEPTH 32
W: 1072 H: 1448 S: 1088
XRES 1072 YRES 1448 BPP 32 GRAYSCALE 0
OPENING /dev/input/event0 AS BUTTONS
OPENING /dev/input/event1 AS TOUCH
ERROR OPENING INPUT DEVICE /dev/input/event2
ERROR OPENING INPUT DEVICE /dev/input/event3
ERROR OPENING INPUT DEVICE /dev/input/event4
on_mouse_move debug, ev= 262
on_mouse_move debug, prevx= 262
on_mouse_move debug, ev= 262
on_mouse_move debug, prevx= 262
on_mouse_move debug, ev= 262
on_mouse_move debug, ev= 263
on_mouse_move debug, prevx= 263


Copy /mnt/onboard/.adds/koreader/note.raw to my PC.

$ sudo apt install ufraw

$ ufraw note.raw

* The note.raw file is actually an empty file!

Any tips on how to debug or maybe switch to another way to work around this note.raw requirement to get drawing_demo to work?


2) Aside from the information in the docs/ folder, can you explain to us pleebs what a .cpy file is?

My attempt at using a ctags-like tagging system (https://www.gnu.org/software/global/ + pygments_parser) treated .cpp files like cpp programs and .py files like python programs, but .cpy files like COBOL programs!


Maybe an entry in your online guide?

reMarkable Guide
https://remarkable.guide/devel/langu...%2B/rmkit.html

okp - write c like python
https://oky.moe/okp/

raisjn/okp
https://github.com/raisjn/okp

rsperanza/CPY
https://github.com/vrsperanza/CPY



***

BROWSING SOURCE CODE IN A WEB BROWSER USING GLOBAL:


$ mkdir myglobal

$ cd myglobal/

GNU Global - a source code tagging system
https://www.gnu.org/software/global/
https://github.com/oracle/opengrok/w...-Similar-Tools
https://www.gnu.org/software/global/globaldoc_toc.html

$ wget https://ftp.gnu.org/pub/gnu/global/global-6.6.10.tar.gz

$ tar zxvf global-6.6.10.tar.gz

$ cd global-6.6.10/

$ ./configure --with-exuberant-ctags=/usr/bin/ctags

$ make

$ cp gtags.conf ~/.globalrc

$ cp gtags/gtags ~/.local/bin/

$ cp htags/htags ~/.local/bin/

$ cp global/global ~/.local/bin/

$ sudo mkdir /usr/local/share/gtags/

$ sudo cp htags/style.css /usr/local/share/gtags/

$ sudo mkdir /usr/local/lib/gtags

$ sudo cp plugin-factory/.libs/exuberant-ctags.so /usr/local/lib/gtags/

$ sudo cp plugin-factory/.libs/pygments-parser.so /usr/local/lib/gtags/

$ sudo mkdir /usr/local/share/gtags/script

$ sudo cp plugin-factory/pygments_parser.py /usr/local/share/gtags/script/

$ sudo chmod 755 /usr/local/share/gtags/script/pygments_parser.py

$ sudo apt install python-pygments

$ export GTAGSLABEL=pygments

$ cd ..

$ unzip rmkit-master.zip

$ cd rmkit-master/src/

$ gtags --explain

$ htags

$ elinks HTML/index.html


***

UPDATE : "FIX" FOR DRAWING_DEMO

$ source ~/koxtoolchain/refs/x-compile.sh kobo env bare

$ cd rmkit-build/

$ cd rmkit-master/

$ nano -l src/drawing_demo/main.cpy
Code:
  9   Note(int x, y, w, h): Widget(x, y, w, h):
 10     vfb = new framebuffer::FileFB("/mnt/onboard/.adds/rmkit/note.raw", self.fb->display_width, self.fb->height)
...
 17 //    if input::is_touch_event(ev):  
 18 //      return
...
 24       vfb->draw_line(prevx, prevy, ev.x, ev.y, 3, BLACK)
$ ARCH=kobo make drawing_demo

$ cd ..

$ mkdir stripped

$ cd stripped/

$ cp ../rmkit-master/src/build/drawing_demo .

$ arm-kobo-linux-gnueabihf-strip -s drawing_demo

$ file drawing_demo
stripped/drawing_demo: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.33, stripped

$ zip drawing_demo.zip drawing_demo
adding: drawing_demo (deflated 44%)

$ ls -l drawing_demo*
-rwxr-xr-x 1 739216 drawing_demo
-rw-r--r-- 1 412129 drawing_demo.zip


Copy drawing_demo from stripped/ on my PC to /mnt/onboard/.adds/rmkit/bin/apps/ on my kobo.


***

Last edited by elinkser; 09-29-2023 at 06:52 PM. Reason: "FIX" FOR DRAWING_DEMO
elinkser is offline  
Old 09-25-2023, 12:04 AM   #8
raisjn
Member
raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.
 
raisjn's Avatar
 
Posts: 23
Karma: 11102
Join Date: Jan 2022
Device: kobo libra h2o, kobo clara hd, kobo elipsa 2e
1) i don't know about drawing demo. but i did modify harmony to work with kobo (please try it out) - now touches should work in harmony (the drawing demo and harmony previously required stylus). also fixed the crash when pressing `new`, etc in harmony. i will come back to it to make the code cleaner later. harmony should be on the build server (it's built on every push to github)

2) https://github.com/raisjn/okp is a good pointer to what cpy is. cpy files are run through a pre-processor which generates .cpp and .h files. in your previous post, you modified some .h files and .cpy files. you only need to modify the .cpy files and the corresponding .h files are then generated.

2a) i put my ctags (might be universal-ctags, i don't remember) definitions into the okp repo, please try them out. i use it with vim to jump to definitions. i haven't tried global before, hopefully those definitions are useful.
raisjn is offline  
Old 09-25-2023, 12:26 PM   #9
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,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Quote:
Originally Posted by elinkser View Post
***
Unless there's a way to use my old "./gen-tc.sh kobo" build without having to download a lot more files???
If you've kept your ct-ng build directory, you'll only have to download the differences (which should be limited to glibc & linux).

That's assuming gen-tc isn't extra enthusiastic about running ct-ng clean, I don't recall; as I mostly run ct-ng manually anyway .
NiLuJe is offline  
Old 09-25-2023, 06:52 PM   #10
elinkser
Groupie
elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.
 
Posts: 185
Karma: 146236
Join Date: Oct 2022
Device: Kobo Clara HD
***

@NiLuJe:

Thanks for all the support.
Looking at the ~/koxtoolchain/refs/x-compile.sh, I can appreciate the behind-the-scenes torture that went into making the builds seem trivial!


***

@raisjn:

1)
So downloading the latest build of rmkit-dev/rmkit
https://github.com/rmkit-dev/rmkit,
and updating the edits (at least until I update my toolchain):

$ nano -l src/common.make
Code:
 2 TARGET?=kobo
 3 CXX_BIN?=arm-kobo-linux-gnueabihf-g++
 4 CC_BIN?=arm-kobo-linux-gnueabihf-gcc
 5 STRIP_BIN?=arm-kobo-linux-gnueabihf-strip
$ nano -l scripts/build/build_kobo_root.sh
Code:
25   arm-kobo-linux-gnueabihf-strip *
$ nano -l src/rmkit/input/events.cpy
Code:
241 //        case ABS_MT_SLOT:
242 //          slot = data.value;
243 //          break
...
282 //        case ABS_MT_DISTANCE:
283 //          slots[slot].distance = self.distance = data.value
284 //          if self.distance > 0:
285 //            self.left = 0
286 //          break
$ nano -l src/rmkit/input/input.cpy
Code:
 69 //          if ev_data[i].code == SYN_DROPPED:
 70 //            syn_dropped = true
 71 //            event.handle_drop(fd)
 72 //            continue
$ nano -l src/remux/launcher.cpy
Code:
31 #define TOUCH_FLOOD_EVENT ABS_DISTANCE



***UPDATE***
NEED TO CORRECT FILE PATH AND FILENAME FOR EXPORTS TO WORK PROPERLY. NEW HARMONY BINARY(ZIPPED) IS UPLOADED.
***


$ nano -l src/rmkit/defines.h
Code:
 17 #define SAVE_DIR "/opt/data/harmony"

$ nano -l src/rmkit/fb/fb.cpy
Code:
421       strftime(buffer,sizeof(buffer),"%Y-%m-%d%H_%M_%S",timeinfo);
***

$ ARCH=kobo make input_demo

$ ARCH=kobo make simple

$ ARCH=kobo make harmony


Harmony works!
(And it's a beauty.) :
https://rmkit.dev/apps/harmony



2)
Using your .ctags file (which was actually even included in rmkit):

$ cd myglobal/

$ cd rmkit-master/src/

$ cp .ctags ~

$ nano -l ~/.globalrc
Code:
114         :langmap=Okp\:.cpy.okp:\
...
155         :gtags_parser=Okp\:$ctagslib:\
$ export GTAGSLABEL=ctags

$ gtags --explain

$ htags

$ elinks HTML/index.html


And we're browsing the .cpy files!

Well that was fun.


***

Last edited by elinkser; 02-22-2024 at 03:19 PM. Reason: CORRECT FILE PATH AND FILENAME FOR EXPORTS
elinkser is offline  
Old 09-25-2023, 09:39 PM   #11
raisjn
Member
raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.raisjn can tame squirrels without the assistance of a chair or a whip.
 
raisjn's Avatar
 
Posts: 23
Karma: 11102
Join Date: Jan 2022
Device: kobo libra h2o, kobo clara hd, kobo elipsa 2e
great, glad you got it working! i have a bit more code to write and test to improve harmony for touch usage, but i think it should work at the basics now.

few more notes:

1. stb.arm.o is only used at compile / link time, it doesn't need to be added to device
2. let us know if there's any apps you are interested in / want built. simple apps should work on device, but they sometimes may need their scaling modified (it really depends on who wrote the original app)
3. descriptions of each app should be available in the rmkit-dev/rmkit README.md (either at the top level or in the app directory)
raisjn is offline  
Old 09-26-2023, 04:23 PM   #12
elinkser
Groupie
elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.
 
Posts: 185
Karma: 146236
Join Date: Oct 2022
Device: Kobo Clara HD
1)
Heheh, now what kind of dumdum would mistake object files for shared object files?
Now please excuse me while I, errr, tidy up some, err, fonts...

2)
I am actually so happy to have rmkit and harmony already.
-The history lets me undo my last stroke.
-The layers let me import a photo of a nature scene or one-page document, draw on top of it, and save just the layer I drew.
See end of https://www.mobileread.com/forums/sh...62&postcount=8
*I did have to mod the source to get the file export working. SEE UPDATE:
https://www.mobileread.com/forums/sh...7&postcount=10


But if you are letting me dream, someone did ask about an open source note-taking app.
https://www.mobileread.com/forums/sh...d.php?t=355579

Maybe something like Xournal:
https://xournal.sourceforge.net/

Your Harmony is so far advanced already - maybe add pdf import, multiple-page document handling, and onscreen keyboard input?
Okay that actually sounds like a lot of work!

(If the shy people who read this developer forum ever get around to reporting their device results, then I guess the announcement could be posted on the main Kobo forum, for even more feedback (and support requests!)

Last edited by elinkser; 10-02-2023 at 07:53 PM. Reason: link to netpbm image converter
elinkser is offline  
Old 09-27-2023, 06:38 AM   #13
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,164
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Not impressed with Xournal compared to Sage/Elipsa advanced notebook. Little more than an organised sketch app, like Kobo basic notebooks or reMarkable.
Tried on Lenovo X201 which has Wacom screen.
Quoth is offline  
Old 09-27-2023, 09:22 AM   #14
elinkser
Groupie
elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.elinkser has survived committing the World's Second Greatest Blunder.
 
Posts: 185
Karma: 146236
Join Date: Oct 2022
Device: Kobo Clara HD
Yes, you explained it here:
https://www.mobileread.com/forums/sh...d.php?t=355579

But this is open source, so I imagine if Xournal collects the strokes, some other layer could do the conversion to characters?

Also Quoth, would you be interested in trying rmkit on your Ellipsa/Sage?
Instructions in top post!
elinkser is offline  
Old 09-27-2023, 12:56 PM   #15
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,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Currently wouldn't work on a Sage/Elipsa, that's another SoC & display driver entirely.
NiLuJe is offline  
Closed Thread


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
rmkit comes to kobo! raisjn Kobo Developer's Corner 25 04-21-2024 10:23 PM
Native FBInk: Another small tool to print crap on your screen! NiLuJe Kindle Developer's Corner 282 12-05-2022 03:04 PM
fbink image scaling question handyguy Kindle Developer's Corner 6 12-17-2020 07:01 PM
Latest fbink install? handyguy Kindle Developer's Corner 3 12-11-2020 09:13 PM
Pre-Purchase Questions ... Clara/Libra/Forma Catsnkites Kobo Reader 9 10-27-2019 11:28 AM


All times are GMT -4. The time now is 09:45 AM.


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