View Single Post
Old 07-18-2023, 06:25 PM   #4
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
Fbpad

Fbpad and Inkvt

There was a framebuffer-based terminal emulator that runs on the Clara HD (you have to compile it), which you can control from your phone or PC keyboard:
https://www.mobileread.com/forums/sh...d.php?t=298877


These are the build directions if you have a couple of hours to kill (binary attached for your convenience.)


***

On a debian PC:

koreader/koxtoolchain
https://github.com/koreader/koxtoolchain

$ git clone https://github.com/koreader/koxtoolchain.git

$ cd koxtoolchain/

$ sudo apt-get install build-essential autoconf automake bison flex gawk libtool libtool-bin libncurses-dev curl file git gperf help2man texinfo unzip wget

$ ./gen-tc.sh kobo


(2 hours build time on an Acer Chromebook 11 converted to an MX Linux workstation)


$ cd ..


***


$ mkdir fbpad-build

$ cd fbpad-build/


JulianDroske/fbpads
https://github.com/JulianDroske/fbpads
forked from aligrudi/fbpad

$ wget https://github.com/JulianDroske/fbpa...ads/master.zip

$ unzip fbpads-master.zip

$ cd fbpads-master/

$ make

$ cd fbpad_mkfn/

$ make

$ nano -l gen.sh
5 OP="-h34 -w19"
6 SZ="18h135v135"
7 # OP="-h26 -w14"
8 # SZ="18h100v100"

$ ./gen.sh

$ cd ..

$ cd ..



***


NiLuJe/FBInk

https://github.com/NiLuJe/FBInk/releases

$ wget https://github.com/NiLuJe/FBInk/rele...v1.25.0.tar.xz

$ tar xJf FBInk-v1.25.0.tar.xz

$ cd FBInk-v1.25.0/

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

$ make static stripped

$ cd ..


ddvk / fbpad-eink
forked from kisonecat/fbpad-eink
https://github.com/ddvk/fbpad-eink

$ wget https://github.com/ddvk/fbpad-eink/a...ads/master.zip

$ unzip fbpad-eink-master.zip

$ cd fbpad-eink-master/

$ cp -r ../FBInk-v1.25.0/Release FBInk/

$ cp ../FBInk-v1.25.0/fbink.h FBInk/

$ cp ../fbpads-master/fbpad_mkfn/ar.tf fonts/
$ cp ../fbpads-master/fbpad_mkfn/ai.tf fonts/
$ cp ../fbpads-master/fbpad_mkfn/ab.tf fonts/

$ nano -l conf.h
17 typedef int fbval_t;
...
20 #define FR "ab.tf"
21 #define FI "ab.tf"
22 #define FB "ab.tf"

$ nano -l Makefile
3 CC := arm-kobo-linux-gnueabihf-gcc
...
10 xxd -i fonts/ab.tf > font.h

$ nano -l font.c
40 memcpy(&head, fonts_ab_tf, sizeof(head));
...
46 font->glyphs = (int*)(fonts_ab_tf + sizeof(head));
47 font->data =(char*) (fonts_ab_tf + sizeof(head) + font->n * sizeof(int));

$ xxd -i fonts/ab.tf > font.h

$ make

$ file fbpad
fbpad: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.33, with debug_info, not stripped

$ cd ..


***

Copy the fbpad binary to the /mnt/onboard/.adds/koreader/scripts/ directory on your Kobo.

On a ssh session to your Kobo (from phone or PC):
$ ssh root@192.168.2.2 -p 2222

# . /korenv.sh

# fbpad /bin/sh

# pwd

Works in landscape too.
(Try elinks if you have good eyesight.)UPDATE- Fixed font size - now very readable.
Hit the lower right corner of the screen and the nickel menu comes up.

Ctl-Alt-q to quit

If that doesn't work, try "pkill fbpad".

***

How about let's change the default elinks keybindings to allow normal use of arrow keys:

The hard way (see below for the easier way):
In elinks, press 'k' to bring up Keybinding manager.
Press Space to expand [+]- Main mapping.
Use Right arrow to move focus to Delete tab.
Use Down arrow to scroll to and delete the following:
[-]- Move to the next frame: Tab
[-]- Move to the previous frame: Shift-Tab
[-]- Return to the previous document in history: Left
[-]- Go forward in history: u
[-]- Follow the current link: Right
[-]- Follow the current link, forcing reload...: Ctrl-Right
[-]- Open a lua Console: ,
[-]- Move to the next link: Down
[-]- Move to the previous link: Up
[-]- Move downwards by a page: Ctrl-F
[-]- Move upwards by a page: Ctrl-B
[-]- Search link text by typing ahead: #
[-]- Toggle displaying of links numbers: .
Use Right arrow to move focus to Save tab.
Save and Close.

Press 'k' to bring up Keybinding manager again.
Press Space to expand [+]- Main mapping, or Up arrow to scroll to the top if already expanded.
Use Left/Right arrow to focus on Add tab.
Use Down arrow to scroll to and add the following:
[-]- Move to the next frame: Ctrl-f
[-]- Move to the previous frame: Ctrl-b
[-]- Return to the previous document in history: ,
[-]- Go forward in history: .
[-]- Show information about current link: u
[-]- Open a lua Console: Alt-l
[-]- Move cursor down: Down
[-]- Move cursor left: Left
[-]- Move cursor right: Right
[-]- Move cursor up: Up
[-]- Move to the next link: Tab
[-]- Move to the previous link: Shift-Tab
[-]- Toggle displaying of links numbers: #
Use Right arrow to move focus to Save tab.
Save and Close.

