Skip to content

Latest commit

 

History

History
79 lines (62 loc) · 13.9 KB

script.md

File metadata and controls

79 lines (62 loc) · 13.9 KB

OTS means One Touch Start

I use OTS to start objects (all processes sshd, x11 ... and package installs) with One Touch in the Termux/Widget environment. So that it also works with a virgin Installation, mainly two scripts outside of Termux are needed (uu.sh and bashrc) and symlinks: ln -s /storage<> sd). Mostly is <>=/emulated/0 for internal storage or /xxxx-xxxx for a SD-card (using df to show).

In addition to Termux are also, X11 and other plugins are used. Typical is a mobile that is operated with the fingers, but may be connected to pstylus, mice and external keyboards. The scripts stored outside of termux (start with inside bash)) and to simplify use of it aliases are set t=bash .bashrc and t=bash uu.sh

MB_Helper in X11 Client

Das einsetzen der beiden *_HELPER in die EK fuktioniert gut aber die Anzeigen verschwindet leider oft, wenn die screen-configuration geändert wird. Ich habe x11-Version 4e7763b benutzt und auf zwei Geräten je drei shots gemacht mit denen das wiederholt werden kann.

  • Die ersten drei von einem Moto/Lenovo-phone. In den ersten beiden ist die einrichtung und Anzeige mit fluxbox+aterm XClients aber ohne Stylus. im dritten mit split-screen ohne Anzeige. Der gleiche Effekt kann auch durch einschalten eines fixen On-Screen-KB oder rotation in landscape erreicht werden. Die letzte x11-Version, die 'STYLUS_HELPER' auf dem Gerät erlaubte war 1e7857c. Es gibt auch ein Video zu dem Gerät in dem auch EK-Probleme zu sehen sind.
  • Die zweiten drei shots sind von einem Samsung-Pad mit Pop-View. Einrichtung wie zuvor und Anzeige mit beiden *_HELPER. In shot 2+3 verschwinden beide Menüs durch On- Screen-KB und PopView-Reduktion.

Damit die Menüs benutzt werden können müssen sie auf den Screen erscheinen. Wenn man den Algoritmus verstandene hat, können als workarround durch verschieben der Menüs diese nach einer Änderung der screen-configuration sichtbar bleiben. Man könnet die beiden *_HELPER auch als Pre/Post-MB-Selektionen betrachten. In dem Fall wäre auch keine Reduktion auf Stylus und Trackpad nötig.

