Open Dani3I opened 1 year ago
Pull requests are welcome; I, personally, don't plan to work on this anytime soon.
It's actually possible to use termux-x11 out of the box if you add -listen tcp
to your termux-x11 call. It's a bit absurd, but here's the step-by-step:
termux-x11 :1 -listen tcp -xstartup "dbus-launch --exit-with-session i3"
(replace i3 with whatever you want to use as desktop)DISPLAY=127.0.0.1:1
. Example: nix-shell -p gedit
, DISPLAY=127.0.0.1:1 gedit
You can automate this a little by writing the termux-x11
invocation to a script, and adding export DISPLAY=127.0.0.1:1
to your .bash_profile
in nix-on-droid.
Still, it'd be cool if we could do termux-x11 without needing vanilla Termux installed at all. The termux-x11
tool appears to be very simple https://github.com/termux/termux-x11/blob/master/termux-x11 - if we can somehow expose /system/bin/app_process
in nix-on-droid then it might "just work" :thinking:
I could modify termux-x11 so that it uses com.termux.nix.x11 instead of com.termux.x11 and that might work. Ideally we wouldn't have a duplicate app though.
I could modify termux-x11 so that it uses com.termux.nix.x11 instead of com.termux.x11 and that might work.
With no TermuxApiReceiver to talk with and no ClipboardAPI to process the request it's not gonna work. This code would need to be added to our app somehow, plugin or not.
Ideally we wouldn't have a duplicate app though.
On one hand, there isn't much we've changed: bootstrap URL selection, some broken symlink resolution during login and some of the contact links.
On the other hand, coinstallability with Termux is kinda nice.
Now, if Termux had several "slots" to install different userspaces into from custom URLs...
- In regular Termux, run
termux-x11 :1 -listen tcp -xstartup "dbus-launch --exit-with-session i3"
(replace i3 with whatever you want to use as desktop)
I gave this a shot, but with i3 inside the nix-on-droid boundary:
termux-x11 :1 -listen tcp -ac
DISPLAY=:1
(i.e. system or shell sessionVariables
)dbus-run-session nixGL i3
I packaged up / forked from NixOS the a small subset of dbus
(https://gist.github.com/harryaskham/15b4a13a98b12a469527e92b644589b7) and manually set:
XDG_CONFIG_{DIRS,HOME}=$HOME/.config
XDG_DATA_{DIRS_HOME}=$HOME/.local/share
XDG_RUNTIME_DIR
=/tmp/run in both
environment.sessionVariablesand
zsh.sessionVariables`. Can't be sure all of these are necessary.Running with scrcpy
I can get this nice picture-in-picture mode with my phone NoD streaming wirelessly to my desktop NixOS:
The top level nixGL is enough to get a HW-accelerated picom / alacritty running smoothly. Haven't found a browser that runs out the box yet :)
For termux there is project called termux-x11. It allows to show gui (for example xfce4) without using VNC etc. Project is available here: https://github.com/termux/termux-x11
Are there any plans to support something like this on nix-on-droid (or maybe it is already possible)?