View Single Post
Old 02-03-2023, 09:18 PM   #51
elinkser
Addict
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: 242
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