... in progress - translation later see here too Eine Möglichkeit MB=Maus-Buttons ohne Maus (finger/stift) zu nutzen, ist die Erweiterung durch den EK_X5.h Header in der Quelle des XClients oder die Server Funktionen. Der Header macht mehr als dies, hier wird aber nur die MB Funktion beschrieben. Der Header kann mit main:(#define TEST 9 und #include "EK_X5.h") oder als Teil von z.B. aterm verwendet werden. Ich betrachte hier nur den TEST 9 Teil, der mit der touch.c Quelle durch bashrc erzeugt und gestartet werden kann (t t). Es wird dann nur das Window mit dem MB-Icon angezeigt. Zur Verwendung ein Video...

What is a touch, gesture and tap

A simple gesture begins with click/touch (4) and ends with the release (5) of the last button/finger/pen. In between, movements (6) can be made. Without move it calls tap There is the pointer (cross/arrow etc), the cursor (inside text), the mouse, fingers/stylus on touch-pads/screen and cursor buttons of extrakeys and keyboard. There are also three touchscreen input modes:14 (TIM) in X11. Mouse and finger events are treated differently. Compared to older versions, TIM=Simulated touchscreen:06 has to be a delay in the finger Touch+Move (gesture). Otherwise the whole gesture will be ignored. People with trembling fingers or who are used to rapid gestures like me, possibly have problems:11 with it.

I have not yet understood the reason for this change. The pointer is always hidden under the finger at this TIM, in contrast to TIM=Trackpad:06, where the pointer moves gesture in parallel to the finger-gesture and a long tap leads to the interrupt/end of the gesture. Alternatively use TIM=Direct touch, which not all XClients support or they've own multi-touch gestures (pinch etc) and this TIM is a bit unstable.

check via a PC and scrcpy

MTE=Multi-Touch Events:10 (Generic/Xinput2/35) are only recognized by TIM=Direct of XClients that support MTE and are not comparable to multi-click events (2 or 3 mouse buttons/4-6). My PC does not support this either. The three TIM settings can also be checked without XClient if the Pointer is shown as a cross. In the ekeys version, however, an Xclient is to start that generates this Pointer. In the extrakeys, the Preferenz setup that I use is to change the three TIM via the KB button. Then I use the PC mouse (circle+yellow+red) to move the Pointer. This corresponds to the finger move gesture and has a follow -up (Delay), which does not take place if the mouse is used on the pad/mobile.

Steps to repeat the installation (example moto-g7)
  1. The required installation data must be saved or downloaded in the Android environment. They contain the required apps/plugins, the uu.sh script (in apk) and object data with bashrc (in ip).
  2. Install the Termux app (in apk), open (bootstrap), allow the memory to be authorized and update the packages with pkg up -y. All 5 "Questions" should be confirmed with Enter. Virgin-Termux is thus ready to work as a basis with 3300 files in ~/u and the permission to ~/sd.
  3. The expansion of the plugins and packages left in ~ is carried out with:bash <>/uu.sh . - (below). At least the APK: api and one XServer (here x11a) are installed, if necessary. When archives/backups available, one of them can now be installed. Otherwise the packages of ssh and other usefull base tools will be installed, which are then about 5225 files in ~/u. The three apps: app+API+X11 without the sources now needs: 311+7.3+14.5=333 MB on the device. This can be 10-20 times larger due to the package requirements of an object. However, it is sufficient as a good Linux terminal. If the argument - is left out or replaced by an object name (default ip), this is set up as a link ~/i in which is ln -s i/bashrc .bashrc for new terminal that installs all packages needs by the object.

After download/installation of App+Plugin (apk) and bootstrap, will uu.sh used to one time Start with bash uu.sh . -. Then should the following symlinks exist: u,sd,i,.bashrc. The environment can be checked with alias pp;ll etc. If a backup extist (~/sd/t*.tgz), this may restored. The useage of the two scripts is displayed with aliases: u and t (without parameters).

to the script ~/.bashrc

It is divided in different sections but could use outside of termux as bash script (partially) too. The first Termux update contains several widget scripts ~/.shortcuts. In order to display this on the start screen (Long Tap) this must be set in the widget management of the mobile phone. The corresponding functions are somewhat different on my two devices. and api29 object

Virgin Termux (vt) update with pkg ... (pu) or *.tgz (tu)

This requires a *.apk (for example, termux_73 or my backup) and a first open (bash prompt) from Termux. To perform this section, there must be no i,sd file (will generated here) and the required data must be available on the phone in ~/sd. (including uu.sh, bashrc itself). This can be an sdcard or internal memory (sd=d) that can be used with termux-setup-storage in the script. For this are set up symlinks in ~/. Alternatively, a tar/*.tgz update can be used (below) if a *.tgz of a previous installation exists. This is much faster (15 seconds) than pkg.

Is $d assigned (see below) the update could start with:bash $d/ip/s $t.

bashrc

In general, it's part of the object and also a symlink ~/i/bashrc) (ln -s **sd/ip** i in ~ done by u . $name) and checks the state of the installation before the first prompt. more complex Presteps start severals closed PID do with first shell open in Termux:

  • start some processes (PID): sshd, Xvnc and/or possibly Xwayland (Xorg)
  • and set some aliases: pp to check PID, ll=ls -la to list files, d=du -hd 1 to check space
  • with $name the Path to ~/sd could changed, when several Objects on th device. default is ip on internal storage

uu sh

uu.sh is a script, that is usually not in the termux bootstrap. So it has to copied see above to ~ or symlinked to ~/sd/uu.sd. On of the first actions in bashrc is . uu.sh . . to check genaral states (independent from Object).

various test functions with alias u

since PATH also contains :., t is enough to call bash ~.bashrc $@. Without parameter,usage help is displayed or else the described function is executed. The two scripts parts listed above are ignored. s is legible, so here are just a few special features:

  • API dialogs/functions (need the installation of api plugin) started with t d (termux only)
  • LAN/DISPLAY adresses is estimated by the second parameter (without is DISPLAY=:1 and Xvnc as Xserver the default)
  • The third (second) parameter (above) identify a keychar like d (above) or tgz or files

tgz backup of termux installation

With t tgz you see a separat usage help.The most important function is to produce ~/sd/t.tgz from~/... The process can take 8 to 80 minutes. Subsequently, however, the Termux state can be quickly restored (above) if another Virgin-Termux is used or reinitialized after rm -r ../*. Since then ~/sd is no longer known you have to use the path d=/storage/6533-6333/; t=t in tar -xzf $d/$t.tgz -C ...

further funktions of alias u

"Elf-Check" is basically a script (part of the bootloop process) that separates the executables from the rest of the data into $ prefix and supplements Symlink.txt with these references. This does not change anything at the bootstrap, but can be used for all TargetsDK. In contrast to Android-10 and update flowered, only one Symlink is necessary.

MB_Helper in X11 Server

In the following video, the XClients fluxbox and aterm are displayed, the trouchMode Trackpad is selected and the device is moto g(7). x11-Version 1e7857c has a pre+post-MB display, which corresponds to the three mouse buttons 1=L,2=M,3=R. Finger-debug is on, Gboard is used as the KB and the back key is used to toggle the EK bar(lines here one), in which the EK-KB button turns on the floating KB (covers EK).

MB-toggle.mp4

Then: portrait rotation, which turns KB off. Then the two MB helpers are turned on with the first EK button. Post-MB over aterm and Pre-MB below and the floating KB is turned on (covers pre-MB and EK disappears). Next: a landscape rotation is made, which turns KB off again, post-MB disappears and EK covers pre-MB. If KB is turned on and changed to Fixed, pre-MB also disappears. After another portrait rotation, turning KB on and "Fixed", post-MB disappears but EK is back above the KB.

If the pre/post MB display always appears completely and can be used, this is a great feature!

Actually, I only need Pre-MB. It could also be used for all touchMode inputs (not just stylus) and multiple Pre-MB selections would also be an option. If there was then a one-time/permanent distinction, you wouldn't need a real mouse anymore. I will mainly work with Direct because it is the only way to make simple finger gestures. Alternative are XClient functions available.

Actually a real mouse ist only usable in X11-screen-area. So the use of Split/PopUp-Screen limits this mouse (new in x11-App) as well the MB-Helper. Previously the complete Device inclusive EK KB and other Apps like termux are reachable. By checks the reduced screen area leads to more visibility/reachable-Problems but the feature is still in progress.

In version 033ee16 Pre-MB-toggle (STYLUS_HELPER in Keyboard) doesn't work. showStylusClickOverride is toggled with two choices in Pointer setup (3/4). The function of stylusButtonContactModifierMode and showMouseHelper (6/7) is unclear. Some times MB_Helper are not movable with real mouse by a simple gesture. In case of Trackpad the finger and not pointer position is used like in EK bar.