termux / termux-float

Termux add-on app to show the terminal in a floating terminal window.
https://f-droid.org/en/packages/com.termux.window
Other
465 stars 77 forks source link

Check of Modifications from Sept 2021 and open features #37

Closed RalfWerner closed 2 years ago

RalfWerner commented 3 years ago

check scenarios

The *Taskbar App examination, was very sobering if I compare this with PiP on my SM-P610, in which nothing is missing and that works very stable. That's why I've never used T:Float. For comparison and to fix possibly bugs of TfT (Taskbar-floating-T**ermux), I've this App (self-build with last updates from @agnostic-apollo) now installed on my Gigaset and tries to understand this App.

Float Readme is not very informative. The permission query after the installation is good (would be good also at T:Widget). First, I describe the check scenarios. The Float App is positioned on the Start Screen between Termux and Widget, so Termux can be started with all three Apps. The normal OTS open X11 with some XClients so that XServer and sshd Services exist and uniquely the process environment is logged. When Float starts from the start screen again, a fixed quarity picture appears without Extra-Keys (EK) but with OS-KB. The process list is supplemented by a bash that does not appear like widget processes in the Drawer process list. grafik

*) Taskbar on the one hand and Floating/Picture or Android Windows on the other hand are different topics. In the Taskbar App and with Android-with-PiP contained therein (11/SM-P610), both comes only together. On various App/Task Functions (Recent-Task-Key) gestures and much more, which has every phone, I do not go on details here and also the topic session/widget-lists currently has no relation to Float. Here are two more shots, from my Gigaset (above) without Split/PiP capability and the SM-P610: grafik

RalfWerner commented 3 years ago

OTS=One-Touch-Start is the Termux behavior that starts with one tap on the App-Icon (startscreen) all (closed) processes for X11 and other via .bashrc. Unfortunately, the description was deleted, to this and many other topics. So here again with:

echo '[ -z "$1" ]&& . uu.sh . .;t=$PREFIX/tmp X=Xwayland XDG_RUNTIME_DIR=$t;alias t="bash .bashrc"
c="am start -n com.termux" z="$c/.app.TermuxActivity" y="$c.x11/.MainActivity"; typeset -i i=0
z2="$z"; [ -n "$(pgrep m.termux.window)" ]&& z="$c/.window.TermuxFloatActivity"; export DISPLAY=:0
while [ -z "$(pgrep -o $X)" -a $i -lt 2 ];do $y; i+=1;sleep 1;$X :0>$t/TX 2>&1&
  $z;done;WM=fluxbox;[ "$1" = 0 ]&& $y;[ "$1" = 2 ]&& $z2;[ -z "$(pgrep -o $WM)" ]&& $WM&'>>.bashrc

will OTS set up or supplemented. Since Float is a separate app, it is displayed in parallel/over Termux but only once (no Window Manager like fluxbox in X11 above). OTS uses as X11-Toggle $y/$z by t 0|2, but $z would be replaced by Float (line 3), if tap on this App and would be displayed over X11. Otherwise Termux start standalone or by TfT, also be used simultaneously over X11 but very weak. Without Split and floating Termux X11-Toggle-Key should be part of EK.

The script uu.sh for OTS not necessary, but does some useful things like device check and double-u (ln -s ../usr u;alias u="bash uu.sh"). So with u ky the EK line(s) is to produced/toggled. Here the script extract with X11-Key (t 0) In line 5:

ky)t=~/.termux;[ ! -e $t ]&& mkdir $t; t+=/termux.properties; d=display; k=extra-keys;p=popup
 m=macro;sk="hide-soft-keyboard-on-startup=true soft-keyboard-toggle-behaviour=enable/disable"
 lf="{key:LEFT,$p:BKSP}"; ed="$p:{$m:'CTRL d',$d:d}"; eh="{key:END,$p:HOME}"; o=`grep one $t`
 nx="{key:ENTER,$p:{$m:'CTRL n',$d:'next'}}"; tp="{key:TAB,$p:PASTE}"; ek=$k-style=arrows-all
 kd="{key:KEYBOARD,$p:DRAWER}";x="{$d:X11,$m:'t SPACE 0 ENTER',$p:{macro:'ob ENTER',display:OB}}"
 mc="{$m:'mc SPACE i ENTER',$d:mc,$p:F10}" cd="{$m:CTRL,$d:'^',$ed}"; m="#"
 if [ "$o" != "" ];then k+="=[[ESC,SHFT,$kd,{key:'/',$p:{$d:'\\\\\\\\',macro:BACKSLASH}},{key:\
  '-',$p:'|'},UP,$nx,HOME,PGUP,$x],[ALT,$cd,$tp,{key:BKSP, $p:DEL},$lf,DOWN,RIGHT,END,PGDN,$mc]]"
 else k+="=[[$cd,$tp,$lf,{key:RIGHT,$p:{macro:'o ENTER',display:off}},{key:UP,$p:PGUP},\
  {key:DOWN,$p:PGDN},$eh,$nx,$kd,$mc,$x]]"; m="#one"
 fi ;printf '%s\n' $m $ek shortcut.next-session=ctrl+n $sk enforce-char-based-input=true "$k">$t
 termux-reload-settings; exit ;;

