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 12-24-2022, 09:43 PM   #46
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
Works on Clara HD

***
These instructions worked great for the most part for my Kobo Clara HD with alpine-minirootfs-3.17.0-armv7.
***


I found I needed the following two changes.


1.FBINK-XDAMAGE NOT COMPILING:

I used instead:
git clone --recurse-submodules https://github.com/tux-linux/fbink-xdamage.git


2.ONBOARD KEYBOARD NOT DISPLAYING AT STARTUP (not consistently):
* Edit: this was resolved in post #54.
https://www.mobileread.com/forums/sh...5&postcount=54

I used svkbd-mobile-intl:
apk add svkbd


***


I did make some other changes for various reasons.


1.APPS TOO CLUNKY OR OTHER:

I substituted qterminal, qpdfview, netsurf, and tigervnc/tigervnc-client for xterm, firefox, and xvnc.
I also used a 1GB image size (dd if=/dev/zero of=/mnt/onboard/alpine.img bs=1M count=1024) which only left me with a couple of hundred MB free space.
But after compiling the fbink_xdamage binary, I saved it and the Release folder with the fbink libs.
You can delete the dev packages, firefox etc., so it fits nicely in a 1GB alpine.img file - easy to back up in case you bork it.
But see step 12 below for an even more compact and flexible backup!

2.TO NOT RELY ON DRAG AND DROP OR WINDOW RESIZING:

To get the desired placement of a keyboard in the lower third of the screen, terminal in the upper two thirds of a screen, and browser covering the whole screen, the last lines of my xorg-chroot.sh looked like this:
#DISPLAY=:0 xterm -e "/home/root/dpi.sh;sh"
DISPLAY=:0 qterminal --geometry 1400x620+20+60 &
DISPLAY=:0 netsurf --scale 150 &
#DISPLAY=:0 vncviewer -geometry 1400x960+20+60 192.168.43.9 &
DISPLAY=:0 svkbd-mobile-intl -g 1400x320+20+700 &
#DISPLAY=:0 dillo -g 1400x960+20+60 &


3.NETSURF BROWSER ELEMENTS TOO TINY:

Added file .config/netsurf/Choices:
font_size:192
accept_language:en
block_advertisements:1
send_referer:0
animate_images:0
enable_javascript:0
url_suggestion:0
window_x:20
window_y:60
window_width:1400
window_height:960
toolbar_status_size:6673
button_type:3
disable_popups:1
toolbar_items:back/history/forward/reloadstop/url_bar/copy/paste/showbookmarks/downloads/zoomplus/zoomminus/openmenu
bar_show:menu/tool

Added file .config/gtk-3.0/gtk.css:
scrollbar slider {min-width: 30px;}
default-decoration {min-height: 40px;}
default-decoration.titlebutton {min-height: 36px;}


*I couldn't figure out how to make the menu elements bigger. A workaround is to install netsurf on your desktop and familiarize yourself with the menu elements, so you can more easily recognize them on your kobo.
*** UPDATE: This is resolved in comment #51


4.TASKBAR TOO TINY:
You really need to be able to click on the taskbar to select keyboard for input, or change apps.
I modified the following line in .config/tint2/tint2rc:

# Panel
panel_items = SLCT
panel_size = 100% 60
panel_position = top center horizontal

5.MY PREFERRED FILEMANAGER MC WORKS BETTER IN BASH SHELL:
I installed bash and mc, and changed the symbolic link /bin/sh to link to /bin/bash.
Note:if using mc remotely from your desktop by telnet, you have to "export TERM=xterm" to run mc.
I added these lines to .bashrc to keep command-line history from getting cluttered by mc:

HISTCONTROL=ignoreboth
shopt -s histappend

While in X, you may prefer a GUI filemanager like pcmanfm.


6.FOR RUNNING ALPINE CHROOT FROM A KOREADER TERMINAL (WITHOUT X):
I added /mnt/onboard/.adds/koreader/scripts/chalpine.sh:

#!/bin/sh
mount /mnt/onboard/alpine.img /mnt/user
#mount -v --bind /mnt/onboard/shared /mnt/user/shared
mount -v --bind /dev /mnt/user/dev
mount -vt proc proc /mnt/user/proc
mount -vt sysfs sysfs /mnt/user/sys
cp /etc/resolv.conf /mnt/user/etc
chroot /mnt/user/ /bin/sh

So from the KOReader terminal I just run "chalpine.sh" to get into the alpine chroot without X, where I can still run elinks, etc.
I also added /mnt/onboard/.adds/koreader/scripts/chalpined.sh:

#!/bin/sh
umount /mnt/user/dev
umount /mnt/user/proc
umount /mnt/user/sys
#umount /mnt/user/shared
umount /mnt/user

So to get out, I can run
sync
poweroff
OR
sync
exit
chalpined.sh

Optionally, create directories for sharing data from in (/mnt/user/shared) and out (mnt/onboard/shared) of chroot by creating those directories and ucommenting above lines.
Also add to your xorg-boot.sh the same line i.e.:
mount -v --bind /mnt/onboard/shared /mnt/user/shared

*SECURITY NOTE*
First thing in the chroot, you should create a non-root user and give it a .config folder:

adduser myuser
cp -r /home/root/.config /home/myuser/
chown -R myuser:myuser /home/myuser/.config

Then install and configure sudo for the non-root user:
apk add sudo
Run "visudo" to edit /etc/sudoers to append these lines (don't worry if visudo says you're saving to sudoers.tmp - visudo is just doing a preliminary check before writing - you can check the edit was made by running "less /etc/sudoers") :
myuser ALL=NOPASSWD: /bin/sync #ok maybe didn't need this one
myuser ALL=NOPASSWD: /sbin/poweroff

So, when running a chroot in the KOReader terminal:
Each time you enter the chroot you switch to non-root by "su - myuser" or "/bin/login".
To become root again, you exit once, and to leave the chroot, you sync then exit a second time.
(You can check you are no longer in the chroot by running "df".)
Then unmount the chroot as before by running chalpined.sh.

And when running a chroot from X as in STEP 13 below:
You can
sync
sudo poweroff
right from the user account.

Don't get complacent about the "sync", like I did and ended up with an unreadable but undeletable file.



***
CAUTION: You know how Nickel does all that background work when you connect USB cable to desktop, click "connect", then later unmount?

Well, there may be a risk of data corruption if you had a loop mounted file, e.g. Alpine chroot.
https://www.mobileread.com/forums/sh...38&postcount=2

So better don't try this. But if you DO connect a USB cable, either exit the chroot and unmount the loop first, OR click "cancel" and use SSH/Telnet networking instead. (I have done this for months.)
***



7.FOR RUNNING ALPINE CHROOT FROM NICKEL MENU (WITH X):
First I turn on networking.
Then I set the orientation to landscape.
Then I run Xorg.
The nickel menu entries look like this (note:moved xorg-boot.sh into mnt/onboard/opt/):

menu_item :main :Xorg :cmd_spawn :quiet:exec /mnt/onboard/opt/xorg-boot.sh
chain_success :dbg_toast :Started Xorg
chain_failure :dbg_toast :Error

# Nickel_Orientation Actions
menu_item : main : Orientation - LANDSCAPE - handle above : nickel_orientation: landscape
menu_item : main : Orientation - LANDSCAPE - handle below : nickel_orientation: inverted_landscape
menu_item : main : Orientation - PORTRAIT - handle on left : nickel_orientation: inverted_portrait
menu_item : main : Orientation - PORTRAIT - handle on right : nickel_orientation: portrait
#

To leave the Xorg environment, I enter
sync
poweroff
from the qterminal.


8.FOR RUNNING EINK BROWSER ON MY KOBO REMOTELY FROM MY TABLET:
Install droidvnc_ng and einkbro on your android tablet and run them in landscape mode.
Run "vncviewer -geometry 1400x960+20+60 192.168.43.9 &" (or whatever the droidvnc address is) in a qterminal.
A tiny little window will pop up - it is for your vnc password. Just enter it and you will have a nice full screen eink browser screen, with input touch enabled on your Kobo!
(You may have to stop and restart the droidvnc for adjusting the slider to the right size setting.)
Eink browser toolbar setting can be set to include pageup and pagedown buttons.


HOWEVER...Consider the security implications of accessing a secure device (phone that you do banking/email on) from an insecure device i.e. ereader.


9.FOR RIGHT CLICK AND DRAG AND DROP:
Enter the following time delayed commands in a qterminal, then move the pointer to the right place:

xdotool sleep 2 mousemove_relative -- -60 0 click 3
(you have 2 seconds to touch up to 60 pixels to the left of where you want the right click.
The mousemove_relative -- -60 0 is to avoid the left click when you position the pointer on a link.)
xdotool sleep 2 mousedown 1 sleep 4 mouseup 1
(you have 2 seconds to touch where you want to start a drag, then 4 seconds to touch where you want to end it)
*Python programmers are welcome to add functionality to the main driver!


In the meantime, you can activate these by clicking on a taskbar icon by adding to the Launcher section of the .config/tint2/tint2rc file from above:
#-------------------------------------
# Launcher
launcher_item_app = onboard.desktop
launcher_item_app = svkbd.desktop
launcher_item_app = qterminal.desktop
launcher_item_app = netsurf.desktop
launcher_item_app = vncviewer.desktop
launcher_item_app = xdodd.desktop
launcher_item_app = xdorc.desktop

Then copy usr/share/applications/xvkbd.desktop to usr/share/applications/xdorc.desktop but edit it to: "Exec=xdotool sleep 2 mousemove_relative ---60 0 click 3"
Or to whatever the offset you want for right clicks.
And copy usr/share/applications/xvkbd.desktop to usr/share/applications/xdodd.desktop but edit it to: "Exec=xdotool sleep 2 mousedown 1 sleep 4 mouseup 1"
(Assuming you had the xvkbd apk installed - otherwise copy from the qterminal.desktop.)
Similarly create or edit the other .desktop files in /usr/share/applications/ folder.

*UPDATE: Comment #51 offers an alternative right click method, and also PgUp/PgDn using 2-finger swipes, but it only works with libinput driver as in comment #48. I have an evdev tool that is not working yet.


10.FOR NETWORKING (E.G. TELNET) OVER USB CABLE INSTEAD OF WIFI:

***SECURITY REMINDER***
Telnet sessions are in cleartext INCLUDING LOGIN SESSIONS, so only use on a private network, if at all!
If you always have DEVMODE set to ON for whatever reasons , that means Telnet is on by default, unless you toggle it off , e.g. using NickelMenu.


You can install KOReader to get the more secure SSH option, and NiLuJe's kobostuff provides a package that includes an SSH binary.

You can start the KOReader SSH server via NickelMenu.

**********************************


See instructions at https://www.yingtongli.me/blog/2018/...elnet-usb.html
Instead of automatically enabling it, I created a nickel menu item:

menu_item :main :USB Networking on :cmd_spawn :quiet:exec /mnt/onboard/opt/usbtoeth
chain_success :dbg_toast :Started USB networking
chain_failure :dbg_toast :Error
menu_item :main :USB Networking off :cmd_spawn :quiet:exec /mnt/onboard/opt/usbtoethd
chain_success :dbg_toast :Stopped USB networking
chain_failure :dbg_toast :Error

So to connect the Kobo with my desktop over the USB cable:
1.On Kobo, select"USB Networking on" from the nickel menu.
2.Connect the USB cable between Kobo and Desktop.
3.The network applet icon on the desktop (/usr/bin/nm-applet from the network-manager-gnome package) will be a spinning progress bar, like it's trying to connect on ethernet. Click this icon and choose "disconnect".
4.On desktop terminal enter "sudo ifconfig usb0 192.168.2.1" and you will be connected.


11.FOR CLOCK AND POWER DISPLAY:
apk add tzdata
apk add xmessage
Modify the following lines in .config/tint2/tint2rc:
#-------------------------------------
# Clock
time1_format = %H:%M
#time2_format = %A %d %B
time1_timezone = EST
time1_font = NotoSans Bold 32
clock_lclick_command = xmessage -geometry 400x100+500+70 -fn -*-fixed-*-*-*-*-32-*-*-*-*-*-iso8859-* Charge Level : `cat /sys/class/power_supply/mc13892_bat/capacity`

Now you can click on the clock to get remaining battery percentage.
For timezone, use the appropriate timezone from /usr/share/zoneinfo/.
You may also have to ln -sf /usr/share/zoneinfo/EST /etc/localtime, where again, replace EST by your actual timezone.


12.MAKE A COMPACT RESIZEABLE BACKUP:
First back up the old alpine.img to your desktop.
Now run the following commands on your Kobo:
cd /mnt/onboard
mount /mnt/onboard/alpine.img /mnt/user/
df -h ; # I got 959.9M total, 446.5M used, 462.2M available on /mnt/user
cd /mnt/user
tar zcvf /mnt/onboard/alpine.tgz . ; # took 8 minutes
cd /mnt/onboard
umount /mnt/user
ls -l alpine.tgz ; # to see your newly created backup file, only 154MB
*** NEXT TWO COMMANDS OVERWRITE YOUR alpine.img file
dd if=/dev/zero of=/mnt/onboard/alpine.img bs=1M count=2048; # OPTIONAL make 2GB image
mke2fs -F /mnt/onboard/alpine.img
***
mount /mnt/onboard/alpine.img /mnt/user/
cd /mnt/user
tar zxvf /mnt/onboard/alpine.tgz . ; # took 2 minutes
df -h ; # I got 2.0G total, 446.5M used, 1.4G available on /mnt/user
cd /mnt/onboard
umount /mnt/user
Now fire up xorg from the Kobo device.
Then from the still connected desktop:
chroot /mnt/user /bin/sh
apk search -vv -d browser
apk -s add qutebrowser ; # would require 68 packages. let's try it
apk add qutebrowser
df -h ; # I got 2.0G total, 831.1M used, 1.1G available on /mnt/user, so that needed 400M!
qutebrowser --qt-flag no-sandbox ; # Got 2 blank tabs
apk del qutebrowser
df -h ; # I got 2.0G total, 447.0M used, 1.4G available on /mnt/user
apk -s add falkon ; # would require 112 packages. let's try it
apk add falkon
df -h ; # I got 2.0G total, 737.9M used, 1.1G available on /mnt/user, only 300M
export QTWEBENGINE_DISABLE_SANDBOX=1
falkon ; # I got window with address bar, tried to enter something and it crashed
apk del falkon
df -h ; # I got 2.0G total, 448.6M used, 1.4G available on /mnt/user


13.IMPROVE SECURITY BY RUNNING X APPS AS A NON-ROOT USER:
First make sure you have followed the instructions in STEP 6 above for creating a non-root user (e.g. "myuser").

Create a nickel menu item as you did in STEP 7 , except for a non-root user:
menu_item :main :User Xorg :cmd_spawn :quiet:exec /mnt/onboard/opt/uxorg-boot.sh
chain_success :dbg_toast :Started Xorg as non-root user
chain_failure :dbg_toast :Error

Copy /mnt/onboard/opt/xorg-boot.sh to /mnt/onboard/opt/uxorg-boot.sh and edit the last line to:
chroot /mnt/user /bin/sh /uxorg-chroot.sh

In the chroot, copy /xorg-chroot.sh to /uxorg-chroot.sh and replace all lines following the "echo 20..." line with:
DISPLAY=:0 sudo -u myuser openbox &
DISPLAY=:0 sudo -u myuser tint2 &
DISPLAY=:0 sudo -u myuser qterminal --geometry 1400x620+20+60 &
DISPLAY=:0 sudo -u myuser svkbd-mobile-intl -g 1400x320+20+700 &
DISPLAY=:0 sudo -u myuser netsurf --scale 150 &

You can
sync
sudo poweroff
right from the user account.

Note:Tried to install firewall "apk add ufw", but running it failed due to missing kernel module "filter" .
ufw status verbose
#Gives error: "can't initialize iptables table `filter': Table does not exist (do you need to insmod?)"
cat /proc/config.gz | gunzip | grep NETFILTER
#Gives "CONFIG_NETFILTER is not set"

Oh well, you were not planning on using the Kobo to store your bitcoins anyway, I hope.


14. USB KEYBOARD SUPPORT:


*** UPDATE - YOU CAN POSSIBLY AVOID EXTRA CONFIGURATION OF USB KEYBOARD BY USING LIBINPUT DRIVER - SEE COMMENT #48 , (2nd COMMENT AFTER THIS ONE) ***



Enable USB host support as described here.


Create a /etc/X11/xorg.conf file as follows:


Section "ServerLayout"
Identifier "Layout"
InputDevice "USB Keyboard"
InputDevice "USB Mouse"
InputDevice "Touchscreen"
EndSection

Section "ServerFlags"
Option "AutoAddDevices" "off"
EndSection

Section "InputDevice"
Identifier "USB Keyboard"
Driver "evdev"
Option "Device" "/dev/input/event2"
EndSection

Section "InputDevice"
Identifier "USB Mouse"
Driver "evdev"
Option "Device" "/dev/input/event3"
EndSection

Section "InputDevice"
Identifier "Touchscreen"
Driver "evdev"
Option "Device" "/dev/input/event1"
EndSection


*Need to also install evdev driver:
apk install xf86-input-evdev


*The first two "InputDevice" sections depend on your particular device.
(You can check with e.g. "cat /proc/bus/input/devices" and "evtest /dev/input/eventX")
The third section is supposed to be for the touchscreen but doesn't seem to affect much.
You have to plug in your device before you run X.


Current status:

