Skip to content

Conversation

@robertkirkman
Copy link
Member

@robertkirkman robertkirkman commented Jan 30, 2026

# it really doesn't work well with Zink+Turnip
export LIBGL_ALWAYS_SOFTWARE=1
termux-x11 -xstartup gnome-session

@robertkirkman robertkirkman force-pushed the gnome-shell branch 2 times, most recently from 01b282d to 03c97b6 Compare January 30, 2026 13:11
@sabamdarif
Copy link
Contributor

sabamdarif commented Jan 30, 2026

@robertkirkman
Copy link
Member Author

Very good thank you I will add them and maybe I'll try to add more

@sabamdarif
Copy link
Contributor

Screenshot_20260130-192753_Termux_X11

Working fine

@robertkirkman robertkirkman changed the title addpkg(x11/gnome-shell): 48.7 tree-wide: GNOME Desktop Jan 30, 2026
@sabamdarif
Copy link
Contributor

@robertkirkman can you check if just running dbus-daemon --system --fork works or not

@sabamdarif
Copy link
Contributor

sabamdarif commented Jan 30, 2026

0102-no-system-bus.patch

@robertkirkman can you try this patch then launch with just termux-x11 :0 -xstartup gnome-session

@sabamdarif
Copy link
Contributor

But it can't launch app

@robertkirkman
Copy link
Member Author

@robertkirkman can you check if just running dbus-daemon --system --fork works or not

Yes with just dbus-daemon --system --fork it works

@robertkirkman
Copy link
Member Author

0102-no-system-bus.patch

@robertkirkman can you try this patch then launch with just termux-x11 :0 -xstartup gnome-session

What does the patch do? I tried it, and for me it is still necessary to run dbus-daemon --system --fork when using it before running gnome-session otherwise it has the white error screen?

@robertkirkman
Copy link
Member Author

But it can't launch app

If you have adreno make sure to use export LIBGL_ALWAYS_SOFTWARE=1 first because it has invisible windows for me if I use Zink+Turnip

@sabamdarif
Copy link
Contributor

0102-no-system-bus.patch
@robertkirkman can you try this patch then launch with just termux-x11 :0 -xstartup gnome-session

What does the patch do? I tried it, and for me it is still necessary to run dbus-daemon --system --fork when using it before running gnome-session otherwise it has the white error screen?

i was just trying to run them without system bus 😅

@sabamdarif
Copy link
Contributor

wait let me share a screen record of my device

@sabamdarif
Copy link
Contributor

for some reason it decide to work when i was recording :- https://drive.google.com/file/d/1_qvUG7OH6-F_-2eLFKGSAucKbHPSjA91/view?usp=sharing

but in most of the case this is what was happening:- https://drive.google.com/file/d/19sPJdPRZh0aNUZHWNWEqMbS6u_pQUJPQ/view?usp=sharing

@robertkirkman
Copy link
Member Author

robertkirkman commented Jan 31, 2026

I see, that's interesting that the patch works for that for you; for me when I tested that patch and then stopped all dbus-daemon processes and then used gnome-session, this happened:

image

which is the same as what I see when not using the patch and not having dbus-daemon --system

@robertkirkman
Copy link
Member Author

I tried to work on version 49, but as we know, version 49 has a strong dependency on a dependency-based init system, with a default at Systemd and the option to implement additional backends, and currently the only additional backend widely known to have been implemented at this time is this one for OpenRC:

https://github.com/swagtoy/gnome-session-openrc

If someone else implements another backend in the future that can restore self-launching of GNOME, then I could progress more by copying that. (I assume the distro with the most maintainers likely to do that is FreeBSD)

I tried to figure out if there is a way to manually write out the commands which the init system needs to execute in order one by one for GNOME 49 to complete its launch sequence, but I haven't been able to yet unfortunately.

I think it might involve a combination of $PREFIX/libexec/gnome-session-service --session=x11, $PREFIX/libexec/gnome-session-ctl, and $PREFIX/libexec/gnome-session-init-worker with certain arguments in a certain order.

Something I might be able to try is wrapping those executables with scripts that log their activities with timestamps on a Systemd or OpenRC distro, then launch GNOME there, then check the log timestamps to construct a sequence of commands necessary to launch GNOME 49.

@robertkirkman
Copy link
Member Author

Alpine Linux has moved forward with the rest of GNOME 49 except for gnome-session by making this patch on gnome-shell 49 that makes it backwards compatible with gnome-session 48.