The easier way:
Or you could just append to the end of the config file:
$ vi .elinks/elinks.conf
Code:
##################################
# Automatically saved keybindings
#

bind "main" "Ctrl-F" = "frame-next"
bind "main" "Ctrl-B" = "frame-prev"
bind "main" "," = "history-move-back"
bind "main" "." = "history-move-forward"
bind "main" "u" = "link-info"
bind "main" "Alt-l" = "lua-console"
bind "main" "Down" = "move-cursor-down"
bind "main" "Left" = "move-cursor-left"
bind "main" "Right" = "move-cursor-right"
bind "main" "Up" = "move-cursor-up"
bind "main" "Tab" = "move-link-next"
bind "main" "Shift-Tab" = "move-link-prev"
bind "main" "#" = "toggle-numbered-links"
bind "main" "Ctrl-Right" = "none"

So the new way of navigating in elinks would be:

On startup, enter '.' to see current working directory, or enter a web address.
Tab and Shift-Tab to traverse the links.
Enter to follow link or '.' and ',' to go forward and back.
Space and 'b' to page forward and back.
'[' and ']' to go left and right.
Enter to edit a text field, 'd' to download link.
'a' to add a bookmark, 's' to see them, TAB to move through options.
ESC followed by Down arrow and Left/Right arrows to see menus.
'g' to enter a new address, 'q' to quit.

Main difference being now able to move around the page with arrows keys.
Old Down/Up link travelling replaced by Tab/Shift-Tab, and old Left/Right history traversing replaced by ','/'.'.

***

Also get rid of the colors in the ls command by appending this to the /korenv.sh file:

# vi /korenv.sh
Code:
#!/bin/sh

export PATH=$PATH:/mnt/onboard/.adds/koreader/scripts:/mnt/onboard/.adds/koreader/plugins/terminal.k
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/onboard/.adds/koreader/libs
export TERM=xterm
export HOME=/mnt/onboard/.adds/koreader/
cd $HOME

alias ls='ls --color=never'
Now if you run ". /korenv.sh", then "ls" it is in mono.
But it seems you have to run it again after running fbpad.

***

To get rid of the colors in the w3m browser:

In w3m, normally press 'o' to bring up the Option Setting Panel.
Scroll down to the second group, Color Settings.
Put the cursor on the first entry: Display with color.
Tab to the ()NO option and press enter.
Scroll to the end of the section, tab to the [OK], and press enter.

Or just edit the config file:
$ nano -l .w3m/config
38 color 0

But w3m doesn't handle very well fbpad with large font/low number of columns.
Or at all, as you can see with the small-font "fbpads" that I reuploaded.
Note: the "fbpads" I uploaded means "fbpad with Small font", not because it is the above JulianDroske/fbpads that I exploited earlier in the post for its font setup.
Sorry for any confusion.

***


Networking note:
In Quitting Telnet Habit , I said that I wanted to quit telnet and turn off devmode ( Go to the Discover tab and search the store for "devmodeoff"). meaning I lost the "ForceWifiOn=true" option in [DeveloperSettings] in the /mnt/onboard/.kobo/Kobo/Kobo eReader.conf file.
Unfortunately I now find the WiFi connection cutting out.
Others have said leaving the Wifi applet dialog open helps, so I am trying that.

***

* UPDATE: You do NOT need DEVMODEON to set the "ForceWifiOn=true" option in [DeveloperSettings] in the /mnt/onboard/.kobo/Kobo/Kobo eReader.conf file.
I tested it that WiFi shuts off automatically after 1-2 minutes of inactivity, but will stay on if "ForceWifiOn=true" in [DeveloperSettings] in the /mnt/onboard/.kobo/Kobo/Kobo eReader.conf file, EVEN IF DEVMODEOFF.

Also, interestingly, "EnableDebugServices=false" stopped telnet and logread from running automatically even if DEVMODEOFF.
Unfortunately, that option stopped my oskansi fbpad terminal from working.
I will need to investigate that..,

***
Here's one with keyboard:


NiLuJe/inkvt
forked from llandsmeer/inkvt
https://github.com/NiLuJe/inkvt


$ mkdir inkpad-build

$ cd inkpad-build/

$ wget http://http.us.debian.org/debian/poo....1.1-1_all.deb
$ sudo dpkg -i libcxxopts-dev_3.1.1-1_all.deb
OR
$ sudo apt install libcxxopts-dev

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

$ cp ../fbpad-build/FBInk-v1.25.0.tar.xz .

$ tar xJf FBInk-v1.25.0.tar.xz

$ wget https://github.com/NiLuJe/inkvt/arch...ads/master.zip

$ unzip master.zip

$ mv master.zip inkvt-master.zip

$ cd inkvt-master/

$ mv ../FBInk-v1.25.0/* FBInk/

$ mkdir cxxopts/include

$ cp /usr/include/cxxopts.hpp cxxopts/include/

$ make release

Extract InkVT-.zip to Kobo.

InkVT erminal comes up, elinks working great, until screen froze.
Update: Crashed my device, and somehow an update was triggered even though SideloadedMode=true.
Note developer's warning on inkVT github page:
Warning: this project is very experimental! It might brick your device. Only install this if you know what you are doing.

Happy with just fbpad for now.
Attached Files
File Type: bin fbpad.bin (1,000.0 KB, 72 views)
File Type: bin fbpads.bin (168.3 KB, 77 views)

Last edited by elinkser; 11-30-2023 at 05:20 PM. Reason: UPDATE- Fixed font size - fbpad big font, fbpads small, inkvt
elinkser is offline   Reply With Quote