Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom margin #758

Closed
xu3s opened this issue Dec 1, 2024 · 12 comments
Closed

custom margin #758

xu3s opened this issue Dec 1, 2024 · 12 comments

Comments

@xu3s
Copy link

xu3s commented Dec 1, 2024

Hi, is there any way to set a custom margin for termux-x11? i asked because my phone screen has weird curve at the corner that make the experience unpleasant.

i was trying to see the list of preference that i could set myself , but i got this instead

~ $ termux-x11-preference
/data/data/com.termux/files/usr/bin/termux-x11-preference [list] {key:value} [{key2:value2}]...
~ $ termux-x11-preference list                                             list: Unexpected result
Broadcasting: Intent { act=com.termux.x11.CHANGE_PREFERENCE pkg=com.termux.x11 (has extras) }
Broadcast sent without waiting for result
~ $
@RalfWerner
Copy link

RalfWerner commented Dec 2, 2024

screen has weird curve at the corner

These are two different things. You get the message because your device has Android 14 or higher and the message with list is no longer displayed. Setting the preference values ​​works, however, without the message done if successful. @twaik thinks the message problem cannot be solved.

There are several settings for setting the screen size. My 47 sorted alphabetically on a device with Android < 14 are:

"PIP"="false"
"Reseed"="true"
"additionalKbdVisible"="true"
"adjustHeightForEK"="true"
"adjustResolution"="false"
"backButtonAction"="toggle additional key bar"
"capturedPointerSpeedFactor"="62"
"clipboardEnable"="true"
"dexMetaKeyCapture"="true"
"displayResolutionCustom"="1280x1024"
"displayResolutionExact"="1280x1024"
"displayResolutionMode"="scaled"
"displayScale"="270"
"displayStretch"="false"
"enableAccessibilityServiceAutomatically"="false"
"enableGboardCJK"="false" #### removed in 1.03.01-eef7bad-11.12.24 ####
"extra_keys_config"="[[{key:MOUSE_HELPER,popup:STYLUS_HELPER},{key:ESC,popup:SHFT},{key:KEYBOARD,popup:DRAWER},{key:'/',popup:{display:'\\\\',macro:BACKSLASH}},{key:  '-',popup:'|'},UP,{key:ENTER,popup:{macro:'CTRL n',display:'->'}},HOME,PGUP,{display:X,macro:'t SPACE 0 ENTER',popup:{macro:'t SPACE w ENTER',display:W}}],[{macro:CTRL,display:'^',popup:{macro:'CTRL d',display:d}},ALT,{key:TAB,popup:PASTE},{key:BKSP, popup:DEL},{key:LEFT,popup:BKSP},DOWN,{key:RIGHT,popup:{macro:'bash SPACE uu.sh SPACE ky ENTER',display:EK+}},END,PGDN,{macro:'mc SPACE i ENTER',display:M,popup:F10}]]"
"filterOutWinkey"="false"
"forceOrientation"="no"
"fullscreen"="true"
"hardwareKbdScancodesWorkaround"="true"
"hideCutout"="true"
"keepScreenOn"="true"
"notificationButton0Action"="open preferences"
"notificationButton1Action"="exit"
"notificationTapAction"="toggle additional key bar"
"opacityEKBar"="80"
"pauseKeyInterceptingWithEsc"="true"
"pointerCapture"="true"
"preferScancodes"="true"
"scaleTouchpad"="true"
"showAdditionalKbd"="true"
"showIMEWhileExternalConnected"="true"
"showMouseHelper"="true"
"showStylusClickOverride"="false"
"storeSecondaryDisplayPreferencesSeparately"="false"
"stylusButtonContactModifierMode"="true"
"stylusIsMouse"="true"
"swipeDownAction"="no action"
"swipeUpAction"="no action"
"tapToMove"="true"
"touchMode"="Direct touch"
"transformCapturedPointer"="No"
"useTermuxEKBarBehaviour"="false"
"volumeDownAction"="no action"
"volumeUpAction"="no action"
"xrMode"="false"

Als displayResolutionMode you can specify a reduced value with custom. For example, for me it is 1900x1200 when the screen is used horizontally (landscape), compared to native where the value is 2000x1144.
The reduction in size due to additional EK lines is subtracted from the screen, so a height of 1000 may be better. However, when rotating, the ratio remains the same.

@RalfWerner
Copy link

@jace, in Discord, Twaik says: list no longer works with Android 14. So the only option is to use a device where it still works or to assign all values without bug message or check by preferences/drawer.

@termux termux deleted a comment from saitama610 Jan 5, 2025
@termux termux deleted a comment from saitama610 Jan 5, 2025
@termux termux deleted a comment from saitama610 Jan 5, 2025
@twaik
Copy link
Member

twaik commented Jan 12, 2025

Fixed by efb2d97 and termux/termux-packages@26ccf3a .

@twaik twaik closed this as completed Jan 12, 2025
@jorbig
Copy link

jorbig commented Jan 13, 2025

It doesn't seem fixed to me:

~ termux-x11-preference list
list: Unexpected result 
Broadcasting: Intent { act=com.termux.x11.CHANGE_PREFERENCE pkg=com.termux.x11 (has extras) }
Broadcast sent without waiting for result

With Android 14+ we should be at least be able to show the possible options.

@twaik
Copy link
Member

twaik commented Jan 13, 2025

Update both android app and termux package...

@jorbig
Copy link

jorbig commented Jan 13, 2025