Keyboard works mostly, but some keys like arrows don't seem to be recognized.
Edit:Tried a different keyboard and arrow keys work.
Even the original keyboard can be made to work temporarily with the following cludge until the correct non-cludgy solution is done, by installing xmodmap, and then subbing keys:
xmodmap -e "keysym grave = Left Left"
xmodmap -e "keycode 119 = Up Up"
You would use different keys, but you will probably find, like I did, how buggy this hack is.
*Edit: Don't use xmodmap -use xkbcomp(or something less deprecated) as described in comment after this one!


Mouse works but cursor not visible over the app widget windows.
Edit:Tried a different app - featherpad - and the cursor is visible!.
So depends on the toolkit and widget type used in the app I guess.
There are some ghosting /refresh issues, so I will see how it works out with heavier use.
Actually the ghosting is when the entire screen changes, such as if you scroll when the page is full of text.
It would be a pain to have to refresh by minimizing/maximizing by clicking on the taskbar icon every time you scroll the editor by one line.
A workaround is to scroll several lines at a time,e.g. pagedown, then just move the cursor while the page doesn't change - no ghosting!


*Even featherpad has a "dark mode" for less ghosting!
Options->Preferences->Text->Dark cOlor scheme

* Also you can set a keybinding in the openbox window manager to refresh screen:
Create user openbox directory and copy config files to it:
cd /home/root/
mkdir .config/openbox
cp /etc/xdg/openbox/*.xml .config/openbox/

Edit the rc.xml file to add key binding for rollup toggle:
nano .config/openbox/rc.xml

Modify the first lines of the "<keyboard>" section to:
<keyboard>

<keybind key="C-S-g">
<action name="ToggleShowDesktop"/>
</keybind>

(Poweroff and restart.)

Now entering "Ctl=Shift-G" twice will toggle the desktop, refreshing the editor window!
(*removed Ctl-U binding as it interferes with nano editor.)



Other options are to use nano (but they are using Ctl-U so maybe another key needed), or the white-on-black midnight commander by invoking it as "mc --nocolor" or "mc -b", "mc -bv" (equivalent of mcview file viewer), or "mc -be" (equivalent of mcedit file editor).
Note that mc responds to fullscreen touch, and from the keyboard you can sub "esc-3" for F3 (and "esc-0" for F10 exit), enter directories with "F3", pageup/pagedown with "alt-v/ctl-v" (as opposed to "ctl-y/ctl-v" in nano or "b/space" in mcview or elinks), selecting multiple files with "ctl-t", etc.
You can even highlight with the xdodd hack from section 9 above.
Also less obvious ghosting.





***SUMMARY***
XORG IS WORKING GREAT ON THE KOBO CLARA HD. Thanks to NiMa & Co. for the 'X'-mas gift
**************

Last edited by elinkser; 10-19-2023 at 10:03 AM. Reason: (*removed Ctl-U binding as it interferes with nano editor.)
elinkser is offline   Reply With Quote
Old 01-30-2023, 12:08 AM   #47
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
*** UPDATE - YOU CAN POSSIBLY AVOID EXTRA CONFIGURATION OF THIS COMMENT BY USING LIBINPUT DRIVER - SEE COMMENT AFTER THIS ONE ***



Linux keyboard configuration seems to be complicated and ever changing, and I found the xmodmap method no longer effective.


But Xkbcomp allowed me to get my USB keyboard keys working on my Kobo:


To get current keyboard config:

apk add xkbcomp
xkbcomp $DISPLAY old.xkb

Copy the old keyboard layout, just in case we mess up:

cp old.xkb new.xkb



Now, for each malfunctioning key(Column1 below), get the keycodes(Column2) and their misassigned function(Column3):

apk add xev
xev -event keyboard

(Get the codes by clicking each key):

Right : 114, NoSymbol
Up : 111, Print
Left : 113, Alt_R
Down : 116, Super_R

Print : 107, Delete
Alt_R : 108, KP_Enter
Menu : 135, No_Symbol

PgUp : 112, KP_Divide
PgDn : 117, Menu
Home : 110, Pause
End : 115, Super_L
Scroll: 78, Scroll_Lock
Pause : 127, NoSymbol
Insert: 118, NoSymbol
Delete: 119, Nosymbol


Now open the keyboard layout file and find in the "xkb_keycodes" section the aliases(Column1 below) assigned to refer to each keycode(Column3 below) that our keyboard gave us:

mc -bv new.xkb

BRK :Right : 114, NoSymbol
PRSC :Up : 111, Print
RALT :Left : 113, Alt_R
RWIN : Down : 116, Super_R

DELE :Print : 107, Delete
KPEN :Alt_R : 108, KP_Enter
I07 :Menu : 135, No_Symbol

KPDV :PgUp : 112, KP_Divide
MENU :PgDn : 117, Menu
PAUS :Home : 110, Pause
LWIN :End : 115, Super_L
SCLK :Scroll: 78, Scroll_Lock
SUPR :Pause : 127, NoSymbol
FK13 :Insert: 118, NoSymbol
FK14 : Delete: 119, Nosymbol


As you see, some of our malfunctioning keys have already assigned functions (Column4 above), but none are essential, so we will comment them out in the "xkb_symbols" section, where the functions are assigned (but DO NOT edit anything in the"xkb_keycodes" section):

nano new.xkb

Do a Ctrl-W search for each of the misassigned key code aliases above(Column1) to comment them out, IN THE "xkb_symbols" SECTION ONLY:

BRK : Nothing to comment out (Unassigned, NoSymbol)
PRSC: Comment out:
// Key <PRSC> {
// ...
// };
RALT : Comment out:
// Key <RALT> {[ Alt_R, Meta_R ]};
RWIN : Comment out:
// Key <RWIN> {[ Super_R ]};
DELE : Comment out:
// Key <DELE> {[ Delete ]};
KPEN : Comment out:
// Key <KPEN> {[ KP_Enter ]};
I07 : Nothing to comment out (Unassigned, NoSymbol)
KPDV : Comment out:
// Key <KPDV> {
// ...
// ;
MENU : Comment out:
// Key <MENU> {[ Menu ]};
PAUS : Comment out:
// Key <PAUS> {
// ...
// ;
LWIN : Comment out:
// Key <LWIN> {[ Super_L ]};
SCLK : Comment out:
// Key <SCLK> {[ Scroll_Lock ]};
SUPR: Nothing to comment out (Unassigned, NoSymbol)
FK13: Nothing to comment out (Unassigned, NoSymbol)
FK14 : Nothing to comment out (Unassigned, NoSymbol)


Phew! Do a Ctrl-O Save!


Now, we will just replace in the "xkb_keycodes" section the default alias names(Column1) with the aliases our keys gave us(Column3) :


HOME : 97 : PAUS
UP : 98 : PRSC
PGUP : 99 : KPDV
LEFT : 100 : RALT
RGHT : 102 : BRK
END : 103 : LWIN
DOWN : 104 : RWIN
PGDN : 105 : MENU
INS : 106 : FK13
DELE : 107 : FK14


Change "key <HOME> {[ Home ]};" to "key <PAUS> {[ Home ]};"
Change "key <I2C> {[ Up ]};" to "key <PRSC> {[ Up ]};"
Change "key <PGUP> {[ Prior]};" to "key <KPDV> {[ Prior]};"
Change "key <I10> {[ Left ]};" to "key <RALT> {[ Left, Left ]};"
Change "key <I19> {[ Right ]};" to "key <BRK> {[ Right ]};"
Change "key <END> {[ End ]};" to "key <LWIN> {[ End ]};"
Change "key <I2E> {[ Down ]};" to "key <RWIN> {[ Down ]};"
Change "key <PGDN> {[ Next ]};" to "key <MENU> {[ Next ]};"
Change "key <INS> {[ Insert]};" to "key <FK13> {[ Insert ]};"
Change "key <DELE> {[ Delete ]};" to "key <FK14> {[ Delete ]};"



Do a Ctrl-O Save , Ctrl-X exit, and load up the keymap:

xkbcomp new.xkb $DISPLAY

Last edited by elinkser; 02-02-2023 at 08:14 PM.
elinkser is offline   Reply With Quote
Advert
Old 02-02-2023, 08:07 PM   #48
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
SETTING UP STOCK TOUCHSCREEN DRIVER (libinput):

Browsing through "dmesg | less" for information on the touchscreen in the Kobo Clara HD, we find:

Focaltech V3.3 20201229
1448x1072
cyttsp5_i2c_adapter touch

More info from "cat /proc/bus/input/devices":

Bus=0000 Vendor=0000 Product=0000 Version=0000
Name="cyttsp5_mt"
Handler=event1
Sysfs=/devices/platform/soc/2100000.aips-bus/21a4000.i2c/i2c-1/1-oo24/input/input1


***ALL CHANGES WILL BE DONE USING TELNET FROM THE DESKTOP IN CASE WE LOSE INPUT ON THE KOBO***

We will try the libinput driver instead of evdev.
So we edit /etc/X11/xorg.conf to have the touchscreen section look like this:


#Section "InputClass"
Section "InputDevice"
Identifier "Touchscreen"
# Driver "evdev"
Driver "libinput"
Option "Device" "/dev/input/event1"
EndSection


We also add the driver and config tools, and reboot X:
apk add xf86-input-libinput
apk add libinput-tools


Here is the output from "less /var/log/Xorg.0.log":

[ 127.751] (II) Using input driver 'libinput' for 'Touchscreen'
[ 127.751] (**) Touchscreen: always reports core events
[ 127.751] (**) Option "Device" "/dev/input/event1"
[ 129.993] (EE) libinput bug: udev device never initialized (/dev/input/event1)
[ 129.993] (EE) client bug: Invalid path /dev/input/event1
[ 129.993] (EE) libinput: Touchscreen: Failed to create a device for /dev/input/event1
[ 129.994] (EE) PreInit returned 2 for "Touchscreen"


So the libinput driver was not loaded.
The output of "DISPLAY=:0 libinput debug-events" gives:

Expected device added events on startup but got none. Maybe you don't have the right permissions?


The error message is complaining about udev, which is not installed! So let's install it.
(Note that our Alpine Linux uses a non-systemd version of udev.)

apk add eudev
apk add eudev-hwids
udevd -d
udevadm trigger


Now the output of "DISPLAY=:0 libinput debug-events" gives:

event1 - cyttsp5_mt: libinput bug: missing tablet capabilities: btn-stylus resolution. Ignoring this device.
-event0 DEVICE_ADDED gpio-keys seat0 default group1 cap:k



This error message is apparently because we didn't define these parameters:
EVDEV_ABS_00 (x-resolution/x-width = 1448/121 = 12)
EVDEV_ABS_01 (y-resolution/y-width = 1072/90 = 12)
(Using info we got from dmesg and by measuring the display.)

So we edit the hwdb file ("nano /etc/udev/hwdb.d/60-evdev.hwdb") to add the following entry:

evdev:input:b0000v0000p0000*
ID_INPUT=1
ID_INPUT_TOUCHSCREEN=1
EVDEV_ABS_00=::12
EVDEV_ABS_01=::12




To update the binary file on-disk, run:
udevadm hwdb --update

Then, to trigger a reload of all properties on your device, run:
udevadm trigger /sys/class/input/event1


The output of "DISPLAY=:0 libinput debug-events" gives:

-event0 DEVICE_ADDED gpio-keys seat0 default group1 cap:k
-event1 DEVICE_ADDED cyttsp5_mt seat0 default group2 cap:t ntouches 0 calib


The command "DISPLAY=:0 libinput list-devices" shows our touchscreen:

Device: cyttsp5_mt
Kernel: /dev/input/event1
Group: 2
Seat: seat0, default
Capabilities: touch
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: identity matrix
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: n/a
Rotation: n/a


The command "udevadm info /sys/class/input/event1" gives:


P: /devices/platform/soc/2100000.aips-bus/21a4000.i2c/i2c-1/1-0024/input/input1/event1
N: input/event1
S: input/by-path/platform-21a4000.i2c-event
E: DEVLINKS=/dev/input/by-path/platform-21a4000.i2c-event
E: DEVNAME=/dev/input/event1
E: DEVPATH=/devices/platform/soc/2100000.aips-bus/21a4000.i2c/i2c-1/1-0024/input/input1/event1
E: EVDEV_ABS_00=::12
E: EVDEV_ABS_01=::12
E: ID_INPUT=1
E: ID_INPUT_TOUCHSCREEN=1
E: ID_PATH=platform-21a4000.i2c
E: ID_PATH_TAG=platform-21a4000_i2c
E: LIBINPUT_DEVICE_GROUP=0/0/0:1-0024
E: MAJOR=13
E: MINOR=65
E: SUBSYSTEM=input
E: USEC_INITIALIZED=81411211




***NOW THE REAL TEST IS TO DEACTIVATE OUR OLD PYTHON INPUT DRIVER< AND REBOOT WITH ONLY LIBINPUT***

First comment out the lines in /xorg-chroot.sh:

#evtest --grab /dev/input/event1 > evtest-log &
#sleep 1
#while true; do python3 /home/xorg-kobo-touch.py ; done &
#sleep 1

And insert at the top:

udevd -d
sleep 2
udevadm trigger
sleep 2


***POWEROFF AND REBOOT X, WITH TELNET CONNECTION TO DESKTOP***


Run "ps ax" and you should see that udevd is running, but the python3 xorg-kobo-touch.py and evtest programs are not!
Enter the same command on the Kobo instead of via telnet, and it should still work.

It doesn't appear to give much of an improvement in typing speed but there are some benefits:
e.g. click and drag allows moving windows, highlighting text, sliding scrollbars.


We can also check capabilities with xinput ("apk add xinput" if not done previously):

To get your device name, execute "DISPLAY=:0 xinput list" (or just "xinput list" from the Kobo):

⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Touchscreen id=6 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]


To get the properties for device 6, "DISPLAY=:0 xinput list-props 6":

Device Enabled (115): 1
Coordinate Transformation Matrix (116): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix (232): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix Default (233): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Send Events Modes Available (234): 1, 0
libinput Send Events Mode Enabled (235): 0, 0
libinput Send Events Mode Enabled Default (236): 0, 0
Device Node (237): "/dev/input/event1"
Device Product ID (238): 0, 0


Unfortunately, nothing that interesting. So for now, let's back everything up:

cp /etc/X11/xorg.conf /shared/
cp /xorg-chroot.sh /shared/
cp /etc/udev/hwdb.d/60-evdev.hwdb /shared/
cp /var/log/Xorg.0.log /shared/


*NOW WE WILL TRY REMOVING /etc/X11/xorg.conf COMPLETELY TO SEE IF IT IS EVEN NEEDED!

OK, So the libinput driver works fine for the touchscreen with NO xorg.conf!

*NOW WE WILL REBOOT AND TRY THE USB KEYBOARD WITHOUT xorg.conf

OK, not only does the USB keyboard work (and can be plugged in after system is running, provided USB host mode is enabled), but the arrow keys work without extra configuring (as I described in the comment preceding this one). I guess adding the udev database did the trick.

For the curious, the Xorg.0.log gives:

[ 61.561] (II) config/udev: Adding input device cyttsp5_mt (/dev/input/event1)
[ 61.561] (**) cyttsp5_mt: Applying InputClass "evdev touchscreen catchall"
[ 61.561] (**) cyttsp5_mt: Applying InputClass "libinput touchscreen catchall"
[ 61.561] (II) Using input driver 'libinput' for 'cyttsp5_mt'
[ 61.561] (**) cyttsp5_mt: always reports core events
[ 61.561] (**) Option "Device" "/dev/input/event1"
[ 61.565] (II) event1 - cyttsp5_mt: is tagged by udev as: Touchscreen Tablet
[ 61.567] (II) event1 - cyttsp5_mt: device is a touch device
[ 61.568] (II) event1 - cyttsp5_mt: device removed
[ 61.620] (**) Option "config_info" "udev:/sys/devices/platform/soc/2100000.aips-bus/21a4000.i2c/i2c-1/1-0024/input/input1/event1"
[ 61.620] (II) XINPUT: Adding extended input device "cyttsp5_mt" (type: TOUCHSCREEN, id 9)
[ 61.622] (**) Option "AccelerationScheme" "none"
[ 61.622] (**) cyttsp5_mt: (accel) selected scheme none/0
[ 61.623] (**) cyttsp5_mt: (accel) acceleration factor: 2.000
[ 61.623] (**) cyttsp5_mt: (accel) acceleration threshold: 4
[ 61.639] (II) event1 - cyttsp5_mt: is tagged by udev as: Touchscreen Tablet
[ 61.642] (II) event1 - cyttsp5_mt: device is a touch device
[ 61.766] (**) HP HP Wireless Mini Keyboard: Applying InputClass "evdev keyboard catchall"
[ 61.766] (**) HP HP Wireless Mini Keyboard: Applying InputClass "libinput keyboard catchall"
[ 61.766] (II) Using input driver 'libinput' for 'HP HP Wireless Mini Keyboard'
[ 61.766] (**) HP HP Wireless Mini Keyboard: always reports core events
[ 61.766] (**) Option "Device" "/dev/input/event2"
[ 61.766] (II) libinput: HP HP Wireless Mini Keyboard: is a virtual subdevice
[ 61.767] (**) Option "config_info" "udev:/sys/devices/platform/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/0003:03F0:A107.0001/input/input2/event2"

Last edited by elinkser; 02-09-2023 at 08:49 AM. Reason: hot pluggable USB
elinkser is offline   Reply With Quote
Old 02-03-2023, 08:37 PM   #49
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 elinkser View Post
SETTING UP STOCK TOUCHSCREEN DRIVER (libinput):

Browsing through "dmesg | less" for information on the touchscreen in the Kobo Clara HD, we find:

Focaltech V3.3 20201229
1448x1072
cyttsp5_i2c_adapter touch

More info from "cat /proc/bus/input/devices":

Bus=0000 Vendor=0000 Product=0000 Version=0000
Name="cyttsp5_mt"
Handler=event1
Sysfs=/devices/platform/soc/2100000.aips-bus/21a4000.i2c/i2c-1/1-oo24/input/input1


***ALL CHANGES WILL BE DONE USING TELNET FROM THE DESKTOP IN CASE WE LOSE INPUT ON THE KOBO***

We will try the libinput driver instead of evdev.
So we edit /etc/X11/xorg.conf to have the touchscreen section look like this:


#Section "InputClass"
Section "InputDevice"
Identifier "Touchscreen"
# Driver "evdev"
Driver "libinput"
Option "Device" "/dev/input/event1"
EndSection


We also add the driver and config tools, and reboot X:
apk add xf86-input-libinput
apk add libinput-tools


Here is the output from "less /var/log/Xorg.0.log":

[ 127.751] (II) Using input driver 'libinput' for 'Touchscreen'
[ 127.751] (**) Touchscreen: always reports core events
[ 127.751] (**) Option "Device" "/dev/input/event1"
[ 129.993] (EE) libinput bug: udev device never initialized (/dev/input/event1)
[ 129.993] (EE) client bug: Invalid path /dev/input/event1
[ 129.993] (EE) libinput: Touchscreen: Failed to create a device for /dev/input/event1
[ 129.994] (EE) PreInit returned 2 for "Touchscreen"


So the libinput driver was not loaded.
The output of "DISPLAY=:0 libinput debug-events" gives:

Expected device added events on startup but got none. Maybe you don't have the right permissions?


The error message is complaining about udev, which is not installed! So let's install it.
(Note that our Alpine Linux uses a non-systemd version of udev.)

apk add eudev
apk add eudev-hwids
udevd -d
udevadm trigger


Now the output of "DISPLAY=:0 libinput debug-events" gives:

event1 - cyttsp5_mt: libinput bug: missing tablet capabilities: btn-stylus resolution. Ignoring this device.
-event0 DEVICE_ADDED gpio-keys seat0 default group1 cap:k



This error message is apparently because we didn't define these parameters:
EVDEV_ABS_00 (x-resolution/x-width = 1448/121 = 12)
EVDEV_ABS_01 (y-resolution/y-width = 1072/90 = 12)
(Using info we got from dmesg and by measuring the display.)

So we edit the hwdb file ("nano /etc/udev/hwdb.d/60-evdev.hwdb") to add the following entry:

evdev:input:b0000v0000p0000*
ID_INPUT=1
ID_INPUT_TOUCHSCREEN=1
EVDEV_ABS_00=::12
EVDEV_ABS_01=::12




To update the binary file on-disk, run:
udevadm hwdb --update

Then, to trigger a reload of all properties on your device, run:
udevadm trigger /sys/class/input/event1


The output of "DISPLAY=:0 libinput debug-events" gives:

-event0 DEVICE_ADDED gpio-keys seat0 default group1 cap:k
-event1 DEVICE_ADDED cyttsp5_mt seat0 default group2 cap:t ntouches 0 calib


The command "DISPLAY=:0 libinput list-devices" shows our touchscreen:

Device: cyttsp5_mt
Kernel: /dev/input/event1
Group: 2
Seat: seat0, default
Capabilities: touch
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: identity matrix
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: n/a
Rotation: n/a


The command "udevadm info /sys/class/input/event1" gives:


P: /devices/platform/soc/2100000.aips-bus/21a4000.i2c/i2c-1/1-0024/input/input1/event1
N: input/event1
S: input/by-path/platform-21a4000.i2c-event
E: DEVLINKS=/dev/input/by-path/platform-21a4000.i2c-event
E: DEVNAME=/dev/input/event1
E: DEVPATH=/devices/platform/soc/2100000.aips-bus/21a4000.i2c/i2c-1/1-0024/input/input1/event1
E: EVDEV_ABS_00=::12
E: EVDEV_ABS_01=::12
E: ID_INPUT=1
E: ID_INPUT_TOUCHSCREEN=1
E: ID_PATH=platform-21a4000.i2c
E: ID_PATH_TAG=platform-21a4000_i2c
E: LIBINPUT_DEVICE_GROUP=0/0/0:1-0024
E: MAJOR=13
E: MINOR=65
E: SUBSYSTEM=input
E: USEC_INITIALIZED=81411211




***NOW THE REAL TEST IS TO DEACTIVATE OUR OLD PYTHON INPUT DRIVER< AND REBOOT WITH ONLY LIBINPUT***

First comment out the lines in /xorg-chroot.sh:

#evtest --grab /dev/input/event1 > evtest-log &
#sleep 1
#while true; do python3 /home/xorg-kobo-touch.py ; done &
#sleep 1

And insert at the top:

udevd -d
sleep 2
udevadm trigger
sleep 2


***POWEROFF AND REBOOT X, WITH TELNET CONNECTION TO DESKTOP***


Run "ps ax" and you should see that udevd is running, but the python3 xorg-kobo-touch.py and evtest programs are not!
Enter the same command on the Kobo instead of via telnet, and it should still work.

It doesn't appear to give much of an improvement in typing speed but there are some benefits:
e.g. click and drag allows moving windows, highlighting text, sliding scrollbars.


We can also check capabilities with xinput ("apk add xinput" if not done previously):

To get your device name, execute "DISPLAY=:0 xinput list" (or just "xinput list" from the Kobo):

⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Touchscreen id=6 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]


To get the properties for device 6, "DISPLAY=:0 xinput list-props 6":

Device Enabled (115): 1
Coordinate Transformation Matrix (116): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix (232): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix Default (233): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Send Events Modes Available (234): 1, 0
libinput Send Events Mode Enabled (235): 0, 0
libinput Send Events Mode Enabled Default (236): 0, 0
Device Node (237): "/dev/input/event1"
Device Product ID (238): 0, 0


Unfortunately, nothing that interesting. So for now, let's back everything up:

cp /etc/X11/xorg.conf /shared/
cp /xorg-chroot.sh /shared/
cp /etc/udev/hwdb.d/60-evdev.hwdb /shared/
cp /var/log/Xorg.0.log /shared/


*NOW WE WILL TRY REMOVING /etc/X11/xorg.conf COMPLETELY TO SEE IF IT IS EVEN NEEDED!

OK, So the libinput driver works fine for the touchscreen with NO xorg.conf!

*NOW WE WILL REBOOT AND TRY THE USB KEYBOARD WITHOUT xorg.conf

OK, not only does the USB keyboard work, but the arrow keys work without extra configuring (as I described in the comment preceding this one). I guess adding the udev database did the trick.

For the curious, the Xorg.0.log gives:

[ 61.561] (II) config/udev: Adding input device cyttsp5_mt (/dev/input/event1)
[ 61.561] (**) cyttsp5_mt: Applying InputClass "evdev touchscreen catchall"
[ 61.561] (**) cyttsp5_mt: Applying InputClass "libinput touchscreen catchall"
[ 61.561] (II) Using input driver 'libinput' for 'cyttsp5_mt'
[ 61.561] (**) cyttsp5_mt: always reports core events
[ 61.561] (**) Option "Device" "/dev/input/event1"
[ 61.565] (II) event1 - cyttsp5_mt: is tagged by udev as: Touchscreen Tablet
[ 61.567] (II) event1 - cyttsp5_mt: device is a touch device
[ 61.568] (II) event1 - cyttsp5_mt: device removed
[ 61.620] (**) Option "config_info" "udev:/sys/devices/platform/soc/2100000.aips-bus/21a4000.i2c/i2c-1/1-0024/input/input1/event1"
[ 61.620] (II) XINPUT: Adding extended input device "cyttsp5_mt" (type: TOUCHSCREEN, id 9)
[ 61.622] (**) Option "AccelerationScheme" "none"
[ 61.622] (**) cyttsp5_mt: (accel) selected scheme none/0
[ 61.623] (**) cyttsp5_mt: (accel) acceleration factor: 2.000
[ 61.623] (**) cyttsp5_mt: (accel) acceleration threshold: 4
[ 61.639] (II) event1 - cyttsp5_mt: is tagged by udev as: Touchscreen Tablet
[ 61.642] (II) event1 - cyttsp5_mt: device is a touch device
[ 61.766] (**) HP HP Wireless Mini Keyboard: Applying InputClass "evdev keyboard catchall"
[ 61.766] (**) HP HP Wireless Mini Keyboard: Applying InputClass "libinput keyboard catchall"
[ 61.766] (II) Using input driver 'libinput' for 'HP HP Wireless Mini Keyboard'
[ 61.766] (**) HP HP Wireless Mini Keyboard: always reports core events
[ 61.766] (**) Option "Device" "/dev/input/event2"
[ 61.766] (II) libinput: HP HP Wireless Mini Keyboard: is a virtual subdevice
[ 61.767] (**) Option "config_info" "udev:/sys/devices/platform/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/0003:03F0:A107.0001/input/input2/event2"
Wow thanks, this is quite impressive (all your work is). I hope to be able to use some of it for InkBox OS.
NiMa is offline   Reply With Quote
Old 02-03-2023, 09:17 PM   #50
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
Sure! Thanks for putting together the framework, (building on other great contributions of course like always.)

Actually I originally got the Clara HD because I read you could run PostmarketOS like I have on my PinePhone (and it was on sale ), but ironically I was never able to get that to work, so...
Instead I ended up obsessing on this thing!
elinkser is offline   Reply With Quote
Advert
Old 02-03-2023, 09:18 PM   #51
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
SIMULATE RIGHT CLICK WITH 2-FINGER LEFT/RIGHT SWIPE
SIMULATE VERTICAL SCROLLING WITH 2-FINGER DOWN/UP SWIPE
(works with libinput driver and no xorg.conf):

libinput-touchscreen


cd /home/root/
wget https://github.com/xiamaz/libinput-t...ads/master.zip
unzip master.zip
cd libinput-touchscreen-master/
apk add build-base
apk add libinput-dev
apk add eudev-dev
make
cd ..
mkdir /.config/libinput-touchscreen/
cp ./libinput-touchscreen-master/config /.config/libinput-touchscreen/
cp ./libinput-touchscreen-master/dims.txt /.config/libinput-touchscreen/

nano /.config/libinput-touchscreen/dims.txt
* Edit from:
0.000000 273.000000 # X dimensions
0.000000 157.500000 # Y dimensions
To:
0.000000 1448.000000 # X dimensions
0.000000 1072.500000 # Y dimensions

nano /.config/libinput-touchscreen/config
* Comment out everything and add only:
MOVEMENT W 2
xdotool click 3
MOVEMENT E 2
xdotool click 3
MOVEMENT N 2
xdotool key Page_Down
MOVEMENT S 2
xdotool key Page_Up

# 3-finger tap Toggle desktop twice to refresh screen
#TAP X 3
# xdotool key Ctrl+Shift+g sleep 1 key Ctrl+Shift+g

# 2-finger tap to rightclick 60 pixels above cursor
#TAP X 2
# xdotool mousemove_relative -- 0 -60 click 3



Edit the top of the <keyboard> section of .config/openbox/rc.xml to:

<keyboard>
<keybind key="C-u">
<action name="ToggleShade"/>
</keybind>
<keybind key="C-S-g">
<action name="ToggleShowDesktop"/>
</keybind>



DISPLAY=:0 ./libinput-touchscreen-master/libinput-touchscreen
* Swipe West/East (Left/Right) with 2 fingers on Kobo screen for right click
(note: must click to clear after each right click)
Swipe South/North (Down/Up) with 2 fingers for PgUp and PgDn.

#And 3-finger tap for ToggleShowDesktop + 2-finger tap for click 60 pixels under desired right click. (Optional - 3 finger tap not working well, and right click well handled by swipes)



***NOTES***

1) The 2-finger Left/Right swipes work great for right clicks. The key is to END the swipe on a link to avoid a click on the link.

2) The 2-finger South/North swipes work great for simulating 2-finger scrolling.

3) The 3-finger actions don't work reliably.

4) The libinput driver has allowed highlighting of text with finger motion - unfortunately, the libinput-touchscreen driver messes up this highlighting functionality.
So if you need the highlighting, don't use libinput-touchscreen.
If you want the libinput-touchscreen's 2-finger swipes for easy rightclicks and page scrolls, then enable it!

***********


***FINAL CLEANUP***

1) Add the following to your /uxorg-chroot.sh and /xorg-chroot.sh scripts if you want libinput-touchscreen active on startup:

cd /home/myuser # use /home/root or your user home directory
DISPLAY=:0 /usr/local/bin/libinput-touchscreen &

(Add this before the "echo 20 ..." line, e.g.: )

udevd -d
sleep 2
udevadm trigger
sleep 2
X -dpi 175 &
cd /home/root/fbink-xdamage
sleep 3
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/root/fbink-xdamage/FBInk/Release/; env DISPLAY=:0 ./fbink_xdamage &
sleep 3
cd /home
cd /home/myuser # use /home/root or your user home directory
DISPLAY=:0 /usr/local/bin/libinput-touchscreen &
#evtest --grab /dev/input/event1 > evtest-log &
#sleep 1
#while true; do python3 /home/xorg-kobo-touch.py ; done &
#sleep 1
echo 20 > /sys/class/backlight/mxc_msp430.0/brightness
DISPLAY=:0 sudo -u myuser openbox &
...


2) The .config/libinput-touchscreen/ folder has to be from wherever you cd'd to in /uxorg-chroot.sh

cp /home/root/libinput-touchscreen-master/libinput-touchscreen /usr/local/bin/
cp -r /home/root/.config/libinput-touchscreen /home/myuser


3)Run "visudo" command to edit /etc/sudoers file so user can enable/disable libinput-touchscreen (with "sudo killall libinput-touchscreen" or "sudo /usr/local/bin/libinput-touchscreen &"):

##
## User privilege specification
##
root ALL=(ALL:ALL) ALL

myuser ALL=NOPASSWD: /bin/login
myuser ALL=NOPASSWD: /sbin/poweroff
myuser ALL=NOPASSWD: /usr/bin/killall
myuser ALL=NOPASSWD: /usr/local/bin/libinput-touchscreen



4) Increase the menu size in netsurf by creating a settings.ini file in the .config/gtk-3.0 directory and adding the following lines:

[Settings]
gtk-font-name=Noto Sans Regular 16

* Now that the menu font is readable, we can lighten up the toolbar in .config/netsurf/Choices:

toolbar_items:back/history/forward/reloadstop/url_bar/copy/paste/zoomplus/zoomminus


5) Edit the /usr/share/applications/featherpad.desktop file so the exec command is:

Exec=env QT_FONT_DPI=175 featherpad %U
# The app will open with a large window, but you can rightclick on the menubar and choose resize.
# Your new libinput driver lets you drag to resize, and the app will remember the size.

* Let's get some nice icons for our taskbar applications:

cd /home/root
wget https://mirror.math.princeton.edu/pu...-4.12.3-r0.apk
tar zxvf xfwm4-4.12.3-r0.apk
cp ./usr/share/icons/hicolor/scalable/actions/* /usr/share/icons/hicolor/scalable/apps/
cp ./usr/share/icons/hicolor/scalable/apps/* /usr/share/icons/hicolor/scalable/apps/
nano /usr/share/applications/xdorc.desktop
Icon=wmtweaks
nano /usr/share/applications/xdodd.desktop
Icon=fce-wm-unmaximize


6) Network with Android device without an internet connection:


***SECURITY REMINDER***
Telnet sessions are in cleartext INCLUDING LOGIN SESSIONS, so only use on a private network, if at all!
If you always have DEVMODE set to ON for whatever reasons , that means Telnet is on by default, unless you toggle it off , e.g. using NickelMenu.


You can install KOReader to get the more secure SSH option, and NiLuJe's kobostuff provides a package that includes an SSH binary.

**********************************


You may want to set ForceWifiOn=true (if you haven't done so already) in your config file [DeveloperSettings] (in KOReader, navigate to .kobo/Kobo/Kobo eReader.conf, Open With Text editor) or else the dropouts may cause frustration.

I have found that none of my Android devices need to be internet-connected to set up as a hotspot so the Kobo can network with my tablet or keyboard-equipped Blackberry Priv with no internet!
*Note:The open source droidVNC-NG vnc server requires minimum Android 7 so the Priv is a no-go, being locked at 6, although it can run ConnectBot, and closed source vnc server Alpha Vnc Lite.


And if you are using ConnectBot on Android for telnetting, I think the 1.9.6-oss version and earlier doesn't have the scrolling issue that the later version does.

You can install x11vnc on your xorg chroot, set password with "x11vnc -storepasswd", and run it with "x11vnc -zeroconf", to make sure multivnc android vnc client can discover it.

You can install openssh server:
apk add openssh-server
ssh-keygen -A
/usr/sbin/sshd
And then install XMouse app from F-Droid on your phone for a fun alternate keyboard/mouse input.

(Just for lols here is a sample, completely unnecessary keyboard config I made for XMouse) :
Spoiler:


1<xmousesep>xdotool key 1<xmousesep>1<xmousesep>#e6f7ff
2<xmousesep>xdotool key 2<xmousesep>1<xmousesep>#e6f7ff
3<xmousesep>xdotool key 3<xmousesep>1<xmousesep>#e6f7ff
4<xmousesep>xdotool key 4<xmousesep>1<xmousesep>#e6f7ff
5<xmousesep>xdotool key 5<xmousesep>1<xmousesep>#e6f7ff
6<xmousesep>xdotool key 6<xmousesep>1<xmousesep>#e6f7ff
7<xmousesep>xdotool key 7<xmousesep>1<xmousesep>#e6f7ff
8<xmousesep>xdotool key 8<xmousesep>1<xmousesep>#e6f7ff
9<xmousesep>xdotool key 9<xmousesep>1<xmousesep>#e6f7ff
0<xmousesep>xdotool key 0<xmousesep>1<xmousesep>#e6f7ff
"<xmousesep>xdotool key quotedbl<xmousesep>1<xmousesep>#e6f7ff
><xmousesep>xdotool key greater<xmousesep>1<xmousesep>#e6f7ff
|<xmousesep>xdotool key bar<xmousesep>1<xmousesep>#e6f7ff
/<xmousesep>xdotool key slash<xmousesep>1<xmousesep>#e6f7ff
$<xmousesep>xdotool key dollar<xmousesep>1<xmousesep>#e6f7ff
#<xmousesep>xdotool key numbersign<xmousesep>1<xmousesep>#e6f7ff
&<xmousesep>xdotool key ampersand<xmousesep>1<xmousesep>#e6f7ff
*<xmousesep>xdotool key asterisk<xmousesep>1<xmousesep>#e6f7ff
(<xmousesep>xdotool key parenleft<xmousesep>1<xmousesep>#e6f7ff
)<xmousesep>xdotool key parenright<xmousesep>1<xmousesep>#e6f7ff
q<xmousesep>xdotool key q<xmousesep>1<xmousesep>#FFFFFF
w<xmousesep>xdotool key w<xmousesep>1<xmousesep>#FFFFFF
e<xmousesep>xdotool key e<xmousesep>1<xmousesep>#FFFFFF
r<xmousesep>xdotool key r<xmousesep>1<xmousesep>#FFFFFF
t<xmousesep>xdotool key t<xmousesep>1<xmousesep>#FFFFFF
y<xmousesep>xdotool key y<xmousesep>1<xmousesep>#FFFFFF
u<xmousesep>xdotool key u<xmousesep>1<xmousesep>#FFFFFF
i<xmousesep>xdotool key i<xmousesep>1<xmousesep>#FFFFFF
o<xmousesep>xdotool key o<xmousesep>1<xmousesep>#FFFFFF
p<xmousesep>xdotool key p<xmousesep>1<xmousesep>#FFFFFF
Esc<xmousesep>xdotool key Escape<xmousesep>1<xmousesep>#80d4ff
a<xmousesep>xdotool key a<xmousesep>1<xmousesep>#FFFFFF
s<xmousesep>xdotool key s<xmousesep>1<xmousesep>#FFFFFF
d<xmousesep>xdotool key d<xmousesep>1<xmousesep>#FFFFFF
f<xmousesep>xdotool key f<xmousesep>1<xmousesep>#FFFFFF
g<xmousesep>xdotool key g<xmousesep>1<xmousesep>#FFFFFF
h<xmousesep>xdotool key h<xmousesep>1<xmousesep>#FFFFFF
j<xmousesep>xdotool key j<xmousesep>1<xmousesep>#FFFFFF
k<xmousesep>xdotool key k<xmousesep>1<xmousesep>#FFFFFF
l<xmousesep>xdotool key l<xmousesep>1<xmousesep>#FFFFFF
Tab<xmousesep>xdotool key Tab<xmousesep>1<xmousesep>#80d4ff
z<xmousesep>xdotool key z<xmousesep>1<xmousesep>#FFFFFF
x<xmousesep>xdotool key x<xmousesep>1<xmousesep>#FFFFFF
c<xmousesep>xdotool key c<xmousesep>1<xmousesep>#FFFFFF
v<xmousesep>xdotool key v<xmousesep>1<xmousesep>#FFFFFF
b<xmousesep>xdotool key b<xmousesep>1<xmousesep>#FFFFFF
n<xmousesep>xdotool key n<xmousesep>1<xmousesep>#FFFFFF
m<xmousesep>xdotool key m<xmousesep>1<xmousesep>#FFFFFF
'<xmousesep>xdotool key apostrophe<xmousesep>1<xmousesep>#e6f7ff
<=<xmousesep>xdotool key BackSpace<xmousesep>1<xmousesep>#80d4ff
Cap<xmousesep>xdotool key Caps_Lock<xmousesep>1<xmousesep>#80d4ff
-<xmousesep>xdotool key minus<xmousesep>1<xmousesep>#e6f7ff
:<xmousesep>xdotool key colon<xmousesep>1<xmousesep>#e6f7ff
;<xmousesep>xdotool key semicolon<xmousesep>1<xmousesep>#e6f7ff
!<xmousesep>xdotool key exclam<xmousesep>1<xmousesep>#e6f7ff
?<xmousesep>xdotool key question<xmousesep>1<xmousesep>#e6f7ff
,<xmousesep>xdotool key comma<xmousesep>1<xmousesep>#e6f7ff
.<xmousesep>xdotool key period<xmousesep>1<xmousesep>#e6f7ff
<-|<xmousesep>xdotool key Return<xmousesep>2<xmousesep>#80d4ff
C-v<xmousesep>xdotool keydown ctrl<xmousesep>1<xmousesep>#80d4ff
C-^<xmousesep>xdotool keyup ctrl<xmousesep>1<xmousesep>#80d4ff
<<<xmousesep>xdotool key Prior<xmousesep>1<xmousesep>#FFFFB3
>><xmousesep>xdotool key Next<xmousesep>1<xmousesep>#FFFFB3
Space<xmousesep>xdotool key space<xmousesep>2<xmousesep>#80d4ff
<<xmousesep>xdotool key Left<xmousesep>1<xmousesep>#FFFFB3
^<xmousesep>xdotool key Up<xmousesep>1<xmousesep>#FFFFB3
v<xmousesep>xdotool key Down<xmousesep>1<xmousesep>#FFFFB3
><xmousesep>xdotool key Right<xmousesep>1<xmousesep>#FFFFB3



7) Add featherpad.desktop to your .config/tint2/tint2rc file:

# Launcher
...
launcher_item_app = featherpad.desktop

* Let's also add a nice drawing app to go with our text editor:
apk add drawing
Maximize to draw, unmaximize to use the DEL key on the keyboard to delete the selection!

* Also add lxterminal, a terminal app that plays better with tint2 and mc
apk add lxterminal
(puts an identifiable icon on the taskbar so you can more easily distinguish and select the keyboard for sending keystrokes to a maximized graphical app.. Also mc won't have skewed columns in lxterminal, unlike in qterminal.)
I used font Noto Sans Bold 16, foreground to white, and set default window 80x19, in the lxterminal preferences menu.

* Also add w3m and w3m-image for terminal browser that has inline images in an xterm.
I put some keycodes help in the spoiler at yhe end of:
https://www.mobileread.com/forums/sh...91&postcount=3

To force certain commands to monocolor output, I also added to .bashrc (unfortunately you must run the command ". .bashrc" each session because our kludged non-login shell does not read it on startup) :
alias ls='ls --color=never'
alias grep='grep --color=never'

Also add to .config/tint2/tint2rc
launcher_item_app = lxterminal.desktop
launcher_item_app = com.github.maoschanz.drawing.desktop


8) Package everything together by copying the commands in /mnt/onboard/opt (or /opt), your nickel menu (/mnt/onboard/.adds/nm/config.txt), /uxorg-chroot.sh and /xorg-chroot.sh, your .config folder and libinput-touchscreen build, your fbink-xdamage build and xorg-kobo-touch.py, your /etc/sudoers and /etc/udev/hwdb.d/60-evdev.hwdb files, your /usr/share/applications folder, your chalpine.sh and chalpined.sh files in /mnt/onboard/.adds/koreader/scripts, and and a fresh alpine.tgz archive of your chroot (as described in comment #46 section 12 to a folder, say alpinepkg/, and zip it together (a few hundred MB):

zip alpinepkg.zip alpinepkg/


9) Remove your SD card from your Clara HD and back it up on your linux desktop, and zip it together (about 3GB):

sudo dd if=/dev/sdb of=kobo_alpine_sd.img bs=4M status=progress
zip kobo_alpine_sd.zip kobo_alpine_sd.img



YOU NOW HAVE A NICE ALPINE LINUX "DESKTOP" ON YOUR KOBO CLARA HD, WITH READABLE FONTS, RIGHT-CLICK AND GESTURES, WINDOW MANAGER AND MULTITASKING, GRAPHICAL WEB BROWSER AND EDITOR, VNC CLIENT, AND USB HOSTING ALLOWING HOT-PLUGGABLE USB KEYBOARD (REQUIRES POWERED CONNECTOR), ACCESSIBLE FROM YOUR NICKEL MENU ALONGSIDE YOUR FAVORITE KOBO APPS. ON TO THE NEXT ADVENTURE!

Last edited by elinkser; 05-03-2023 at 07:48 PM. Reason: final(?) update
elinkser is offline   Reply With Quote
Old 02-05-2023, 10:53 PM   #52
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
***
FRESH OFF THE SUCCESS OF THE RIGHT-CLICK SOLUTION OF THE PRECEDING COMMENT #51,
HERE FOR YOUR ENJOYMENT, THE "BLOOPER REEL" OF STUFF THAT DIDN'T FARE AS WELL
***



USE XBINDKEYS TO GENERATE RIGHT CLICK WITH SHIFT-LEFT CLICK


apk add xvkbd
apk add xbindkeys

Create /.xbindkeysrc and enter the lines:

# Map Shift-LeftClick to RightClick
"xvkbd -text '\m2'"
m:0x1 + b:1


(Doesn't work.)


ONE-FINGER CLICK INTERCEPTION BY LIBINPUT-TOUCHSCREEN


cd /home/root/

Edit /.config/libinput-touchscreen/config to:

TAP X 1
xdotool click 1
TAP X 2
xdotool click 3

MOVEMENT W 2
xdotool click 3
MOVEMENT E 2
xdotool click 3
MOVEMENT N 2
xdotool key Page_Down
MOVEMENT S 2
xdotool key Page_Up


Disable tapping FROM TELNET ON DESKTOP (YOU WILL LOSE INPUT ON KOBO):

Run "DISPLAY=:0 xinput list"
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ cyttsp5_mt id=7 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ gpio-keys id=6 [slave keyboard (3)]

Run "DISPLAY=:0 xinput list-props 7"
Device 'cyttsp5_mt':
Device Enabled (115): 1
...

Run "DISPLAY=:0 xinput set-prop 7 115 0"
The Kobo touchscreen no longer responds.

Run "DISPLAY=:0 xinput list-props 7"
Device 'cyttsp5_mt':
Device Enabled (115): 0
...

Run " DISPLAY=:0 libinput debug-events" and tap the screen
-event0 DEVICE_ADDED gpio-keys seat0 default group1 cap:k
-event1 DEVICE_ADDED cyttsp5_mt seat0 default group2 cap:t ntouches 0 calib
event1 TOUCH_DOWN +0.000s 0 (0) 75.28/36.57 (1090.00/392.00mm)
event1 TOUCH_FRAME +0.000s
event1 TOUCH_UP +0.060s 0 (0)
event1 TOUCH_FRAME +0.060s


But remember the line in /.config/libinput-touchscreen/config we added:
TAP X 1
xdotool click 1


Run "DISPLAY=:0 ./libinput-touchscreen-master/libinput-touchscreen" and tap the screen:
Device found: /dev/input/event1
Loading screen calibration from //.config/libinput-touchscreen/dims.txt
G(1) T1 D0
Trigger xdotool click 1

So the tap is registered, but is very unreliable, so run "DISPLAY=:0 xinput set-prop 7 115 1"
And our Kobo screen is responsive again.

Comment out the left-click entries in "/.config/libinput-touchscreen/config":
#TAP X 1
# xdotool click 1
#TAP X 2
# xdotool click 3



ALTERNATIVE RIGHT-CLICK DRIVER "TOUCHEGG" FOR LIBINPUT

touchegg

cd /home/root/
apk add touchegg
mkdir .config/touchegg

nano .config/touchegg/touchegg.conf
*Enter the following:

<gesture type="SWIPE" fingers="2" direction="DOWN">
<action type="RUN_COMMAND">
<repeat>false</repeat>
<command>xdotool key Page_Up</command>
<on>end</on>
</action>
</gesture>

<gesture type="SWIPE" fingers="2" direction="UP">
<action type="RUN_COMMAND">
<repeat>false</repeat>
<command>xdotool key Page_Down</command>
<on>end</on>
</action>
</gesture>

<gesture type="SWIPE" fingers="2" direction="LEFT">
<action type="RUN_COMMAND">
<repeat>true</repeat>
<command>xdotool click 6</command>
<decreaseCommand>xdotool click 5</decreaseCommand>
</action>
</gesture>

<gesture type="SWIPE" fingers="2" direction="RIGHT">
<action type="RUN_COMMAND">
<repeat>true</repeat>
<command>xdotool click 7</command>
<decreaseCommand>xdotool click 5</decreaseCommand>
</action>
</gesture>

<gesture type="PINCH" fingers="4" direction="IN">
<action type="RUN_COMMAND">
<repeat>false</repeat>
<command>xdotool click 3</command>
<on>end</on>
</action>
</gesture>

<gesture type="TAP" fingers="2">
<action type="RUN_COMMAND">
<repeat>false</repeat>
<command>xdotool click 3</command>
<on>end</on>
</action>
</gesture>



*Now run the daemon and client:

DISPLAY=:0 touchegg --daemon 3 15 &
<Return>
DISPLAY=:0 touchegg


(The only gesture that seems to work is the "TAP".)

*Kill the client and daemon:

<Ctrl-c>
killall touchegg



*****



THE NETSURF BROWSER IS WORKING GREAT BUT CANNOT HANDLE SOME WEBSITES, AND THERE WAS THIS ARMHF BINARY OF A LIGHTWEIGHT, JAVASCRIPT-CAPABLE WEB BROWSER "FLOATING" AROUND, SO...



wget https://mirror.math.princeton.edu/pu...t-2.3.3-r0.apk

tar zxvf luakit-2.3.3-r0.apk

DISPLAY=:0 ./usr/bin/luakit
Error loading shared library libwebkit2gtk-4.0.so.37: No such file or directory (needed by ./usr/ bin/luakit)
Error loading shared library libsoup-2.4.so.1: No such file or directory (needed by ./usr/bin/luakit)
Error loading shared library libluajit-5.1.so.2: No such file or directory (needed by ./usr/bin/luakit)
Error loading shared library libjavascriptcoregtk-4.0.so.18: No such file or directory (needed by ./usr/bin/luakit)


df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/loop0 2064208 879060 1080292 45% /


apk add luajit
(1/1) Installing luajit (2.1_p20210510-r3)

apk add libsoup
(1/1) Installing libsoup (2.74.3-r0)

apk add webkit2gtk
(1/31) Installing libcap2 (2.66-r0)
(2/31) Installing bubblewrap (0.7.0-r0)
(3/31) Installing xdg-dbus-proxy (0.1.4-r0)
(4/31) Installing libgpg-error (1.46-r1)
(5/31) Installing libgcrypt (1.10.1-r0)
(6/31) Installing gcr-base (3.41.1-r1)
(7/31) Installing gnome-keyring (42.1-r0)
(8/31) Installing libwpe (1.14.0-r0)
(9/31) Installing libwpebackend-fdo (1.14.0-r0)
(10/31) Installing aspell-libs (0.60.8-r2)
(11/31) Installing nuspell-libs (5.1.2-r1)
(12/31) Installing enchant2 (2.3.3-r1)
(13/31) Installing libxv (1.0.11-r3)
(14/31) Installing alsa-lib (1.2.8-r0)
(15/31) Installing cdparanoia-libs (10.2-r11)
(16/31) Installing graphene (1.10.8-r1)
(17/31) Installing gstreamer (1.20.5-r0)
(18/31) Installing opus (1.3.1-r1)
(19/31) Installing orc (0.4.33-r0)
(20/31) Installing libtheora (1.1.1-r16)
(21/31) Installing gst-plugins-base (1.20.5-r0)
(22/31) Installing harfbuzz-icu (5.3.1-r1)
(23/31) Installing hyphen (2.8.8-r2)
(24/31) Installing libgudev (237-r1)
(25/31) Installing libmanette (0.2.6-r2)
(26/31) Installing libseccomp (2.5.4-r0)
(27/31) Installing libsecret (0.20.5-r0)
(28/31) Installing libwoff2common (1.0.2-r2)
(29/31) Installing libwoff2enc (1.0.2-r2)
(30/31) Installing libxslt (1.1.37-r0)
(31/31) Installing webkit2gtk (2.38.4-r0)


df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/loop0 2064208 962052 997300 49% /



DISPLAY=:0 ./usr/bin/luakit
[ 0.900950] W [core/luah]: couldn't load any rc file
[ 0.901943] F [core/luakit]: couldn't find rc file


cp usr/bin/luakit /usr/bin/
cp -r usr/lib/luakit/ /usr/lib/
cp -r usr/share/luakit/ /usr/share/
cp usr/share/applications/luakit.desktop /usr/share/applications/
cp usr/share/pixmaps/luakit.* /usr/share/pixmaps/
cp -r etc/xdg/luakit/ /etc/xdg/


DISPLAY=:0 ./usr/bin/luakit
[ 0.328927] I [core/luah]: Loading rc: /etc/xdg/luakit/rc.lua
[ 0.345207] E [core/common/lualib]: Lua error: module 'lfs' not found:
no field package.preload['lfs']
no file './lfs.lua'
no file '/usr/share/luajit-2.1.0-beta3/lfs.lua'
no file '/usr/local/share/lua/5.1/lfs.lua'
no file '/usr/local/share/lua/5.1/lfs/init.lua'
no file '/usr/share/lua/5.1/lfs.lua'
no file '/usr/share/lua/5.1/lfs/init.lua'
no file '/usr/share/lua/common/lfs.lua'
no file '/usr/share/lua/common/lfs/init.lua'
no file '/usr/share/luakit/lib/lfs.lua'
no file '/usr/share/luakit/lib/lfs/init.lua'
no file '/.config/luakit/lfs.lua'
no file '/.config/luakit/lfs/init.lua'
no file '/etc/xdg/luakit/lfs.lua'
no file '/etc/xdg/luakit/lfs/init.lua'
no file './lfs.so'
no file '/usr/local/lib/lua/5.1/lfs.so'
no file '/usr/lib/lua/5.1/lfs.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
Traceback:
(1) [C] in function require
(2) /etc/xdg/luakit/rc.lua:5 in main chunk
[ 0.346607] W [core/luah]: loading rc '/etc/xdg/luakit/rc.lua' failed, falling back...
[ 0.233526] F [core/luakit]: couldn't find rc file


apk add lua5.1
(1/2) Installing lua5.1-libs (5.1.5-r11)
(2/2) Installing lua5.1 (5.1.5-r11)


df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/loop0 2064208 964072 995280 49% /


DISPLAY=:0 ./usr/bin/luakit
[ 0.638502] I [core/luah]: Loading rc: /etc/xdg/luakit/rc.lua
[ 0.653692] E [core/common/lualib]: Lua error: module 'lfs' not found:
no field package.preload['lfs']
no file './lfs.lua'
no file '/usr/share/luajit-2.1.0-beta3/lfs.lua'
no file '/usr/local/share/lua/5.1/lfs.lua'
no file '/usr/local/share/lua/5.1/lfs/init.lua'
no file '/usr/share/lua/5.1/lfs.lua'
no file '/usr/share/lua/5.1/lfs/init.lua'
no file '/usr/share/lua/common/lfs.lua'
no file '/usr/share/lua/common/lfs/init.lua'
no file '/usr/share/luakit/lib/lfs.lua'
no file '/usr/share/luakit/lib/lfs/init.lua'
no file '/.config/luakit/lfs.lua'
no file '/.config/luakit/lfs/init.lua'
no file '/etc/xdg/luakit/lfs.lua'
no file '/etc/xdg/luakit/lfs/init.lua'
no file './lfs.so'
no file '/usr/local/lib/lua/5.1/lfs.so'
no file '/usr/lib/lua/5.1/lfs.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
Traceback:
(1) [C] in function require
(2) /etc/xdg/luakit/rc.lua:5 in main chunk
[ 0.655031] W [core/luah]: loading rc '/etc/xdg/luakit/rc.lua' failed, falling back...
[ 0.239572] F [core/luakit]: couldn't find rc file


apk add ldoc
(1/7) Installing lua5.4-libs (5.4.4-r6)
(2/7) Installing lua5.4 (5.4.4-r6)
(3/7) Installing lua-filesystem (1.8.0-r2)
(4/7) Installing lua5.4-filesystem (1.8.0-r2)
(5/7) Installing lua-penlight (1.13.1-r0)
(6/7) Installing ldoc (1.4.6-r4)
(7/7) Installing lua5.1-filesystem (1.8.0-r2)


df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/loop0 2064208 965568 993784 49% /


nano /etc/xdg/luakit/theme.lua
-- Default settings
theme.font = "32px monospace"
theme.fg = "#fff"
theme.bg = "#000"
---
-- Follow mode hints
theme.hint_font = "32px monospace, courier, sans-serif"


DISPLAY=:0 ./usr/bin/luakit https://www.startpage.com


RESIZE THE LUA WINDOW USING RIGHTCLICK ON TITLE BAR, SELECT RESIZE, THEN DRAG


Type : open http://wpt.live/acid/acid3/test.html
Score:16/100


Type : open https://www.javatpoint.com/html-server-sent-event
...Still waiting for the page to open...



---

BASIC INSTRUCTIONS FOR ANYONE WHO WANTS TO TRY THEIR LUCK:


*** SINCE YOU ARE MESSING AROUND WITH PACKAGES FROM ANOTHER VERSION -AND EVEN ARCHITECTURE, THOUGH ARMHF CAN RUN ON ARMV7 - PLEASE BACKUP, TAKE NOTES, ETC... ***

Spoiler:

Opening the help page

To open the internal help page, press <F1>. From there, you can open the introspector to view current keybindings or open the included API documentation.
Switching to command mode

Many common operations in luakit, such as typing and opening a URL, involve the use of commands. This is done by switching to command mode, typing the command, and pressing <Enter>.

To switch to command mode, press : (i.e. <Shift-;>), and the command bar will appear at the bottom of the window. In the remainder of this document, commands will be written prefixed by a :; so : open means to first press :, and then type open *WITHOUT THE SPACE BETWEEN : and open (I put the space to avoid emoji conversion)

Go to a URL in the current tab

Type : open followed by a space and the URL to navigate to, and press <Enter>. For example, to open the luakit website, type : open luakit.github.io and then press press <Enter>.

Shortcut: press o to switch to command mode with open already typed.

Search

Press /, and type your search query, e.g: /luakit. Press <Enter> to finish typing your search query and switch back to normal mode. While in normal mode with highlighted search results, press n to jump to the next search result, and N to jump to the previous one.
Opening, closing, and undo-closing tabs

Try the following steps in order:

Run :tabopen luakit.org, and wait until the page finishes loading.
Press d, and the new tab will close.
Press u, and the just-closed tab will reappear.

Scrolling in a web page

There are several different keys to scroll a webview:

The arrow, page up/down, and home/end keys all work as one would expect.
The h, j, k, l, gg, and G key bindings all scroll in a vim-like manner.
The <Control-e>, <Control-y>, <Control-d>, <Control-u>, <Control-f>, and <Control-b> keys all scroll vertically by various amounts.

Bookmarks

Press B to bookmark the current page.
Press gb or gB to open the bookmarks page in the current tab or a new tab, respectively.


Last edited by elinkser; 02-14-2023 at 10:02 AM. Reason: :\o
elinkser is offline   Reply With Quote
Old 05-28-2023, 05:22 PM   #53
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
*** ALPINE 3.18 INSTALL ON KOBO CLARA HD (4.35.20400) ***

*** ALPINE 3.18 INSTALL ON KOBO CLARA HD (4.35.20400) ***


I. INSTALL KOREADER
https://www.mobileread.com/forums/sh...d.php?t=314220


II. DOWNLOAD PREREQUISITES

From your desktop, download alpine-minirootfs-3.18.0-armv7.tar.gz, fbink-xdamage.zip, libinput-touchscreen.zip, and xorg-kobo-touch.py.

$ wget https://dl-cdn.alpinelinux.org/alpin...0-armv7.tar.gz

$ git clone --recurse-submodules https://github.com/tux-linux/fbink-xdamage.git
$ cd fbink-xdamage/
$ sudo rm -R .git
$ tar zcvf fbink-xdamage.tgz fbink-xdamage/

$ wget https://github.com/xiamaz/libinput-t...ads/master.zip
$ mv master.zip libinput-touchscreen.zip

You can download NiMa's original instructions and xorg-kobo-touch.py from mobileread.com:
https://www.mobileread.com/forums/sh...d.php?t=336175
https://www.mobileread.com/forums/sh....php?p=4077882

Create a /mnt/onboard/shared/ folder on the Kobo and copy the above files to there.


III. CREATE/EDIT SUPPORT FILES ON KOBO

EDIT /mnt/onboard/.kobo/Kobo/Kobo eReader.conf (optional):
Code:
[ApplicationPreferences]
AIRPLANE_MODE=false
SideloadedMode=true
EDIT /mnt/onboard/.adds/nm/config.txt:
Code:
menu_item :main :USB Networking on :cmd_spawn :quiet:exec /mnt/onboard/opt/usbtoeth
    chain_success                      :dbg_toast          :Started USB networking
    chain_failure                      :dbg_toast          :Error 
menu_item :main :USB Networking off :cmd_spawn :quiet:exec /mnt/onboard/opt/usbtoethd
    chain_success                      :dbg_toast          :Stopped USB networking
    chain_failure                      :dbg_toast          :Error 

menu_item :main    :IP Address         :cmd_output         :500:/sbin/ifconfig | /usr/bin/awk '/inet addr/{print substr($2,6)}'

menu_item :main    :Dropbear (toggle)  :cmd_output         :500:quiet :/usr/bin/pkill -f "dropbear"
    chain_success:skip:5
    chain_failure                      :cmd_spawn          :quiet :/bin/mount -t devpts | /bin/grep -q /dev/pts || { /bin/mkdir -p /dev/pts && /bin/mount -t devpts devpts /dev/pts; }
    chain_success                      :cmd_spawn          :quiet :export HOME="/mnt/onboard/.adds/koreader/" && cd "$HOME" && /mnt/onboard/.adds/koreader/scripts/dropbear -E -R -p2222 >/mnt/onboard/.adds/koreader/DropbearLog.txt  2>&1 
    chain_success                      :dbg_toast          :Started Dropbear server on port 2222
    chain_failure                      :dbg_toast          :Error starting Dropbear server on port 2222
    chain_always:skip:-1
    chain_success                      :dbg_toast          :Stopped Dropbox server on port 2222
    
menu_item : main: Dropbear Log :nickel_browser : modal :file:///mnt/onboard/.adds/koreader/DropbearLog.txt            
                                                                                                                                                                                                                                                                                                                                                                  menu_item : main : Orientation - LANDSCAPE - handle above : nickel_orientation: landscape
menu_item : main : Orientation - LANDSCAPE - handle below : nickel_orientation: inverted_landscape
menu_item : main : Orientation - PORTRAIT - handle on left : nickel_orientation: inverted_portrait
menu_item : main : Orientation - PORTRAIT - handle on right : nickel_orientation: portrait

menu_item :main    :HOST USB           :cmd_spawn          :quiet :sh /mnt/onboard/opt/otgon.sh
    chain_success                      :dbg_toast          :HOST USB 
    chain_failure                      :dbg_toast          :Error 
menu_item :main    :GADGET USB         :cmd_spawn          :quiet :/bin/echo gadget > /sys/kernel/debug/ci_hdrc.0/role
    chain_success                      :dbg_toast          :GADGET USB 
    chain_failure                      :dbg_toast          :Error 
menu_item :main    :USB role           :cmd_output         :500:/bin/cat /sys/kernel/debug/ci_hdrc.0/role

menu_item :main :User Xorg :cmd_spawn :quiet:exec /mnt/onboard/opt/uxorg-boot.sh
    chain_success                      :dbg_toast          :Started Xorg as non-root user
    chain_failure                      :dbg_toast          :Error 
menu_item :main :Xorg :cmd_spawn :quiet:exec /mnt/onboard/opt/xorg-boot.sh
    chain_success                      :dbg_toast          :Started Xorg
    chain_failure                      :dbg_toast          :Error
CREATE /mnt/onboard/opt/usbtoeth:
Code:
#!/bin/sh
insmod /drivers/mx6sll-ntx/usb/gadget/configfs.ko
insmod /drivers/mx6sll-ntx/usb/gadget/libcomposite.ko
insmod /drivers/mx6sll-ntx/usb/gadget/u_ether.ko
insmod /drivers/mx6sll-ntx/usb/gadget/usb_f_ecm.ko
insmod /drivers/mx6sll-ntx/usb/gadget/usb_f_eem.ko
insmod /drivers/mx6sll-ntx/usb/gadget/usb_f_ecm_subset.ko
insmod /drivers/mx6sll-ntx/usb/gadget/usb_f_rndis.ko
insmod /drivers/mx6sll-ntx/usb/gadget/g_ether.ko
ifconfig usb0 192.168.2.2
CREATE /mnt/onboard/opt/usbtoethd:
Code:
#!/bin/sh
ifconfig usb0 down
rmmod g_ether usb_f_rndis usb_f_ecm_subset usb_f_eem usb_f_ecm u_ether libcomposite configfs
CREATE /mnt/onboard/opt/otgon.sh:
Code:
#!/bin/bash
mount -t debugfs none /sys/kernel/debug
echo host > /sys/kernel/debug/ci_hdrc.0/role
CREATE /mnt/onboard/opt/uxorg-boot.sh:
Code:
#!/bin/sh
mount /mnt/onboard/alpine.img /mnt/user
mount -v --bind /mnt/onboard/shared /mnt/user/shared
mount -v --bind /dev /mnt/user/dev
mount -v --bind /dev/pts /mnt/user/dev/pts
mount -vt proc proc /mnt/user/proc
mount -vt sysfs sysfs /mnt/user/sys
mount -vt tmpfs tmpfs /mnt/user/run
mount -vt tmpfs tmpfs /mnt/user/tmp
mkdir /mnt/user/dev/shm
mount -vt tmpfs tmpfs /mnt/user/dev/shm
cp /etc/resolv.conf /mnt/user/etc
export DBUS_SESSION_BUS_ADDRESS NICKEL_HOME WIFI_MODULE LANG WIFI_MODULE_PATH INTERFACE
sync
killall -TERM nickel hindenburg sickel fickel fmon 2>/dev/null
chroot /mnt/user /bin/sh /uxorg-chroot.sh
CREATE /mnt/onboard/opt/xorg-boot.sh:
Code:
#!/bin/sh
mount /mnt/onboard/alpine.img /mnt/user
mount -v --bind /mnt/onboard/shared /mnt/user/shared
mount -v --bind /dev /mnt/user/dev
mount -v --bind /dev/pts /mnt/user/dev/pts
mount -vt proc proc /mnt/user/proc
mount -vt sysfs sysfs /mnt/user/sys
mount -vt tmpfs tmpfs /mnt/user/run
mount -vt tmpfs tmpfs /mnt/user/tmp
mkdir /mnt/user/dev/shm
mount -vt tmpfs tmpfs /mnt/user/dev/shm
cp /etc/resolv.conf /mnt/user/etc
export DBUS_SESSION_BUS_ADDRESS NICKEL_HOME WIFI_MODULE LANG WIFI_MODULE_PATH INTERFACE
sync
killall -TERM nickel hindenburg sickel fickel fmon 2>/dev/null
chroot /mnt/user /bin/sh /xorg-chroot.sh
CREATE /korenv.sh:
Code:
#!/bin/sh
export PATH=$PATH:/mnt/onboard/.adds/koreader/scripts:/mnt/onboard/.adds/koreader/plugins/terminal.koplugin/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/onboard/.adds/koreader/libs
export TERM=xterm
export HOME=/mnt/onboard/.adds/koreader/
cd $HOME
CREATE /mnt/onboard/.adds/koreader/scripts/chalpine.sh:
Code:
#!/bin/sh
mount /mnt/onboard/alpine.img /mnt/user
mount -v --bind /mnt/onboard/shared /mnt/user/shared
mount -v --bind /dev /mnt/user/dev
mount -vt proc proc /mnt/user/proc
mount -vt sysfs sysfs /mnt/user/sys
cp /etc/resolv.conf /mnt/user/etc
chroot /mnt/user/ /bin/sh
CREATE /mnt/onboard/.adds/koreader/scripts/chalpined.sh:
Code:
#!/bin/sh
umount /mnt/user/dev
umount /mnt/user/proc
umount /mnt/user/sys
umount /mnt/user/shared
umount /mnt/user

IV. SET UP TELNET/SSH CONNECTION FROM DESKTOP TO KOBO

You can use Telnet (need devmodeon for this) or SSH, by WiFi or over USB cable.
See NiMa's original instructions if unsure.

To connect desktop to Kobo by SSH over the USB cable, first start KOReader's SSH server.
You can also start the KOReader SSH server via NickelMenu.


V. CREATE CHROOT

Connect to your Kobo from your desktop by ssh or telnet:
e.g.
$ ssh root@192.168.2.2 -p 2222
OR
$ telnet <IP>
WHERE <IP> is the Kobo's IP address as given by "IP Address" entry in NickelMenu.

From desktop SSH session to Kobo, first back up the old alpine.img (if applicable):
# cd /mnt/onboard
# mv alpine.img alpineBKUP.img

Now create/edit 2GB disk image file (takes about 1min):
# dd if=/dev/zero of=/mnt/onboard/alpine.img bs=1M count=2048

Format the disk image:
# mke2fs -F /mnt/onboard/alpine.img

Mount the disk image:
# mount /mnt/onboard/alpine.img /mnt/user

Copy the Alpine Linux 3.18 root file system archive to the mounted disk image:
# cp shared/alpine-minirootfs-3.18.0-armv7.tar.gz /mnt/user/

Extract the root file system:
# cd /mnt/user
# tar zxvf alpine-minirootfs-3.18.0-armv7.tar.gz
# mkdir shared
# rm alpine-minirootfs-3.18.0-armv7.tar.gz
# cd /mnt/onboard

Switch to KOReader HOME and PATH environment:
# . /korenv.sh

Chroot to the new root file system:
# chalpine.sh

Connect your Kobo to WiFi (if not already connected) and and leave the WiFi menu open at the top of the screen.

Update the packages list:
# apk update

Install essential files (takes about 1min, 450MB):
# apk add alpine-sdk xorg-server-dev libx11-dev libxdamage-dev libxfixes-dev xorg-server xf86-video-dummy xvfb font-noto openbox xterm onboard xdotool tint2 python3 evtest xf86-video-fbdev

Build fbink-xdamage (takes about 5min):
# mkdir /home/root && cd /home/root
# cp /shared/fbink-xdamage.tgz .
# tar zxvf fbink-xdamage.tgz
# cd fbink-xdamage/
# make

Build libinput-touchscreen:
# cd /home/root/
# apk add eudev eudev-hwids xf86-input-libinput libinput-tools xinput libinput-dev eudev-dev
# cp /shared/libinput-touchscreen.zip .
# unzip libinput-touchscreen.zip
# cd libinput-touchscreen-master/
# make

Copy xorg-kobo-touch.py:
# cd /home/root/
# cp /shared/xorg-kobo-touch.py /home


VI. CREATE USER AND INSTALL PACKAGES

# adduser myuser
# echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories
# apk update
# apk add sudo bash tzdata xmessage nano mc lynx elinks xvkbd svkbd qterminal qpdfview netsurf featherpad tigervnc-client x11vnc openssh-server pcmanfm drawing lxterminal w3m w3m-image
# df -h
Filesystem Size Used Available Use% Mounted on
/dev/loop2 2.0G 730.3M 1.2G 38% /


VII. CREATE/EDIT CONFIG FILES IN CHROOT

Create/edit the following files in /:

CREATE /uxorg-chroot.sh:
Code:
#!/bin/sh
export HOME=/home/root
mkdir /tmp/root
udevd -d
sleep 2
udevadm trigger
sleep 2
X -dpi 250 &
cd /home/root/fbink-xdamage
sleep 3
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/root/fbink-xdamage/FBInk/Release/; env DISPLAY=:0 ./fbink_xdamage &
sleep 3
cd /home/myuser
DISPLAY=:0  /usr/local/bin/libinput-touchscreen &
#evtest --grab /dev/input/event1 > evtest-log &
#sleep 1
#while true; do python3 /home/xorg-kobo-touch.py ; done &
#sleep 1
echo 20 > /sys/class/backlight/mxc_msp430.0/brightness
DISPLAY=:0 sudo -u myuser openbox &
DISPLAY=:0 sudo -u myuser tint2 &
DISPLAY=:0 qterminal  --geometry 1400x620+20+60  &
# ***NOTE qterminal runs as root to get around terminal bug***
DISPLAY=:0 sudo -u myuser  netsurf --window_width 1400 --window_height 620 --window_x 20 --window_y 60 --font_size 192 --scale 150 &
DISPLAY=:0 sudo -u myuser  svkbd-mobile-intl -g 1400x320+20+700 &
#DISPLAY=:0 sudo -u myuser onboard -y 750 --size 1000x300 &
#DISPLAY=:0 sudo -u myuser  featherpad  --geometry 1400x620+20+60  &
#DISPLAY=:0 sudo -u myuser  vncviewer -geometry 1400x960+20+60 192.168.43.9  &
#/usr/sbin/sshd &
CREATE /xorg-chroot.sh:
Code:
#!/bin/sh
export HOME=/home/root
mkdir /tmp/root
udevd -d
sleep 2
udevadm trigger
sleep 2
X -dpi 250 &
cd /home/root/fbink-xdamage
sleep 3
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/root/fbink-xdamage/FBInk/Release/; env DISPLAY=:0 ./fbink_xdamage &
sleep 3
cd /home/root
DISPLAY=:0  /usr/local/bin/libinput-touchscreen &
#evtest --grab /dev/input/event1 > evtest-log &
#sleep 1
#while true; do python3 /home/xorg-kobo-touch.py ; done &
#sleep 1
echo 20 > /sys/class/backlight/mxc_msp430.0/brightness
DISPLAY=:0 openbox &
DISPLAY=:0 tint2 &
DISPLAY=:0 qterminal  --geometry 1400x620+20+60  &
DISPLAY=:0 netsurf --window_width 1400 --window_height 620 --window_x 20 --window_y 60 --font_size 192 --scale 150 &
DISPLAY=:0 svkbd-mobile-intl -g 1400x320+20+700 &
#DISPLAY=:0 onboard -y 750 --size 1000x300 &
#DISPLAY=:0 featherpad  --geometry 1400x620+20+60  &
#DISPLAY=:0 vncviewer -geometry 1400x960+20+60 192.168.43.9  &
#/usr/sbin/sshd &

Create/edit in /home/root/:

CREATE .bashrc:
Code:
source /home/root/.profile
HISTCONTROL=ignoreboth
shopt -s histappend
CREATE .profile:
Code:
alias ls='ls --color=never'
alias grep='grep --color=never'
Copy to /home/myuser/:

# cp -r /home/root/.bashrc /home/myuser/

# chown -R myuser:myuser /home/myuser/.bashrc

# cp -r /home/root/.profile /home/myuser/

# chown -R myuser:myuser /home/myuser/.profile


Create/edit settings in /home/root/.config/:

# mkdir /home/root/.config/

# cd /home/root/.config/

# mkdir gtk-3.0/

CREATE gtk-3.0/gtk.css:
Code:
scrollbar slider {min-width: 50px;}
scrollbar slider {min-height: 50px;}
{ 
    font-family: "Noto Sans"; 
    font-size: 24px; 
}
CREATE gtk-3.0/settings.ini:
Code:
[Settings]
gtk-font-name=Noto Sans Regular 18

# mkdir libinput-touchscreen/

CREATE libinput-touchscreen/config:
Code:
# Format: <BORDER|GESTURE|TAP> <DIRECTION:N,S,E,W,X> <NUM_FINGER>
MOVEMENT S 2
    xdotool key Page_Up
MOVEMENT N 2
    xdotool key Page_Down
MOVEMENT E 2
    xdotool click 3
MOVEMENT W 2
    xdotool click 3
TAP X 3
    xdotool key Ctrl+Shift+g
CREATE libinput-touchscreen/dims.txt:
Code:
0.000000 1448.000000  # X dimensions
0.000000 1072.500000  # Y dimensions

# cp /home/root/libinput-touchscreen-master/libinput-touchscreen /usr/local/bin/


Edit in /etc/ (using just "visudo" command to edit /etc/sudoers):

sudoers:
Code:
##
## User privilege specification
##
root ALL=(ALL:ALL) ALL
myuser ALL=NOPASSWD: /bin/login                                                        
myuser ALL=NOPASSWD: /sbin/poweroff                                                    
myuser ALL=NOPASSWD: /usr/bin/killall
myuser ALL=NOPASSWD: /usr/local/bin/libinput-touchscreen
##
Edit in /etc/udev/hwdb.d/:

60-evdev.hwdb:
Code:
# Sort by brand, model
evdev:input:b0000v0000p0000*
 ID_INPUT=1
 ID_INPUT_TOUCHSCREEN=1
 EVDEV_ABS_00=::12
 EVDEV_ABS_01=::12

Edit taskbar icon settings:

# cd /usr/share/applications/

# cp xvkbd.desktop svkbd.desktop

# cp xvkbd.desktop xdodd.desktop

# cp xvkbd.desktop xdorc.desktop

EDIT onboard.desktop
Code:
[Desktop Entry]
Exec=onboard -x 20 -y 700 --size 1400x320 &
Icon=onboard
EDIT svkbd.desktop
Code:
[Desktop Entry]
Exec=svkbd-mobile-intl -g 1400x320+20+700
Icon=svkbd
EDIT qterminal.desktop
Code:
[Desktop Entry]
Exec=qterminal --geometry 1400x620+20+60
Icon=qterminal
EDIT featherpad.desktop
Code:
[Desktop Entry]
Exec=env QT_FONT_DPI=175 featherpad %U
Icon=featherpad
EDIT netsurf.desktop
Code:
[Desktop Entry]
Exec=netsurf --scale 150
Icon=netsurf
EDIT vncviewer.desktop
Code:
[Desktop Entry]
Exec=/usr/bin/vncviewer -geometry 1400x960+20+60 192.168.43.1:5900
Icon=tigervnc
EDIT xdodd.desktop
Code:
[Desktop Entry]
Exec=xdotool sleep 2 mousedown 1 sleep 4  mouseup 1
Icon=xfce-wm-unmaximize
EDIT xdorc.desktop
Code:
[Desktop Entry]
Exec=xdotool sleep 2 mousemove_relative -- 60 0 click 3
Icon=wmtweaks

Exit the chroot environment

# sync

# exit

# chalpined.sh



VIII. FIRST STARTUP OF XORG FROM NICKEL MENU


From NickelMenu, select "landscape" orientation (Orientation - LANDSCAPE - handle above).

Connect your Kobo to WiFi internet (if not already connected) and and leave the WiFi menu open at the top of the screen.

From NickelMenu, select "Xorg". After a few seconds, you should see the keyboard and browser.

From desktop SSH session to Kobo, chroot to the Alpine root file system:
(You don't use the chalpine.sh script since the mounts are done by the NickelMenu command.)

# chroot /mnt/user /bin/sh


Update the hwdb binary file on-disk, and trigger a reload of all properties on your device:

# udevadm hwdb --update

# udevadm trigger /sys/class/input/event1


Edit the remaining configuration files:

# cd /home/root/.config

# mkdir openbox/

# cp /etc/xdg/openbox/*.xml openbox/

EDIT openbox/rc.xml:
Code:
</dock>
<keyboard>
<keybind key="C-S-g">
<action name="ToggleShowDesktop"/>
</keybind>
(*removed Ctl-U binding as it interferes with nano editor.)

CREATE netsurf/Choices:
Code:
font_size:192
accept_language:en
block_advertisements:1
send_referer:0
animate_images:0
enable_javascript:1
url_suggestion:0
window_x:20
window_y:60
window_width:1400
window_height:620
toolbar_status_size:6673
button_type:3
disable_popups:1
toolbar_items:back/history/forward/reloadstop/url_bar/copy/paste/zoomplus/zoomminus
bar_show:menu/tool

# cp tint2/t/nt2rc tint2/tint2rc

EDIT tint2/tint2rc:
Code:
###
#-------------------------------------
# Panel
panel_items = S:L::C::T:
panel_size = 100% 60
###
panel_position = top center horizontal
###
#-------------------------------------
# Launcher
###
launcher_icon_size = 48
###
launcher_item_app = onboard.desktop           
launcher_item_app = svkbd.desktop          
launcher_item_app = lxterminal.desktop 
launcher_item_app = qterminal.desktop 
launcher_item_app = com.github.maoschanz.drawing.desktop
launcher_item_app = featherpad.desktop
launcher_item_app = netsurf.desktop
launcher_item_app = vncviewer.desktop
launcher_item_app = xdodd.desktop
launcher_item_app = xdorc.desktop 
###
#-------------------------------------
# Clock
time1_format = %H:%M  
#time2_format = %A %d %B
time1_timezone = EST
time1_font = NotoSans Bold 32
clock_font_color = #ffffff 320
###
clock_lclick_command = xmessage  -geometry 400x100+500+70  -fn -*-fixed-*-*-*-*-32-*-*-*-*-*-iso8859-*   Charge Level :   `cat /sys/class/power_supply/mc13892_bat/capacity`
###

Copy configuration files to /home/myuser/:

# cp -r /home/root/.config/ /home/myuser

# chown -R myuser:myuser /home/myuser/.config


Install some extra icons:

# cd /home/root/

# wget https://dl-cdn.alpinelinux.org/alpin...-4.12.3-r0.apk

# tar zxvf xfwm4-4.12.3-r0.apk

# cp ./usr/share/icons/hicolor/scalable/actions/* /usr/share/icons/hicolor/scalable/apps/

# cp ./usr/share/icons/hicolor/scalable/apps/* /usr/share/icons/hicolor/scalable/apps/


Set up SSH server:

# ssh-keygen -A

# /usr/sbin/sshd

# ifconfig
eth0 inet addr:192.168.43.240 Bcast:192.168.43.255 Mask:255.255.255.0

# passwd

(and test from desktop "ssh root@192.168.43.240")

* Edit: This didn't actually work, but "ssh myuser@192.168.43.240" did.


** Not running sshd from the startup scripts anymore because was getting errors.
Manually invoking sshd after startup is more reliable.

Exit the chroot environment
(You don't use the chalpined.sh script since we will poweroff from the Kobo.)

# sync

# exit

# exit
Connection to 192.168.2.2 closed.
$


On the Kobo, minimize or kill the Netsurf browser and use the terminal to poweroff:

# sync

# poweroff



IX. FIRST STARTUP OF USER XORG FROM NICKEL MENU


Power on the Kobo.

From NickelMenu, select "landscape" orientation (Orientation - LANDSCAPE - handle above).

Connect your Kobo to WiFi internet and and leave the WiFi menu open at the top of the screen.

From NickelMenu, select "User Xorg". After a few seconds, you should see the keyboard and browser.

# ***NOTE qterminal runs as root to get around terminal bug***

On the Kobo, minimize or kill the Netsurf browser and use the terminal to poweroff:

# sync

# sudo poweroff

* Edit:"sudo" not needed from root terminal



X. BACKUP YOUR KOBO ALPINE LINUX CHROOT

Connect to your Kobo from your desktop by ssh or telnet:
e.g.
$ ssh root@192.168.2.2 -p 2222
OR
$ telnet <IP>
WHERE <IP> is the Kobo's IP address as given by "IP Address" entry in NickelMenu.

From desktop SSH session to Kobo, first back up support files to /mnt/onboared/shared/ folder:

# cd /mnt/onboard/shared
# cp /mnt/onboard/.adds/nm/config.txt .
# cp /mnt/onboard/opt/usbtoeth .
# cp /mnt/onboard/opt/usbtoethd .
# cp /mnt/onboard/opt/otgon.sh .
# cp /mnt/onboard/opt/uxorg-boot.sh .
# cp /mnt/onboard/opt/xorg-boot.sh .
# cp /korenv.sh .
# cp /mnt/onboard/.adds/koreader/scripts/chalpine.sh .
# cp /mnt/onboard/.adds/koreader/scripts/chalpined.sh .
# ls
alpine-minirootfs-3.18.0-armv7.tar.gz otgon.sh
chalpine.sh usbtoeth
chalpined.sh usbtoethd
config.txt uxorg-boot.sh
fbink-xdamage.tgz xfwm4-4.12.3-r0.apk
korenv.sh xorg-boot.sh
libinput-touchscreen.zip xorg-kobo-touch.py

Now mount chroot and backup files on chroot:

# cd /mnt/onboard
# mount /mnt/onboard/alpine.img /mnt/user/
# mkdir /mnt/user/backup
# cd /mnt/user/backup/
# cp -r /mnt/user/home/root/libinput-touchscreen-master/ .
# cp -r /mnt/user/home/root/fbink-xdamage/ .
# cp /mnt/user/uxorg-chroot.sh .
# cp /mnt/user/xorg-chroot.sh .
# cp /mnt/user/home/root/.bashrc .
# cp /mnt/user/home/root/.profile .
# cp -r /mnt/user/home/root/.config/ .
# cp /mnt/user/etc/sudoers .
# cp /mnt/user/etc/udev/hwdb.d/60-evdev.hwdb .
# mkdir usrshare
# cp -r /mnt/user/usr/share/applications/ ./usrshare/
# cp /mnt/user/home/root/xfwm4-4.12.3-r0.apk .
# mkdir usrshare/iconshicolorscalableapps
# cp /mnt/user/usr/share/icons/hicolor/scalable/apps/* usrshare/iconshicolorscalableapps/
# cp -r /mnt/onboard/shared .
# ls -a
. 60-evdev.hwdb usrshare
.. fbink-xdamage uxorg-chroot.sh
.bashrc libinput-touchscreen-master xfwm4-4.12.3-r0.apk
.config shared xorg-chroot.sh
.profile sudoers


Now backup the chroot:
# df -h
Filesystem Size Used Available Use% Mounted on
/dev/loop0 2.0G 784.9M 1.1G 41% /mnt/user
# cd /mnt/user
# tar zcvf /mnt/onboard/kobo-alpine318.tgz . # took 16 minutes
# cd /mnt/onboard
# umount /mnt/user
# ls -l kobo-alpine318.tgz # to see your newly created backup file, only 298MB
# sync
# exit
Connection to 192.168.2.2 closed.
$

$ zip alpine318.zip alpine.img




***
CAUTION: You know how Nickel does all that background work when you connect USB cable to desktop, click "connect", then later unmount?

Well, there may be a risk of data corruption if you had a loop mounted file, e.g. Alpine chroot.
https://www.mobileread.com/forums/sh...38&postcount=2

So better don't try this. But if you DO connect a USB cable, either exit the chroot and unmount the loop first, OR click "cancel" and use SSH/Telnet networking instead. (I have done this for months.)
***

Last edited by elinkser; 10-19-2023 at 05:05 PM. Reason: scrollbar height, dpi 250 for titlebar height, backup section,no Ctl-U
elinkser is offline   Reply With Quote
Old 06-02-2023, 05:59 PM   #54
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
XI. ADD SOME APPS

XI. ADD SOME APPS


Add dbus to get onboard keyboard working:

# apk add dbus

* Edit: actually, "apk add dbus-x11" and onboard runs reliably from chroot session startup, even without the "dbus-run-session" prefix.
# apk add dbus-x11
I believe you can check status with:
# echo $(dbus-launch)

If you want onboard as the default keyboard:

nano -l /uxorg-chroot.sh:
25 #DISPLAY=:0 sudo -u myuser svkbd-mobile-intl -g 1400x320+20+700 &
...
26 DISPLAY=:0 sudo -u myuser onboard -l Small -x 20 -y 720 --size 1400x340 &

# nano -l /usr/share/applications/onboard.desktop
139 Exec=onboard -l Small -x 20 -y 720 --size 1400x340 &

(You can invoke this keyboard from the launcher bar, but you kill it from the lower left corner menu button on the onboard keyboard, after pressing the "12?" key in the "Small" layout)
While we're in the menu layout, the "cross" key at the right lets you hide the onboard keyboard.
Also you can move the keyboard by holding and dragging the "4-directions" key.

While we're in Onboard Preferences:

From General -> Desktop Integration, select "Show floating icon...", deselect "Show tooltips..."

From Layout -> Core layouts, select "Small"

From Keyboard -> Key Behaviour, deselect "Upper case on right-click"



Add word processor abiword with its epub plugin:

# apk add abiword-plugin-epub

First run abiword to set preferences:

# abiword

When you're presented with these gigantic dialog windows that are too big for the display, you click on the right-click launcher bar button, then the dialog window's titlebar, select "resize", then drag from anywhere on the window closest to the corner you want to drag from.

First resize and drag window.

From menu, select View -> Web Layout.

From View -> Toolbars, deselect toolbars.

From View -> Zoom, select Page Width.

From Edit -> Preferences, deselect Spell Checking and Smart Quotes.

From Format -> Font, select Monospace Bold 16 (maximize window if necessary).

# abiword Kipling_Rudyard-Just_So_Stories.epub

After a couple of moments (OK more than a minute) the epub appeared in abiword, with cover illustration.
The svkbd is better than the onboard keyboard for this with its PageUp/PageDown key layout that actually stays on screen after each keypress.
CORRECTION: from the 12? layout, you just have to tap the Fn key twice to get the PgUp/PgDn layout to persist.
Likewise, you can get the caps layout to persist by double tapping the Caps key.


Now add a more lightweight epub reader and image viewer:

# apk add epy
# apk add feh

Navigate with k/j for Up/Down, h/l (or Left/Right) for PgUp/PgDn, c to change color, o to view images with the feh image viewer, and q to quit:

# epy Kipling_\ Rudyard\ -\ Just\ So\ Stories.epub

Add mouse support (supposedly to go forward or back by tapping right or left sides of page, but in practice, our two-finger swipes for PgUp/PgDn are more reliable anyway):
# nano -l .config/epy/configuration.json
6 "PageScrollAnimation": false,
7 "MouseSupport": true,

From the project page, we can see some nicer color settings:
https://github.com/wustho/epy

I got nice epaper-like results with the following:
"DarkColorFG": 231,
"DarkColorBG": 232,

This ereader app is responsive and pleasant to look at with the right color setting (see above).
It can even be invoked with "epy -r" to see the last read ebook, or e.g. "epy 5" to select the fifth ebook on the list.
If you invoke it with "epy kipling" it supposedly grabs an ebook that has the word "kipling" in it.


Add a spreadsheet program:

# apk add gnumeric

Invoke it with scaling:

# GDK_DPI_SCALE=1.5 gnumeric

Go in the View->Toolbars menu to deselect the toolbars.

Tap the right-click button from the launcher, then click on the title bar of the gnumeric app to resize its window.

Now add a more lightweight calculator:

# apk add mate-calc

Scale the window:
# GDK_DPI_SCALE=1.5 mate-calc


Install a webkit-based browser from the armhf repository:

Remember this faint glimmer of success in installing an armhf-architecture luakit browser package?

Well we never had as good a result with our attempts to install a native armv7 webkit-based browser, so let's try again with our armhf candidates, luakit and midori.

$ wget https://dl-cdn.alpinelinux.org/alpin...t-2.3.3-r0.apk

Copy the above file to the /mnt/onboard/shared/ folder on the Kobo.

# df -h
Filesystem Size Used Available Use% Mounted on
/dev/loop0 2.0G 828.7M 1.1G 43% /

# apk add luajit
# apk add libsoup
# apk add webkit2gtk
# apk add lua5.1
# apk add ldoc
# apk add mesa-dri-gallium

# cd /home/myuser/
# cp /shared/luakit-2.3.3-r0.apk .
# tar zxvf luakit-2.3.3-r0.apk
# cp usr/bin/luakit /usr/bin/
# cp -r usr/lib/luakit/ /usr/lib/
# cp -r usr/share/luakit/ /usr/share/
# cp usr/share/applications/luakit.desktop /usr/share/applications/
# cp usr/share/pixmaps/luakit.* /usr/share/pixmaps/
# cp -r etc/xdg/luakit/ /etc/xdg/

EDIT /etc/xdg/luakit/theme.lua
Code:
-- Default settings
theme.font = "32px monospace"
theme.fg = "#fff"
theme.bg = "#000"
---
-- Follow mode hints
theme.hint_font = "32px monospace, courier, sans-serif"
First run luakit to set preferences:

# luakit

Enter ":settings", and let status bar go to 100% (can enter "r" to reload settings page).

Enter ESC and SPACE or SHIFT-SPACE to scroll, or "/" to search, then "zoom", and ENTER.

Set webview.zoom_level to "200" or whatever zoom level you want.

Enter ESC then hit SPACE repeatedly until you get to window.new_window_size
Set it to "1420x600"

Enter ESC and ":q" to save settings.

# luakit www.mobileread.com

Check the following site out for how to block adds and run noscript.

From https://trisquel.info/es/forum/confi...luakit-browser :
The 30 most useful keyboard shortcuts on luakit:
1. j - scroll page down a line
2. k - scroll page up a line
3. h - scroll page left
4. l - scroll page to the right
5. space - scroll down a full page
6. shift-space - scroll up a full page
7. gg - go to top of page
8. shift-g - go to bottom of page
9. [number]% - go to some percent of the page. Example - 50% - go to the halfway point of the page. 100% - go to the bottom of the page. 0% go to the top.
10. zi - zoom in
11. zo - zoom out
12. zz - reset zoom to default. If you put a number first, such as "150zz", then you will zoom that percent
13. shift-y - copy the current page's URL to the clipboard
14. shift-o - edit the current page's URL and go to the edited URL
15. o - open a URL
16. t - open a URL in a new page (t-Enter will open a new blank tab)
17. shift-t - open a URL based on the current page's URL in a new tab
18. shift-h - go back in browser history. "4-Shift-h" would go back 4 places in browser history
19. shift-l - go forward a spot in browser history. "4-Shift-l" would go forward 4 spots
20. shift-j - go to the next tab
21. shift-k - go to the previous tab
22. d - close the current tab
23. gh - open the home page
24. gy - duplicate th current tab
25. r - reload the page (shift-r - disregard the cache and reload the current page)
26. ctrl-c - stop loading the current tab
27. zq - quit without saving the session
28. zz - quit and save the session
29. shift-b - add a bookmark for the current page
30. gb - open the bookmarks manager

Don't forget Space and BackSpace to PageDown and PageUp.

Adblock (EasyList) and noscript made a HUGE difference in performance.
Now this browser is as usable as netsurf (on certain pages) but more fully featured.
The two-fingered scrolling doesn't seem to work (it actually seems to zoom the page, but only one direction!), but I run it unmaximized, using PageUp/PageDown keys from the svkbd keyboard.
Actually, ONE-fingered scrolling kind of works (for maximized window browsing) when it wants to.


# df -h
Filesystem Size Used Available Use% Mounted on
/dev/loop0 2.0G 993.9M 919.5M 52% /


Now for the midori browser. First try installing the stock midori:

# apk add midori

# midori https://www.mobileread.com

Kind of sluggish. Looks like luakit is still #1 for now.

# apk del midori

# df -h
Filesystem Size Used Available Use% Mounted on
/dev/loop0 2.0G 1003.0M 910.4M 52% /

If you want you can install the armhf rootfs instead of armv7 (remember to install mesa-dri-gallium to get the luakit window to display consistently):
wget https://dl-cdn.alpinelinux.org/alpin...0-armhf.tar.gz
I did not find it better - midori slow and not rendering, epiphany not running.


***

How about some sharper-looking icons for our right-click and drag-and-drop launcher bar functions:

Convert /usr/share/onboard/layouts/images/right-click.svg and /usr/share/onboard/layouts/images/hover-click.svg to png format using desktop image program.

For example:
Open svg file in Gimp.
Colors->Invert to change color to white.
File->Export As->Select File Type (By Extension)
And export as PNG Image.

# cp /usr/share/onboard/layouts/images/right-click.png /usr/share/icons/

# cp /usr/share/onboard/layouts/images/hover-click.png /usr/share/icons/

# nano -l /usr/share/applications/xdodd.desktop
4 Icon=hover-click

# nano -l /usr/share/applications/xdorc.desktop
4 Icon=right-click


Add our new apps to launcher bar if needed:

# nano -l /usr/share/applications/mate-calc.desktop
236 Exec=GDK_DPI_SCALE=1.5 mate-calc
238 Icon=gcr-smart-card

# nano -l /usr/share/applications/gnumeric.desktop
235 Exec=GDK_DPI_SCALE=1.5 gnumeric %U

# nano -l /usr/share/applications/qterminal.desktop
3 Icon=lxterminal


EDIT /home/root/.config/tint2/tint2rc:
Code:
###
#-------------------------------------
# Launcher
###
launcher_icon_size = 48
###
launcher_item_app = onboard.desktop           
launcher_item_app = svkbd.desktop          
#launcher_item_app = lxterminal.desktop 
launcher_item_app = qterminal.desktop 
#launcher_item_app = com.github.maoschanz.drawing.desktop
#launcher_item_app = pcmanfm.desktop
launcher_item_app = featherpad.desktop
#launcher_item_app = mate-calc.desktop
#launcher_item_app = gnumeric.desktop
#launcher_item_app = abiword.desktop 
launcher_item_app = netsurf.desktop
launcher_item_app = luakit.desktop 
#launcher_item_app = vncviewer.desktop
#launcher_item_app = gtans.desktop
launcher_item_app = xdodd.desktop
launcher_item_app = xdorc.desktop 
###
* Abiword only seems to work properly invoked from the comnand line, not the launcher.

# nano -l /home/root/.config/lxterminal/lxterminal.conf
2 fontname=Monospace 24
(This is to have a big font for running epy ereader by "lxterminal -e epy".)

And since we have so many apps now, let's finally enable the openbox menu, accessed by right-clicking on the desktop background (i.e. by launcher bar button or 2-finger left/right swipe):

(Note: you can also run sync or sudo poweroff from pcmanfm file manager menu:
e.g.:
Tools->Run a Command in Current Folder...
Enter a command to run:
sudo poweroff)


EDIT /home/root/.config/openbox/menu.xml :
Code:
<?xml version="1.0" encoding="UTF-8"?>

<openbox_menu xmlns="http://openbox.org/3.4/menu">

<menu id="apps-accessories-menu" label="Accessories">
  <item label="Svkbd">
    <action name="Execute">
      <command>svkbd-mobile-intl -g 1400x320+20+700</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
  <item label="Onboard">
    <action name="Execute">
      <command>onboard  -l Small -x 20 -y 720 --size 1400x340</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
</menu>

<menu id="apps-editors-menu" label="Editors">
  <item label="Featherpad">
    <action name="Execute">
      <command>featherpad --geometry 1400x620+20+60</command>
      <startupnotify>
        <enabled>yes</enabled>
        <wmclass>Featherpad</wmclass>
      </startupnotify>
    </action>
  </item>
  <item label="Abiword">
    <action name="Execute">
      <command>abiword --geometry 1400x620+20+60</command>
      <startupnotify>
        <enabled>yes</enabled>
        <wmclass>Abiword</wmclass>
      </startupnotify>
    </action>
  </item>
</menu>

<menu id="apps-term-menu" label="Terminals">
  <item label="Qterminal">
    <action name="Execute">
      <command>qterminal --geometry 1400x620+20+60</command>
    </action>
  </item>
  <item label="Lxterminal">
    <action name="Execute">
      <command>lxterminal</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
  <item label="Uxterm">
    <action name="Execute"><command>uxterm</command></action>
  </item>
  <item label="Xterm">
    <action name="Execute"><command>xterm</command></action>
  </item>
</menu>

<menu id="apps-net-menu" label="Internet">
  <item label="Netsurf">
    <action name="Execute">
      <command> netsurf --scale 150</command>
      <startupnotify>
        <enabled>yes</enabled>
        <wmclass>Netsurf</wmclass>
      </startupnotify>
    </action>
  </item>
  <item label="Luakit">
    <action name="Execute">
      <command>luakit</command>
      <startupnotify>
        <enabled>yes</enabled>
        <wmclass>Luakit</wmclass>
      </startupnotify>
    </action>
  </item>
  <item label="Vncviewer 192.168.43.52:5900">
    <action name="Execute">
      <command>vncviewer -geometry 1400x960+20+60 192.168.43.52:5900</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
</menu>

<menu id="apps-office-menu" label="Office">
  <item label="Calculator">
    <action name="Execute">
      <command>/bin/sh /usr/local/bin/mymate-calc.sh</command>
    </action>
  </item>
  <item label="Gnumeric">
    <action name="Execute">
      <command>/bin/sh /usr/local/bin/mygnumeric.sh</command>
    </action>
  </item>
</menu>

<menu id="apps-multimedia-menu" label="Multimedia">
  <item label="Epy">
    <action name="Execute">
      <command>lxterminal -e epy</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item> 
  <item label="Qpdfview">                                                     
    <action name="Execute">                                                   
      <command>qpdfview</command>                                             
      <startupnotify>                                                         
        <enabled>yes</enabled>                                                
      </startupnotify>                                                        
    </action>                                                                 
  </item>                                                                     
  <item label="Gtans">
    <action name="Execute">
      <command>gtans</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
</menu>

<menu id="apps-fileman-menu" label="File Managers">
  <item label="PCMan File Manager">
    <action name="Execute">
      <command>pcmanfm</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
</menu>

<menu id="apps-graphics-menu" label="Graphics">
  <item label="Drawing">
    <action name="Execute">
      <command>drawing --new-window</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
</menu>

<menu id="system-menu" label="System">
  <item label="Openbox Configuration Manager">
    <action name="Execute">
      <command>obconf</command>
      <startupnotify><enabled>yes</enabled></startupnotify>
    </action>
  </item>
  <separator />
   <item label="Poweroff">
    <action name="Execute">
      <command>/bin/sh /usr/local/bin/mypoweroff.sh</command>
    </action>
  </item>  
</menu>

<menu id="root-menu" label="Openbox 3">
  <separator label="Applications" />
  <menu id="apps-accessories-menu"/>
  <menu id="apps-editors-menu"/>
  <menu id="apps-graphics-menu"/>
  <menu id="apps-net-menu"/>
  <menu id="apps-office-menu"/>
  <menu id="apps-multimedia-menu"/>
  <menu id="apps-term-menu"/>
  <menu id="apps-fileman-menu"/>
  <separator label="System" />
  <menu id="system-menu"/>
  <separator />
 
</menu>

Make scripts to enable menu to call mate-calc, gnumeric, and poweroff:

CREATE /usr/local/bin/mymate-calc.sh :
Code:
#!/bin/sh
env GDK_DPI_SCALE=1.5 mate-calc
CREATE /usr/local/bin/mygnumeric.sh :
Code:
#!/bin/sh
env GDK_DPI_SCALE=1.5 gnumeric
CREATE /usr/local/bin/mypoweroff.sh :
Code:
#!/bin/sh
sync && sudo poweroff


Also fix the scaling of the featherpad app:

EDIT /usr/share/applications/featherpad.desktop:
Code:
Exec=env QT_FONT_DPI=175 featherpad --geometry 780x330+5+30
CREATE /usr/local/bin/myfeatherpad.sh:
Code:
#!/bin/sh
env QT_FONT_DPI=175 featherpad --geometry 780x330+5+30
EDIT the "Editors" section of/home/root/.config/openbox/menu.xml
Code:
<menu id="apps-editors-menu" label="Editors">                          
  <item label="Featherpad">                                            
    <action name="Execute">                                            
      <command>/bin/sh /usr/local/bin/myfeatherpad.sh</command>               
      <startupnotify>                                                         
        <enabled>yes</enabled>                                                
        <wmclass>Featherpad</wmclass>                                         
      </startupnotify>                                                        
    </action>                                                                 
  </item>


MAKE SURE YOU PROPAGATE CHANGES TO THE USER ACCOUNT:

Copy configuration files to /home/myuser/:

# cp -r /home/root/.config/ /home/myuser

# chown -R myuser:myuser /home/myuser/.config


***

Mirror your phone or desktop keyboard output on the Kobo terminal screen, using the Linux "script" utility command:

-We already have hotplug USB keyboard capability in our chroot using a powered connector.

-We can use our phone or desktop keyboard to control our Kobo from a remote VNC or SSH client in an X desktop session.


But the unfortunately-named "script" utility in Linux allows you to share whatever you type in one terminal (e.g. in an SSH session from your phone to the Kobo) to be mirrored to a second terminal (a terminal running in your Kobo chroot).
Therefore, your phone keyboard input is transmitted to the Kobo screen.

The "script" program is part of the util-linux-misc package:

# apk add util-linux-misc

Run this from your Kobo to identify the terminal device:
# tty

Use the device info (e.g. "/dev/pts/1") in a command on the phone's SSH session to the Kobo to echo to that terminal:
# script -f /dev/pts/1

Now your keyboard input on your phone is mirrored to your Kobo.
You can even run vi, nano, mc, etc. this way.

(There is similar functionality in apps like screen, tmux, etc, but I didn't find they performed better for this particular purpose. Also, I found that all of them, including script, had much more lag when I tried to do the same trick in the KOReader terminal, as compared to in our Alpine chroot.)



***

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

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 ','/'.'.






***


Xournal is an application for notetaking, sketching, keeping a journal using a stylus:
https://xournal.sourceforge.net/


# apk add xournalpp
# apk add adwaita-icon-theme
# xournalpp

You have to enable touch drawing from the touchscreen section in preferences, or else touch will just pan the screen instead of drawing.

EDIT the "Multimedia" section of /home/root/.config/openbox/menu.xml to add an xournal item:
Code:
<menu id="apps-editors-menu" label="Editors">

  <item label="Xournal">
    <action name="Execute">
      <command>xournalpp</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>


Propagate your changes to the /home/myuser/ account:

# cp -r /home/root/.config/ /home/myuser

# chown -R myuser:myuser /home/myuser/.config

***

Last edited by elinkser; 09-18-2023 at 05:33 PM. Reason: ob menu, script term mirror,elinks keys,featherpad scaling,xournal
elinkser is offline   Reply With Quote
Old 06-08-2023, 03:27 PM   #55
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
XII. ADD SOME GAMES

XII. ADD SOME GAMES


Added a couple of terminal games that actually run better within the KOReader terminal.
See the end of this post for instructions:
https://www.mobileread.com/forums/sh...91&postcount=3


***

Adding a tangram puzzle game to our Alpine chroot:

Now that we have luakit browser, we can actually play online, e.g. at:
http://www.tangramonline.com/
(If you have configured noscript, you may need to toggle scripts ','-'t'-'s', followed by a refresh 'r'.)


But we can compile a native tangram app with a better user interface:

https://gtans.sourceforge.net/
Tangram :
The Tangram is a chinese puzzle. The object is to put seven geometric shapes together so as to form a given outline. All the pieces must be used and are laid next to one another. The pieces are five triangles, a square and a parallelogram:


From your Kobo chroot (or PC SSH connection), download, edit, and build the source package:
wget http://download.sourceforge.net/gtans/gtans-1.2.tar.gz

# cp gtans-1.2.tar.gz /home/root/

# cd /home/root

# tar zxvf gtans-1.2.tar.gz

# cd gtans-1.2/

# df -h
Filesystem Size Used Available Use% Mounted on
/dev/loop0 2.0G 1.0G 848.1M 56% /

# apk add gtk+2.0

# df -h
Filesystem Size Used Available Use% Mounted on
/dev/loop0 2.0G 1.0G 843.6M 56% /

# apk add gtk+2.0-dev

# df -h
Filesystem Size Used Available Use% Mounted on
/dev/loop0 2.0G 1.1G 752.3M 61% /


# pkg-config gtk+-2.0 --cflags
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/webp -I/usr/include/cairo -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/blkid -I/usr/include/pixman-1 -I/usr/include/libmount -I/usr/include/fribidi -pthread -I/usr/include/libpng16

# pkg-config gtk+-2.0 --libs
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lharfbuzz -lfontconfig -lgdk_pixbuf-2.0 -lcairo -lfreetype -lglib-2.0 -lintl -lpango-1.0 -lgobject-2.0


EDIT the following lines in the makefile:
# vi makefile
Code:
###
CFLG    =       -O2 -Wall -DGTK_ENABLE_BROKEN                                              
###
#CFLG    +=      -DTGTXT 
###
$(PROG): $(OBJ)                                                           
        $(CC) $(OBJ) $(LDFLG) `pkg-config gtk+-2.0 --libs ` -o $(PROG)             

###
#        cd po; make                                                       
###
callbacks.o: callbacks.c callbacks.h                                      
        $(CC) $(CFLG) -c callbacks.c `pkg-config gtk+-2.0 --cflags `               
                                                                                                                                interface.o: interface.c interface.h                                      
        $(CC) $(CFLG) -c interface.c `pkg-config gtk+-2.0 --cflags `               
                                                                                                                                                    
main.o: main.c main.h                                                     
        $(CC) $(CFLG) -c main.c `pkg-config gtk+-2.0 --cflags `                    
                                                                                                                                                    
support.o: support.c support.h                                            
        $(CC) $(CFLG) -c support.c `pkg-config gtk+-2.0 --cflags `                 
###
#        cd po; make DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) install           
###

EDIT the following lines in interface.c:
# nano -l interface.c
Code:
 29 /*  GtkAccelGroup *mgame_menu_accels; */
 33 /*  GtkAccelGroup *mprefs_menu_accels; */
 36 /*  GtkAccelGroup *mtans_menu_accels; */
 41 /*  GtkAccelGroup *mhitan_menu_accels; */
 46 /*  GtkAccelGroup *mbg_menu_accels; */
 58 /*  GtkAccelGroup *imsize_menu_accels; */
 63 /*  GtkAccelGroup *maccuracy_menu_accels; */
 70 /*  GtkAccelGroup *rotstp_menu_accels; */
 80 /*  GtkAccelGroup *mmisc_menu_accels; */
