Open twaik opened 9 months ago
Sounds good, it is just up to someone who wants to do the work. I have never tried using the X support, so not going to be me.
Do you really think that Linux kindergarten human behavior is fixable programmatically? It can't be fixed this way.
Lack of the official Termux content creators is the main issue here. People have to look somewhere else to take instructions for getting desired setup and of course third parties may not follow our recommendations.
This is what has to be fixed first instead of modifying apt
or whatever else. Does anyone know that Termux has (had?) an official YouTube channel? It is here: https://www.youtube.com/channel/UCGCVyLywi5KfW6n-54tiiJQ. Now compare it with non-official Termux channels.
The question is only who will work on content. Community is not that active at posting guides on our social media pages, particularly on Reddit.
I agree that we can make a script for automating setup of desktop environments. Perhaps it is possible to use proot-distro project as base and optimize it specifically for setting up desktops.
Resulting script usage can look like this:
# install xfce and deps and configure as VNC server
termux-desktop configure --mode-vnc xfce
# reconfigure to termux-x11
termux-desktop configure --mode-termux-x11 xfce
# start or stop
termux-desktop start
termux-desktop stop
For each DE there can be a small script in $PREFIX/etc/termux-desktop
with custom steps, just like proot-distro
does for distributions.
Yes, it is possible to resolve this issue by patching apt
:
Commands update
, upgrade
, full-upgrade
and dist-upgrade
All of these should be merged and serve sole purpose of upgrading Termux environment. No split or optional index refreshing, it should be always downloaded when possible.
As apt
downloads index only when it is absent locally or remote file is newer. I can agree that forcing apt update
before upgrading or install actions can make package manager be a bit slower, but traffic usage won't increase significantly.
Command install
should always check/refresh index and pull all system updates before installing the actual package.
Mirror rotation can be implemented as well but is not necessary for the first patching iteration.
Make necessary changes to apt
documentations and internal messages to match new behavior.
Result of these changes would be that user have no choice to not upgrade environment. The package manager will do such action on its own.
These changes are breaking and we'll get a lot of complaints because of unexpected actions of package manager. Many people intentionally not upgrade their Termux environment, even though this is not supported. They had choice when using apt
previously, now they don't have such choice.
IMO, this would be a total mess but working...
Do you really think that ~Linux kindergarten~ human behavior is fixable programmatically? It can't be fixed this way.
I agree, we can not fix human behaviour. But we can fix/avoid reasons they complain about (at least some of them).
I agree that we can make a script for automating setup of desktop environments.
We can simply use update-alternatives
mechanism and make some dialog
GUI for this. No need to implement something new. Most DEs can set x-session-manager
alternative which can be used by our startx. X server can be configured via update-alternatives
too. Our script (in perfect case) should only invoke apt update && apt install
, update-alternatives
and dialog
.
But we can fix/avoid reasons they complain about (at least some of them).
You never know what and how configured in users environment. User may even not know that something is wrong with it.
Any helper can fix only specific issue that happens in specific conditions. Thus user may set up a custom library versions and you'll have to spend a while to understand what is going on so the user has an unreproducible problem.
My main point is that you can't stop people from posting stupid issues which normally can't happen.
Here I see two possible solutions:
We can simply use update-alternatives mechanism and make some dialog GUI for this. No need to implement something new. Most DEs can set x-session-manager alternative which can be used by our startx.
If required action is such simple, then indeed perhaps better to go with update-alternatives method.
Instead of patching apt
, we can just hide it (remove from PATH). Users will have to use pkg
then.
I think this is much better than messing up package manager.
- I don't know how this can look like, maybe packaged as custom bootstrap archives.
No need for custom bootstraps. We may simply install everything with our magic script. About how it should look like: when you install Ubuntu or Debian most needed tools (WM, DE, file manager, text editor) are already set up and ready to be launched. I think we should have simmilar setup. Maybe we should not install everything, we may do something like flavors (like xfce-desktop, xfce-minimal, mate-desktop, mate-minimal).
Instead of patching
apt
, we can just hide it (remove from PATH). Users will have to usepkg
then.
I agree. We can move it somewhere to $PREFIX/libexec
.
Custom bootstraps or their equivalent is the way to deliver environment that is sane and guaranteed to work.
With script you just pulling current package versions, which may be not tested for compatibility or user for some reason left custom libdependencyname.so
in $PREFIX/lib
and it broke everything.
And I'm talking not only about desktops here.
Custom bootstrap means the whole environment will be reset, does not it?
I think something along the lines of a display manager utility could work quite well for this.
I don't wanna start any bike-shedding, but let's say we provide something like a termux/termux-sessions
repo which contains setup/startx scripts for various Desktops and Window Managers (as well as having the component packages as dependencies for each).
Say a termux-xfce-session
, termux-sway-session
, termux-lxqt-session
, etc.
I guess a closer equivalent would be the "session files" used by Display Managers usually stored in /usr/share/{wayland,x}-sessions
on regular distros.
This way users can install a desktop (or WM) of their choice and use a standardized utility to properly start any of their installed desktops. Maintenance burden should be manageable past the initial effort of writing and testing sessions. Though I recognize this shifts the burden setup verification mostly onto the session setup scripts. Overall from a user perspective it should make the whole experience very modular, transparent and extensible; over something like a "Spins" or "Flavors" approach which is more so the impression I am getting from the custom bootstraps concept. Though the two are of course not mutually exclusive.
Custom bootstrap means the whole environment will be reset, does not it?
Yeah, the whole idea is to bring a preconfigured system as starting point for further user actions.
I'd like to address the general packaging points one by one.
We should merge x11-repo to main repo. Also there are enough packages requiring (both QT and regular) which are CLI only but depend on packages in x11-repo and can be used without X server (I do not remember names, but still relevant).
I disagree about scrapping the x11-repo entirely, it's a useful distinction.
Perhaps instead including the x11-repo
stub package as part of the default apt repos shipped in the bootstrap, so users don't need to separately install it, makes more sense.
- We should make
apt
ask aboutapt update
in the case of interactive console (to avoid prompting in scripts) and only in the case if last update was more than 6 hours ago (because auto-updater launching has this period) and chain it to the start of package installing process. I suggest to patch theapt
and notpkg
intentionally. This will make people update environment more often. That is related to bothrolling release
model and topartial upgrade
problem. I am not sure how exactly it is done in otherrolling release
distros.
I agree that we should make it clearer that partial updates are unsupported on Termux and perhaps a warning or patch to do a full-upgrade instead should be included, though I'm unsure how exactly this should be handled. As for "reminding users" that updates are available, I'm not sure how I feel about that. Perhaps we could bring back the dynamic MOTD concept from a while ago to remind users about updates, but we should never force or "nag" users to update. Though a full upgrade when installing new packages should obviously remain the recommendation, and a notice if attempting to install new packages with pending updates seems appropriate.
- We should make automatic correcting releases for both github and f-droid to make it used up-to-date bootstrap and, again, avoid
partial upgrade
problem. Or maybe remove bootstrap from apk and force downloading it from Internet or sdcard (in the case if Internet is not available).
I am entirely unsure how you propose to manage, and for that matter distribute this. Perhaps I just need some more clarification. I'm not opposed to the idea in principle.
- We should add some newbie-friendly guides to our site for most popular cases, i.e. updating environment, installing packages, installing GUI, explaining basics, etc. I know we are not Linux kindergarten, but many people have ZERO knowledge about Linux and want to get started. It is not neccessary, but people like that can make A LOT of noise in discord.
As far as I know a wiki revamp is already underway at termux/termux-community#1, and I fully agree that a update to our official resources is sorely needed. Though that is obviously a time and labor intensive process.
I am entirely unsure how you propose to manage, and for that matter distribute this. Perhaps I just need some more clarification. I'm not opposed to the idea in principle.
The main idea is to make apk
users get from Github or F-Droid always be updated.
I disagree about scrapping the x11-repo entirely, it's a useful distinction. Perhaps instead including the
x11-repo
stub package as part of the default apt repos shipped in the bootstrap, so users don't need to separately install it, makes more sense.
I agree.
The main idea is to make
apk
users get from Github or F-Droid always be updated.
That would work for F-Droid - Provided they are pulling the releases. But for GitHub it would require essentially switching to weekly(?) releases for the main App, no? I'm actually not 100% clear on how the bootstrapping process works in detail. Now that I think about it, shouldn't it just pull down the latest bootstrap when first running the app?
In any case I don't think we should force pre-existing users to install the latest bootstrap. Maybe a notification when a new bootstrap is released to remind them that updates are available?
Now that I think about it, shouldn't it just pull down the latest bootstrap when first running the app?
AFAIK termux-app unpacks bootstrap contained in apk. It is inlined to shared library.
Bootstrap is only applied when termux runs first time or it's data is reset.
In any case I don't think we should force pre-existing users to install the latest bootstrap. Maybe a notification when a new bootstrap is released to remind them that updates are available?
Irrelevant to existing users.
Newer bootstrap means downloading less updates while doing pkg update
first time in fresh environment.
My thoughts on this.
apt
to auto apt update
is not a good idea. We should stay consistent with other linux distros like debian and there are reasons update
is not automatically done. It obviously wastes bandwidth, but it wastes time as well, I rarely use pkg
myself and if I am installing multiple packages, it would be annoying to wait every time for sync. It also gives control to be able to install an old version of the package, in case newer is broken, or be able to reinstall a package from a local cache while testing. Such core behavior shouldn't be changed. For experienced devs who know what they are doing, apt
should function as is. The solution instead is to be more vocal about using pkg
in our docs for normal users, and recommend apt
or pacman
for advance users. I am very much against forcing updates on users.apt
or pacman
should be removed from $PATH
. Many people use it and it would break lot of user space programs and having to specially configure to make them accessible would be a chore for new installations.apt
can however be patched to print a red warning that pkg
should be used or apt update
should be used first. But I doubt that will help for noobs, since that is currently already logged if package is not found, just a day ago we got a user on reddit, who took a snippet of the message from apt
telling them to run apt update
and they posted instead and asked what to do instead of just running the command as suggested. But there would be lot of people who actually read that message and ran the command and never posted about it, we never get to know about those, so it may be a biased view that such messages are not helpful to anyone.x11-repo
could be added to bootstrap, lot of users do install termux looking for a DE, so it could be a good idea to provide the repo from the get go. The issue with that is that it would increase apt update
time so may not be worth it if scripts automatically install it or docs already tell users to install it.apt upgrade
after confirming with user, this way packages wouldn't break.pkg
selecting broken mirrors sometimes and requiring update of termux-tools
but that will be fixed with pre-release. Moreover, weekely releases just for bootstraps would be a release spam and it doesn't help with broken packages issue. Even if user installs latest bootstrap today, a few hours later, the repo may get a package that requires dependencies updates, so if user only installs that package without upgrading the dependencies, he would still get in that broken state. Also F-Droid takes days to update app, so any latest bootstrap packed would be stale by then anyways, depending on how many packages got upgraded before release and installation. The solution is to ask user if they want to run apt upgrade
when bootstrap is installed, it will be added in a UI dialog when I work on bootstrap redesign, lot of other reqs exist too related to bootstrap, including custom ones. It will also support downloading the latest bootstrap if user wants too. However, both upgrade or latest bootstrap have issues too, such untested upgrades or bootstraps could result in broken states. It has happened in the past that broken bootstraps kept getting released for weeks and no one noticed. I can't test if a bootstrap is working every week, in the past, I manually thoroughly tested bootstraps before each app release to know for sure that they were stable. Automated testing would help solve some issues, termux-exec-tests
being added should help too for testing basic execution environment.Btw, I plan on writing a guide for setting up a DE, termux-x11
and firefox for mozilla people this week, finishing up some other work currently.
Newer bootstrap means downloading less updates while doing pkg update first time in fresh environment.
The bootstrap is like 25MB only for each architecture, downloading archives of outdated packages wouldn't take that long. And if we download latest bootstrap, same thing basically. One time setup time is irrelevant anyways.
Hello. People who want to run X11 GUI in termux come to discord
termux/general
and matrixtermux/termux
very often. They are not Linux enthusiasts, but even if they are, they still have problems running GUI. The reason for this is pretty much simple: termux's way of running GUI is not very straightforward. People do not really want to play with multiple X servers and DEs. They want to simply runstartx
or something simmilar and enjoy graphical environment. Or someone is not experienced enough and follows guides in Internet (which are malicious in some cases, unfortunately). So, IMHO, we should do the following things (maybe all of them, maybe not).xserver
and make some of them installable by default, or maybe make a packagexserver
containing script which goes through available X servers and starts one of them. Also we should make X servers make an alternative to$PREFIX/bin/X
. Or we can port realstartx
(I am not sure if it implements switching between available X servers). Also we should make all DEs make an alternative to$PREFIX/bin/x-window-manager
and$PREFIX/bin/x-session-manager
for easier switching between DEs.dialog
(liketermux-change-repo
does). I am not sure if it can run during dpkgpost-install
because of apt lock ($PREFIX/var/lib/dpkg/lock
?).x11-repo
to main repo. Also there are enough packages requiring (both QT and regular) which are CLI only but depend on packages inx11-repo
and can be used without X server (I do not remember names, but still relevant).Also something recommended but not related to GUI directly.
apt
ask aboutapt update
in the case of interactive console (to avoid prompting in scripts) and only in the case if last update was more than 6 hours ago (because auto-updater launching has this period) and chain it to the start of package installing process. I suggest to patch theapt
and notpkg
intentionally. This will make people update environment more often. That is related to bothrolling release
model and topartial upgrade
problem. I am not sure how exactly it is done in otherrolling release
distros.partial upgrade
problem. Or maybe remove bootstrap from apk and force downloading it from Internet or sdcard (in the case if Internet is not available).I did not post it in Discussions intentionally. That really seems like our flaw.
One or all points mentioned here should make termux more newbie-friendly, but I am not someone who makes decisions here (at least not make decisions alone).
I am pinging the whole team and locking conversation only for collaborators. I really want to hear opinions of everybody to avoid misunderstanding. @termux/app-maintainers @termux/package-maintainers