To toggle back you could open aterm in fluxbox and use command t 2 or other actions (e.g check). The current state of X11-EK contains bugs that do not allow proper update and implementation. Back Toggle to Float is not necessary because it is present at all screens. Therefore, with t 2 the standalone Termux is used.

Addendum Version to X11_02.06 without sharedUserId

This version does not use com.termux and can not be installed as an update, is independent of the Termux version and is started differently than the others. Unfortunately, both the Start and Installation process is more complicated, it almost always comes to cleaved the XClient processes and these are often only as zombies. X11 must be restarted much more often than in other versions. So I do not recommend this version. If you even try, several actions must be allowed in Termux and X11, the action: x=termux-x11; pkg in $x should not be made but echo "allow-external-apps=true">>.termux/t*.properties Currently the debug version app.debug is provided together with termux-x11.deb file. The start differs from the above described and takes about five instead of one second...

RalfWerner commented 2 years ago

Float window resize (LTP=Long-Tab+Pinch) in an Android-12 AVD emulation.

For this purpose, I created a pixel-5 emulation with studio and installed Termux-0.118.0 & Float-0.15.0. So far I used Android-11 and lower and had no resize success. @agnostic-apollo meant with 12 should the problem be fixed - but it is not (shots below). First of all the log of the standalone emulation:

D:\Android>cd sdk
emulator: Android emulator version 30.8.4.0 (build_id 7600983) (CL:N/A)
handleCpuAcceleration: feature check for hvf
added library vulkan-1.dll
emulator: INFO: userspace-boot-properties.cpp:249: Sending adb public key [QAAAAM9MOYbRxVPUupdzGu5E5A8px/9miiW3Ma7P4q3Gi1i21vRTP19pn4iYpSDNyxNf4t5xFre2U4TBkteOsdvf/8fFIjReqVzTZRfXCD4HEtv51vFvDmiqRjsonNOGiSZ0O6t/3CapmQ81/1TMOaa8VhyZvFdDZIMouyQmW0RwSLjCwbiCkIp79JHQXkhIeBoHdYOp3+1zwbRxKyXkvJ3Rb7OzYs+8mlLvUN4VfW5uvrWPoD0SOaAMzajKfZX3tFLDM7Mh5pggxto4/vb3svGoxpk41U0mt0UIRJTAE3vaDyLyzPE/xxkWg3WeBMU0F99OAdgfEwp3zjSvh9KYcfyBgXxJhRurU+on3ExDrLAFTGXoL8Rokci/mY2aNoxxAqywqr857Bq5HHKK/WpR5Q6rqwZqSSmTp9CJmo4TSV87RsE6kTTlyMwyE8ZyaO635dsN8GvtXWAudZp0HiSOwc8Aqr5xT76kEYtwE1jOqfm9hl1JWUuyoC6B1Qf3WzgH0cDvRJJ+/+zLtpB6NjjNL3h0jKyUOhiMoREVWnHhIMu1ORm9G0Vlwu+h8X81tUDTzQb5H7YekFbyB4PpL8/V+HXldqudRPFXRFG30cI6wPCceTORwJtxwDc6BlDCEN8nSN+hhaYe1DFIK0TzcWAcIsn9U7k9Y+g+++HRKDShRM+tJmcBBWZuAwEAAQA= @unknown]
Failed to open /qemu.conf, err: 2
HAX is working and emulator runs in fast virt mode.
emulator: INFO: GrpcServices.cpp:315: Started GRPC server at 127.0.0.1:8554, security: Local
emulator: INFO: EmulatorAdvertisement.cpp:93: Advertising in: C:\Users\th80wr\AppData\Local\Temp\avd\running\pid_12864.ini
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: INFO: boot completed
emulator: Increasing screen off timeout, logcat buffer size to 2M.
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
emulator: Revoking microphone permissions for Google App.
emulator: INFO: QtLogger.cpp:68: Critical: Uncaught TypeError: Cannot read property 'update' of undefined (qrc:/html/js/location-mock-web-channel.js:130, (null))
emulator: INFO: QtLogger.cpp:68: Critical: Failed to load https://maps.googleapis.com/maps/api/mapsjs/gen_204?csp_test=true: The 'Access-Control-Allow-Origin' header has a value 'qrc://' that is not equal to the supplied origin. Origin 'qrc://' is therefore not allowed access. (qrc:/html/js/location-mock-web-channel.js:0, (null))

Then I discovered a few more differences (bugs) to 0.117:

Both are still ok with 0.117 on Android 11!. OTS expects further Apps and packages (XClients) to work with X11. I installed three apps here, which can all/patial fullscreen. LTP-resize does'nt work in all cases. Shots to AVD-checks:

grafik

The following shots are made with my Gigaset (armv7l without split feature):

grafik

agnostic-apollo commented 2 years ago

Resize is working on Android 11 avd as well.

https://user-images.githubusercontent.com/31106828/148833499-8fb49bbf-6642-427c-a486-74748cebf063.mp4

The ip function is no longer included in the bootstrap

It was just a symlink to /system/bin/ip, but has been removed with 2812170. Directly call path.

The path nl=~/../../lib exist not anymore! I use it to analyze *.apk

Like I have told you before somewhere, termux does not create that path.

Closing issue since who knows what this is about. Open a new issue and fill template for any problems.

RalfWerner commented 2 years ago

Resize is working on Android 11 avd as well (for you).

Thanks for the reaction. One of the Float Bugs you have already been reproduced in your own video(0:08) . As far as resize is concerned, I expected your behavior on my AVD as on all other devices. Is your log with my (above) comperable? I've created another video (over Starscreen on Pixel2 with Android 11) in which you can see my behavior right next to yours.

https://user-images.githubusercontent.com/45426380/148918903-c0b1725a-d758-49ab-b603-1a84e9d319f1.mp4

Your resize Start at 0:00/0:01 (0:07) and my first attempt at 0:04 and the second at 0:07 (with shift positioning of the eccentric center). Previously (0:02), I had made a move without Ctrl and both only move -Why?

Either you have already made an Resize before the video, another AVD used or otherwise specified the "Init size" (larger:"Report issues.." without clipping/line break). As can be seen in my shots above, I can only use one size as here on AVD devices. If you use the ip function, as in my video (with line break at input and output) missing in your edition without exit circle (0:08 and larger font) probably the rest of the line and is no longer reproduced. If you further enlarge the Zoom Vertical, the Termux prompt is suddenly no longer available. Since I can not reproduce it on AVD, I did it on my Gigaset - Shots above.

I now assume that you know these two bugs and I do not have to describe them again! Another important feature is the missing EK (12 times in this issue above) in Float. If you are planning the integration of Float in Termux, which would require Fullscreen (also here) there are most of my concerns resolved.

Like I have told you before somewhere, termux does not create that path.

I know! but here the first time on AVD-Devices (it is my 11th device). On old devices, I could create this symlink by my self with pm but this funktion is missing on new devices or do you know a workarrond?

agnostic-apollo commented 2 years ago

Drag outer two dots left-right/up-down further from the center dot, outside of screen. If you only do it near center dot, window will just move instead of resize.

termux-float should preferably be integrated into termux-app if possible and I see not much point in working more on it. I don't know when I'll have time for integration or just adding extra keys, lot of other higher priority things to do.

RalfWerner commented 2 years ago

Drag outer two dots left-right/up-down further from the center dot, outside of screen. If you only do it near center dot, window will just move instead of resize. grafik

So? Unfortunately, AVD still only moves in this case only the entire window. I've spent many hours in front of my PC, tracted my mouse and bent my fingers. Also in this case, the moves lead to the following status: grafik Again the log of this Device (for compare with yours):

D:\Android>cd sdk
emulator: Android emulator version 30.8.4.0 (build_id 7600983) (CL:N/A)
handleCpuAcceleration: feature check for hvf
added library vulkan-1.dll
Failed to open /qemu.conf, err: 2
HAX is working and emulator runs in fast virt mode.
emulator: INFO: GrpcServices.cpp:315: Started GRPC server at 127.0.0.1:8554, security: Local
emulator: INFO: EmulatorAdvertisement.cpp:93: Advertising in: C:\Users\th80wr\AppData\Local\Temp\avd\running\pid_18616.ini
emulator: emulator window was out of view and was recentered
emulator: INFO: QtLogger.cpp:68: Critical: Failed to load https://maps.googleapis.com/maps/api/mapsjs/gen_204?csp_test=true: The 'Access-Control-Allow-Origin' header has a value 'qrc://' that is not equal to the supplied origin. Origin 'qrc://' is therefore not allowed access. (qrc:/html/js/common.js:0, (null))

termux-float should preferably be integrated into termux-app if possible and I see not much point in working more on it. I don't know when I'll have time for integration or just adding extra keys, lot of other higher priority things to do.

:) Very good Idea! What is your scheduling? Except for my Gigaset (no SPLIT) I use it nowhere really and to the much better PiP (popup view above) function of Samsung, there are elaborate errors. I've edit EK-Remarks above

Like I have told you before somewhere, termux does not create that path ($nl).

I know! but here the first time on my AVD-Devices ($nl needet for Target-SDK>28 too). ... do you know a workarrond?