139 /*  mgame_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (mgame_menu)); */
163 /*  mprefs_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (mprefs_menu)); */
179 /*  mtans_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (mtans_menu)); */
211 /*  mhitan_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (mhitan_menu)); */
243 /*  mbg_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (mbg_menu)); */
333 /*  imsize_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (imsize_menu)); */
365 /*  maccuracy_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (maccuracy_menu)); */
# make clean

# make

# make install

Run the program:
# gtans

Note that the program crashes if we use the menu to configure the colors.
We can use the config file instead.

EDIT the following lines in .gtans/.gtansrc:
# vi /home/root/.gtans/.gtansrc
Code:
gTans v1.0 config file 1
ispx 0
pxcol 0 0 0
pxnam /usr/share/games/gtans/pixmaps/gtans_burtwood.xpm
ispx 0
pxcol 32896 32896 32896
pxnam /usr/share/games/gtans/pixmaps/gtans_brightburtwood.xpm
ispx 0
pxcol 65535 65535 65535
pxnam /usr/share/games/gtans/pixmaps/gtans_wood.xpm
Run the program again:
# gtans

Use the up/down arrow keys to change the figure in Figure text entry box.
Maximize the window, and have fun!



***

Rather than use the above kludge, we can use the updated debian source:

https://packages.debian.org/buster/gtans