https://gitlab.alpinelinux.org/alpine/aports/-/commit/349a5ed70ff9d89e5c6af01f31078cc9b59bb8e3

I could probably do that now, but if many other distros also do that, then I expect a community-maintained fork or patchset of gnome-session 48 to eventually emerge that I could copy to progress here.

@sabamdarif
Copy link
Contributor

diff --git a/gnome-session/main.c b/gnome-session/main.c
index 5f98149..64a1aab 100644
--- a/gnome-session/main.c
+++ b/gnome-session/main.c
@@ -518,6 +518,11 @@ main (int argc, char **argv)
                 gsm_util_init_error (TRUE, "%s", error->message);
         }
 
+        /* Termux Hack: Start dbus-daemon --system first before anything */
+        g_message ("Termux Hack: starting system dbus-daemon...");
+        remove ("@TERMUX_PREFIX@/var/run/dbus/pid");
+        system ("dbus-daemon --system --fork");
+
         /* From 3.14 GDM sets XDG_CURRENT_DESKTOP. For compatibility with
          * older versions of GDM,  other display managers, and startx,
          * set a fallback value if we don't find it set.

@robertkirkman can we not do something like this so we don't have to do that extra dbus-daemon --system --fork step, we can just run termux-x11 :0 -xstartup gnome-session

@robertkirkman
Copy link
Member Author

Yes it's a good idea I might add that, though, the hard part is that I would want to actually make sure that dbus-daemon --system is not actually running anymore before using rm $PREFIX/var/run/dbus/pid, because i am not sure how bad it would be if it is removed without killing the previous one.

@sabamdarif
Copy link
Contributor

ok i will try to do that

@sabamdarif
Copy link
Contributor

we can get the pid like this

$ cat "/data/data/com.termux/files/usr/var/run/dbus/pid"
$ 9208

@sabamdarif
Copy link
Contributor

diff --git a/gnome-session/main.c b/gnome-session/main.c
index 5f98149..28d8975 100644
--- a/gnome-session/main.c
+++ b/gnome-session/main.c
@@ -518,6 +518,23 @@ main (int argc, char **argv)
                 gsm_util_init_error (TRUE, "%s", error->message);
         }
 
+        /* Termux Hack: Start dbus-daemon --system first before anything */
+        {
+            const char *pid_file = "@TERMUX_PREFIX@/var/run/dbus/pid";
+            FILE *f = fopen (pid_file, "r");
+            if (f) {
+                int pid = 0;
+                if (fscanf (f, "%d", &pid) == 1 && pid > 0) {
+                     g_message ("Termux Hack: Killing stale system dbus-daemon (pid %d)", pid);
+                     kill (pid, SIGTERM);
+                }
+                fclose (f);
+            }
+            remove (pid_file);
+            g_message ("Termux Hack: starting system dbus-daemon...");
+            system ("dbus-daemon --system --fork");
+        }
+
         /* From 3.14 GDM sets XDG_CURRENT_DESKTOP. For compatibility with
          * older versions of GDM,  other display managers, and startx,
          * set a fallback value if we don't find it set.

what about this ?

@robertkirkman robertkirkman force-pushed the gnome-shell branch 4 times, most recently from ad3e7cb to aaf2dec Compare January 31, 2026 10:21
@robertkirkman
Copy link
Member Author

Yes that's good thank you I tested that and it's working

@robertkirkman
Copy link
Member Author

robertkirkman commented Jan 31, 2026

I managed to compile everything updated to version 49 and make it run with the exception of gnome-session 49, by doing something close to what Alpine Linux currently is doing and making gnome-session 48 launch gnome 49, but it is very glitchy

image

- Alternative build of termux#24585

- Fixes termux#10173

- How to use this build:

```bash
export LIBGL_ALWAYS_SOFTWARE=1
termux-x11 -xstartup gnome-session
```

Co-authored-by: Chongyun Lee <[email protected]>
Co-authored-by: Md Arif <[email protected]>
@robertkirkman
Copy link
Member Author

robertkirkman commented Jan 31, 2026

The top right corner button is broken and I think it's because of gnome-session being version 48 but gnome-settings-daemon being version 49 and it might work once there is a way to update gnome-session to 49

@robertkirkman
Copy link
Member Author

There is also a problem that gjs newest version requires spidermonkey 140, but Termux only has one spidermonkey package and cjs reqires version 128 and won't work with version 140, so this conflicts with Cinnamon, one option is to wait until cjs gets an update to make it compatible with spidermonkey 140

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

Successfully merging this pull request may close these issues.

Package request: Gnome shell

2 participants