-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
enhance(x11/termux-x11): add service script #23182
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
Conversation
|
Starting desktop separately is not really convenient since you must write script which will ping X server. Using |
|
With a service script like this I can just do We can add a service script that runs |
|
The |
|
Also |
It seems to work as is, runit keeps termux-x11 in foreground and then kills the process when
Hmm, it would be better to have the setting in some config file like ~/.termux_x11.conf and make termux-x11 load the setting from there. The bashrc might have all kinds of weird settings, so I think best practise would be to not touch it. Parsing it and only it also leaves zsh and fish and other shell users to fend for themselves. We can make an exception for now though, I see how it can be useful for termux-x11 since setting |
|
termux-x11-xfce4 is a bit long.. Maybe we can use just |
|
I am not sure. |
81891d9 to
8e4cbbe
Compare
|
Updated, thanks! |
|
I have doubts about using |
|
But in the case if user starts plain X server without session random display number is not acceptable. |
|
Yes, good point, seems like termux-x11 defaults to :0 if it is not specified? There is no good way to communicate from the service script what display number is used (user has to manually cat We could go for something more random like |
|
It defaults to the first available port. You can use |
I didn't know such a parameter existed. But I don't know how to use it to replace the DISPLAY variable. Seems very useful ! |
|
It does not "replace" DISPLAY variable. Only tells which DISPLAY variable should be used after service is started. |
8e4cbbe to
7e9a21f
Compare
|
Updated, the service scripts use -displayfd and print to |
Emmm, seems like I found it. A little explanation why you can start both vncserver and termux-x11 on :0. |
|
I opened #24216 to fix this behaviour. |
|
Ok, I fixed the abstract socket thingy. For some reason socket file descriptor is not being marked as CLOEXEC so it was leaked to X session and kernel did not close it as it was expected by X server. I have no idea why the same thing did not happen to Unix socket as well, probably because X server explicitly unlinks it on failures while there is no such option available for abstract sockets. |
|
I installed latest apk and deb from here, but it still seem to always use :0, unless I manually edit service script to use something else (like :1337). Maybe it is fine to merge as is, |
|
Ok, now it is weird. I need to do some deep research to find out what exactly happens here. |
|
Locally built apk is completely fine while CI artifact has the bug. I do not like it. |
|
Probably some random bug, now it should be fine. |
|
Awesome, now it works! I will merge during the weekend unless there are objections! |
Install termux-services and then run `sv up tx11` to start the service, or sv-enable tx11 to run it by default. Requested in termux/termux-x11#800.
Running `sv up tx11-xfce4` and `sv down tx11-xfce4` can then be used to start and stop an xfce4 session inside termux-x11. xfce4 needs to be installed for this to work.
7e9a21f to
cf8b81a
Compare
|
@Grimler91 does this update activate tx11-xfce4 by default? One of my users says it appeared after |
Install termux-services and then run
sv up termux-x11to start the service, or sv-enable termux-x11 to run it by default.Requested in termux/termux-x11#800.
As @twaik noted it would be more useful/user-friendly to have a service script to start an entire desktop environment. That can be added separately to for example xfce4, I think there is some benefit to having being able to run just termux-x11 though, since that allows up run single gui applications without all the desktop environment overhead.