Download the debian source and patch:

wget http://deb.debian.org/debian/pool/ma....0.orig.tar.gz

wget http://deb.debian.org/debian/pool/ma...99.0-2.diff.gz

On the desktop, apply the patch:

$ tar zxvf gtans_1.99.0.orig.tar.gz

$ gunzip gtans_1.99.0-2.diff.gz

$ mkdir gtans-1.99.0/debian

See what the "Makefile.in" file looks like before the patch:

$ nano -l gtans-1.99.0/data/Makefile.in
18 pkgdatadir = $(datadir)/@PACKAGE@

Apply the patch:

$ patch -p0 < gtans_1.99.0-2.diff

See what the "Makefile.in" file looks like after the patch:

$ nano -l gtans-1.99.0/data/Makefile.in
18 pkgdatadir = $(datadir)/games/@PACKAGE@

Bundle your newly patched source to gtans_1.99.0.tgz:

$ tar zcvf gtans_1.99.0.tgz gtans-1.99.0/

Copy gtans_1.99.0.tgz to your Kobo and build:
(Assuming you have done "apk add gtk+2.0-dev" and "make uninstall" from previous installation.)

# tar zxvf gtans_1.99.0.tgz

# cd gtans-1.99.0/

# ./configure

# make

# make install

# mv /usr/local/bin/gtans /usr/bin/