Woops, forgot the last part... Sorry. Great work!!

@RalfWerner
Copy link

I had no success with list in the last version (*-35a8dc5-13-01.25) and after pkg up

[~]$ pkg up
Checking availability of current mirror:
[*] https://packages.termux.dev/apt/termux-main: ok
Hit:1 https://packages.termux.dev/apt/termux-main stable InRelease
Hit:2 https://packages.termux.dev/apt/termux-x11 x11 InRelease
Hit:3 https://its-pointless.github.io/files/24 termux InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[~]$ am broadcast -a com.termux.x11.CHANGE_PREFERENCE -p com.termux.x11 -e list 0
Broadcasting: Intent { act=com.termux.x11.CHANGE_PREFERENCE pkg=com.termux.x11 (has extras) }
Broadcast sent without waiting for result
[~]$ termux-info
Termux Variables:
TERMUX_API_APP__VERSION_NAME=0.50.1+c281d96
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP__AM_SOCKET_SERVER_ENABLED=true
TERMUX_APP__APK_PATH=/data/app/~~v_TYcBGzJMSb-z1636xaoQ==/com.termux-R66kajDvBLRZRYXOVUuGvQ==/base.apk
TERMUX_APP__APK_RELEASE=GITHUB
TERMUX_APP__FILES_DIR=/data/user/0/com.termux/files
TERMUX_APP__IS_DEBUGGABLE_BUILD=true
TERMUX_APP__IS_INSTALLED_ON_EXTERNAL_STORAGE=false
TERMUX_APP__PACKAGE_MANAGER=apt
TERMUX_APP__PACKAGE_NAME=com.termux
TERMUX_APP__PACKAGE_VARIANT=apt-android-7
TERMUX_APP__PID=23473
TERMUX_APP__SE_FILE_CONTEXT=u:object_r:app_data_file:s0:c12,c257,c512,c768
TERMUX_APP__SE_INFO=default:targetSdkVersion=28:complete
TERMUX_APP__SE_PROCESS_CONTEXT=u:r:untrusted_app_27:s0:c12,c257,c512,c768
TERMUX_APP__TARGET_SDK=28
TERMUX_APP__UID=10268
TERMUX_APP__USER_ID=0
TERMUX_APP__VERSION_CODE=118
TERMUX_APP__VERSION_NAME=0.118.0+2f40df9
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0+2f40df9
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages.termux.dev/apt/termux-main stable main
# sources.list.d/gcc.list
deb https://its-pointless.github.io/files/24 termux extras
# x11-repo (sources.list.d/x11.list)
deb https://packages.termux.dev/apt/termux-x11 x11 main
Updatable packages:
All packages up to date
termux-tools version:
1.44.6
Android version:
14
Kernel build information:
Linux localhost 5.10.223-android12-9-28577532-abA336BXXUCEXK4 #1 SMP PREEMPT Wed Nov 13 20:34:09 KST 2024 aarch64 Android
Device manufacturer:
samsung
Device model:
SM-A336B
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.window versionCode:15
com.termux.widget versionCode:13
com.termux.x11 versionCode:15
com.termux.api versionCode:51
[~]$

@twaik
Copy link
Member

twaik commented Jan 13, 2025

Do not use am broadcast directly, use termux-x11-preference...

@RalfWerner
Copy link

with termux-x11-preference list wraper it works - sorry - I check the differences:)

@RalfWerner
Copy link

I also use the am variant ($x11a) in scripts like $x11a list 0 |grep displ or mv 2 1;$x11a list 0 >2; diff 1 2 but unfortunately this no longer works with x11b=termux-x11-preference and
$x11b list |grep displ on devices with [ $(getprop ro.build.version.sdk) -ge 34 ].

do you have a solution for this?

@twaik
Copy link
Member

twaik commented Jan 13, 2025

No. termux-am on Android 34+ no longer supports sending ordered broadcasts which I was using for returning response from activity.

@RalfWerner
Copy link

RalfWerner commented Jan 13, 2025

Is there no way to redirect > the output from stdout to a file? Here is an example on devices with 33 and 34:

b=`getprop ro.build.version.sdk`;[ $b -ge 34 ]&& echo yes $b
yes 34
[~]$ x11b=termux-x11-preference
[~]$  $x11b list |grep displ
termux-x11-preference [list] {key:value} [{key2:value2}]...

# on a device with $b=33
[~]$ $x11b list |grep displ
"displayStretch"="false"
"displayResolutionCustom"="1280x1024"
"extra_keys_config"="[[{key:MOUSE_HELPER,popup:STYLUS_HELPER},{macro:CTRL,display:'^',popup:{macro:'CTRL d',display:d}},{key:TAB,popup:PASTE},{key:KEYBOARD,popup:DRAWER},{key:LEFT,popup:BKSP},{key:RIGHT,popup:{macro:'bash SPACE uu.sh SPACE ky ENTER',display:EK+}},{key:UP,popup:PGUP},{key:ENTER,popup:{macro:'CTRL n',display:'->'}},{key:DOWN,popup:PGDN},{key:END,popup:HOME},{macro:'mc SPACE i ENTER',display:M,popup:F10},{display:X,macro:'t SPACE 0 ENTER',popup:{macro:'t SPACE w ENTER',display:W}}]]"
"displayResolutionExact"="1280x1024"
"displayResolutionMode"="scaled"
"displayScale"="100"

Assignment above with $x11a still works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants