LiveGTech / gShell

Interactive graphical desktop environment for LiveG OS.
https://liveg.tech/os
Other
15 stars 3 forks source link

Add integration for Linux apps #34

Closed James-Livesey closed 10 months ago

James-Livesey commented 11 months ago

This PR brings support for Linux apps to LiveG OS, both in a terminal and with Xorg.

Task list

James-Livesey commented 11 months ago

To switch to the Linux user with the Terminal app (instead of using the system user), we'll need to use su - (- sets $PWD to the user's home directory).

To prevent the user's password from being asked, we can use sudo su -.

James-Livesey commented 11 months ago

For Xorg integration, we can refer to this to start a virtual, headless Xorg server using xvfb: https://en.wikipedia.org/wiki/Xvfb

xvfb does not have GPU acceleration.

We could just open windows within the same X session as gShell, and then ensure that gShell is always the topmost application.

Also very useful: https://jichu4n.com/posts/how-x-window-managers-work-and-how-to-write-one-part-i

James-Livesey commented 11 months ago

Useful for implementing compositing window management with Xorg: https://www.talisman.org/~erlkonig/misc/x11-composite-tutorial/

Protocol specs: https://cgit.freedesktop.org/xorg/proto/compositeproto/tree/compositeproto.txt

More technical explanations/details: https://magcius.github.io/xplain/article/composite.html

For interfacing with Xorg, we can use this Node.js library: https://github.com/sidorares/node-x11

James-Livesey commented 11 months ago

For testing Xorg control from gShell we can use Xephyr to sandbox the environment:

Xephyr -br -ac -noreset -screen 1200x800 :1 &
DISPLAY=:1 ./gshell --device-type=desktop --no-touch-emulation --allow-host-control --scale-factor-emulation

We need to create a flag to make gShell aware that it should act as the window manager (much like how --real puts gShell into fullscreen) for testing purposes.

James-Livesey commented 11 months ago

For getting gShell's Xorg window ID, we can use Electron's win.getNativeWindowHandle.

James-Livesey commented 10 months ago

Accidentally merged into main earlier so merging now!

James-Livesey commented 10 months ago

In fact nah, I'll continue work on the main branch.