# gtans

(No more buggy menu behaviour.)


***

Debian changed their patch file system. For example:

https://packages.debian.org/bullseye/tuxpuck

Download the debian source and patch:

wget http://deb.debian.org/debian/pool/ma....2.orig.tar.gz

wget http://deb.debian.org/debian/pool/ma....debian.tar.xz

On the desktop, apply the patch:

$ tar zxvf tuxpuck_0.8.2.orig.tar.gz

$ cd tuxpuck-0.8.2/

Apply the patch (looks like we have to use a debian tool to patch this one because of the ".debian.tar.xz" format of the patch):

$ tar xvf ../tuxpuck_0.8.2-11.debian.tar.xz

$ dpkg-source -b .

(We will not be building tuxpuck due to other build issues.)


***

XBoard is a graphical user interface chess app:
https://www.gnu.org/software/xboard/

# apk add xboard
# xboard

EDIT the "Multimedia" section of /home/root/.config/openbox/menu.xml to add an xboard item:
Code:
<menu id="apps-multimedia-menu" label="Multimedia">
                                                            
  <item label="Xboard">
    <action name="Execute">
      <command>xboard</command>
      <startupnotify>
        <enabled>yes</enabled>
      </startupnotify>
    </action>
  </item>
Propagate your changes to the /home/myuser/ account:

# cp -r /home/root/.config/ /home/myuser

# chown -R myuser:myuser /home/myuser/.config

***
Attached Files
File Type: gz gtans-deb.tar.gz (277.6 KB, 59 views)

Last edited by elinkser; 09-19-2023 at 02:07 PM. Reason: used updated debian source for gtans; xboard
elinkser is offline   Reply With Quote
Old 07-26-2023, 08:59 PM   #56
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
XIII. EXTRA

XIII. EXTRA


* Security Note:
The Kobo is not intended for secure browsing uses such as banking and email.
If the outdated kernel, lack of fine-grained privilege separation, and insecure Telnet protocol were not enough, Opera Mini features:
1) A closed-source app, albeit downloaded from "trusted" official sources.
2) The introduction of a middleman in the form of Opera servers, although Opera states they are subject to Norwegian privacy laws.
This may be mitigated by the fact that you are running a dumbphone java app in an emulator, running in a virtual machine, running in a chroot, which won't have access to the filesystem unless you specifically enable it as shown later in this post to enable saved web pages for offline.


***


Save expensive data charges with Opera Mini on your Kobo:

On your Kobo:

# apk add openjdk7-jre
(about 50 MB)

Go to:
(Use your desktop or luakit browser because need javascript)
Installing Opera Mini on Your Computer
https://dev.opera.com/articles/insta...your-computer/
OR
# wget https://storage.googleapis.com/googl...ator-2.0.4.zip

Go to the Opera Mini download page, select “Opera Mini 8” and click on “View download link”. Then choose opera-mini-latest-advanced-en.jar to start the download.
https://www.opera.com/download/mobile-versions

NOW QUIT LUAKIT OR YOU WILL RUN OUT OF MEMORY/CPU!

# unzip microemulator-2.0.4.zip

# cd microemulator-2.0.4/

# java -jar microemulator.jar
Options->Select Device
Resizeable device
Options->Scaled display
x3
(This opens a second bigger window.)
* The key is to resize the first window(right click on top bar) to slightly less than 1/3 width and 1/3 height of available display dimensions (i.e. not including the top taskbar and one row of the svkbd keyboard which we will slide partly off the bottom to only expose the number keys.) Also have a magnifying glass handy, just for initial setup.

Running Opera Mini inside MicroEmulator

Now we will run Opera Mini inside MicroEmulator. Open MicroEmulator and go to File > Open MIDlet File…, then navigate to the location where you’ve saved the downloaded opera-mini-…-advanced-en.jar file and open it.

Then, click Start. Opera Mini will be installed and, after a minute, will do font data calculation for a few minutes.
Subsequently, its EULA is shown. Once you accept it (use the first window to click accept), the Opera Mini start screen is shown and you can start browsing!

If you are unable to move the second screen due to it being partly off screen, use the settings once you have Opera running or the "*#" command on the first window to set landscape mode temporarily so you can move it.
Then, Options->Scaled display
x3
Fonts don't work in landscape so unset it after moving.
* OK I lied. Just tap the screen and presto - fonts.

8 and 2 for forward and back. 4 and 6 for left and right.
Hit the # key for some shortcuts.
One-finger scrolling to avoid constantly minimizing /unminimizing the keyboard.
But mostly I leave the svkbd keyboard with only the top number row showing.

You may have to use the first window for accept buttons during initial setup.



***


You can avoid the extra step of selecting the Opera app from the File menu if we invoke it as:
# java -jar /home/myuser/microemulator-2.0.4/microemulator.jar opera-mini-8.0.35626-advanced-en.jar


But by adding an entry to our launcher bar and window manager menu, we can run it as unprivileged normal user, which is more secure than when we run it from the root terminal:

# cp /usr/share/applications/luakit.desktop /usr/share/applications/opera.desktop

EDIT /usr/share/applications/opera.desktop:
Code:
[Desktop Entry]                                                                                     
Name=OperaMini                                                                                      
Comment=Microemulator run Opera Mini                                                                
Exec=java -jar /home/myuser/microemulator-2.0.4/microemulator.jar opera-mini-8.0.35626-advanced-en.jar
Icon=xfce-wm-stick                                                                        
Type=Application
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;
EDIT /home/root/.config/tint2/tint2rc:
Code:
launcher_item_app = netsurf.desktop                      
launcher_item_app = luakit.desktop                       
launcher_item_app = opera.desktop                   
#launcher_item_app = vncviewer.desktop
EDIT the "Internet" section of/home/root/.config/openbox/menu.xml
Code:
  <item label="Opera">                                                 
    <action name="Execute">                                            
      <command>java -jar /home/myuser/microemulator-2.0.4/microemulator.jar opera-mini-8.0.35626-advanced-en.jar</command>
      <startupnotify>                                                              
        <enabled>yes</enabled>                                                     
        <wmclass>Opera</wmclass>                                                   
      </startupnotify>                                                             
    </action>                                                                      
  </item>

Propagate your changes to the /home/myuser/ account:

# cp -r /home/root/.config/ /home/myuser

# chown -R myuser:myuser /home/myuser/.config



***


* UPDATE - SAVE BATTERY LIFE BY ADDING ABILITY TO SAVE WEB PAGES FOR OFFLINE READING *
(Enables an Opera menu bar icon to save web pages for offline reading.)

EDIT /usr/share/applications/opera.desktop:
Code:
[Desktop Entry]                                                                                     
Name=OperaMini                                                                                      
Comment=Microemulator run Opera Mini                                                                
Exec=java -cp /home/myuser/microemulator-2.0.4/microemulator.jar:/home/myuser/microemulator-2.0.4/lib/microemu-jsr-75.jar org.microemu.app.Main --impl "org.microemu.cldc.file.FileSystem" opera-mini-8.0.35626-advanced-en.jar
...
EDIT the "Internet" section of/home/root/.config/openbox/menu.xml
Code:
  <item label="Opera">                                                 
    <action name="Execute">                                            
      <command>java -cp /home/myuser/microemulator-2.0.4/microemulator.jar:/home/myuser/microemulator-2.0.4/lib/microemu-jsr-75.jar org.microemu.app.Main --impl "org.microemu.cldc.file.FileSystem" opera-mini-8.0.35626-advanced-en.jar</command>
...

Propagate your changes to the /home/myuser/ account:

# cp -r /home/root/.config/openbox/menu.xml /home/myuser/.config/openbox/

# chown -R myuser:myuser /home/myuser/.config



***
Attached Files
File Type: jar opera-mini-8.0.35626-advanced-en.jar (310.2 KB, 46 views)
File Type: zip microemulator-2.0.4.zip (1.57 MB, 46 views)

Last edited by elinkser; 08-03-2023 at 09:58 PM. Reason: added save web page for offline, security note
elinkser is offline   Reply With Quote
Old 07-27-2023, 01:55 AM   #57
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
Does opera work reasonably? it's java...
Szybet is offline   Reply With Quote
Old 07-27-2023, 05:33 PM   #58
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
Quote:
Originally Posted by Szybet View Post
Does opera work reasonably? it's java...
It's pretty stable.I can start netsurf at the same time while running Opera with no issue.
Everything froze once when I left luakit running a javascript page while I tried to run Opera.

The microemulator itself starts in about 5 seconds.
Then I press start and Opera is ready to go in 25 seconds.
Then click Options->Scaled Display x3, and your screen size and placement is same as previous session.

If you set up the screen like in my previous post, it is perfectly usable and worth the install in my opinion.

Last edited by elinkser; 07-29-2023 at 07:49 AM.
elinkser is offline   Reply With Quote
Reply

Tags
kobo, linux, xorg


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PW3 Can run full blown Chromium browser on up-to-date Alpine Linux schuhumi Kindle Developer's Corner 58 11-18-2023 07:03 PM
Native [WIP]replacement firmware for Kindle/Kobo? zaoqi Kindle Developer's Corner 0 03-03-2019 04:38 AM
X apps run on native touch Xorg. geekmaster Kindle Developer's Corner 88 05-14-2014 07:58 AM
Kobo Support Nightmare: Aura with Blown Pixels geekspertise Kobo Reader 23 12-09-2013 10:25 PM
Portable Firefox (Run it off a USB Drive) Colin Dunstan Lounge 3 11-22-2004 07:42 PM


All times are GMT -4. The time now is 01:49 PM.


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