Xpra (minimal), or alike, but 100% written in C - Page 1
Forum section: electronics / general

author: DiTBho
author_rank: Super Contributor
timestamp: January 20, 2024, 06:13:02 pm
content: So, this isxpraQuotethis stuff is great but it has*a lot* of dependencies, including python!Do you know if there is a stripped-down version? or anything like that but 100% written only in C and without any run-time dependency?I don't want to support Rust, llvm, and python in order to compile and run my "screen for X11".If there is nothing around, I will develop myself minimal version: I don't want/need to support anything but { keyboard, mouse, screen }(in case, feel free to PM me if interested)

author: janoc
author_rank: Super Contributor
timestamp: January 20, 2024, 09:16:45 pm
content: If you only want to access your Linux machine's screen remotely then what is wrong with something like x11vnc or xrdp? And connect to it using normal remote desktop clients.That has the advantage that it will also work with modern applications like browsers (or stuff like Electron) which don't work over X11 remote connections anymore due to the ancient OpenGL version supported by the X11 extensions required to make OpenGL work across network.Or install an X server on Windows, enable XDMCP on your Linux machine and log in remotely. It is not secure, though - which is why it is disabled by default on most modern Linux systems.Expecting that you will find something with no dependencies but that implements stuff like literally an entire X protocol, has built-in web client, can interact with the various desktop session protocols, forwards stuff like audio, webcams, etc. - good luck. Get real, that ain't gonna happen. Nobody is going to re-implement things like that from scratch (and introduce myriads of bugs in the process) instead of using existing and tested libraries.QuoteFeel free to. However, I think you will quickly discover that the problem even for your minimal case is tad more complicated than you think if you want to actually have an usable desktop. But feel free to reinvent VNC or RDP, along with the image compression and encryption/authentication, it is your time

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 20, 2024, 09:19:25 pm
content: Never used it, but looking at the project, Python is not just a "dependency", it looks like most of the code for xpra is Python code. "Porting" it to pure C makes no sense IMO, better write your own indeed. It would be like rewriting it almost entirely.

author: audiotubes
author_rank: Regular Contributor
timestamp: January 20, 2024, 09:29:09 pm
content: Not sure what you are trying to do, but WSL has been able to support X apps for a while now. You don't even have to mess with Windows firewall, it works out of the box.I use Fedora WSL and I can run X apps locally, X-forward apps via SSH on Linux and FreeBSD boxes, etc.

author: DiTBho
author_rank: Super Contributor
timestamp: January 21, 2024, 10:24:28 am
content: Quote from: SiliconWizard on January 20, 2024, 09:19:25 pm"dependency" in Gentoo terms; I see x11-wm/xpra requires { python, ... }, whether it does it during the build-up (build-dependency) or because it needs it at run-time (run-time-dependency), it's a dependency from the "ebuild" (therefore for Catalyst) point of view.I'm finishing another project at the moment and I haven't yet had time to understand how many parts of Xpra are written in Python, in any case: the protocol they studied makes lot of sense as it's better than the tradicitional X11 protocol, so it makes sense for me to rewrite the parts in Python in C, eliminating all the superfluous functions.Code:# cat /etc/portage/package.use/x11-wm---xprax11-wm/xpra client clipboard -crypt lz4 server trayicon -brotli -csc -cups -dbus -debug -doc -ffmpeg -html -ibus -jpeg -lzo minimal -oauth -opengl -pinentry -pulseaudio -sound -systemd -test -udev -vpx -webcam -webp -xdg xinerama(see how many to-be-built features it has ...)In the end my Xpra-minimum (just "screen/tmux for X11") must run onGNU/Linux MIPS32@200Mhz machineMUSL-embedded profileram-rootfs128Mbytes of ramThe persistent session level is one of the reasons I chose it, as it's exactly what I need for the project.I don't even think about supporting Python on the target, I just DON'T even want to see it mentioned in my final stage to be loaded on the target as it's currently the "antichrist" for all the things that it breaks along the path.

author: DiTBho
author_rank: Super Contributor
timestamp: January 21, 2024, 11:01:11 am
content: Quote from: janoc on January 20, 2024, 09:16:45 pmI'm developing x11 terminals { mechanics, hardware, firmware, kernel-support, userspace-support, apps } that must work exactly as "screen/tmus" works, i.e. offer the possibility of being able to allow you to run X11 programs on a remote host, direct their display to your local machine (my X11 terminal), and then to disconnect from these programs and reconnect from the same or another machine(s), without losing any state.That's "screen for X11", a persistent connection.Quote from: janoc on January 20, 2024, 09:16:45 pmI don't know if I will support OpenGL, anyway, Web-browers are always problematic for X11.They require too much bandwidth, they move too many tcp/ip connections: luckily I don't have to support any browser(1), or video player, only X11 applications like { Geany, nedit, ... or even things that rely on openMotif } therefore very light.(1) must be "distraction free": no browsers/Youtube, no socials, ...Quote from: janoc on January 20, 2024, 09:16:45 pmThis is precisely the point:to clean up and eliminate everything that is superfluous, physically clone the repo, remove the not wanted code(2), purge Python parts, distill the project, and package it in a "minimal" and "essential" form(2) remove[]={ built-in web client, interact with the various desktop session protocols, forwards stuff like audio, webcams, etc, ... }. Don't need/want these.QuoteActually, umm, I did a similar thing by "hacking" a couple of strange objects built in China that bought on eBay. They capture the XVGA video stream (1024x768, we are on 70Mhz pixel clock, so it is less than 20fps), compress it in H26*, and send it in TCP/IP packets on ethernet 1000Mbit/sec.At the other end I built an ad-hoc application in C (fbcon/directfb) that intercepts the packets and reconstructs the transmitted information on /dev/fb0.It is a very crude system, it works directly in contact with the kernel services, I recently also added audio (remote-out, local-in) and remote keyboard/mouse (local-in, remote-out to kernel /dev/input).The problem is: it somehow works, though.... with three of those things connected to the router I'm literally "pissing off" the OpenSpace guys

author: janoc
author_rank: Super Contributor
timestamp: January 21, 2024, 08:59:05 pm
content: Quote from: DiTBho on January 21, 2024, 11:01:11 amYou have obviously no clue. Xpra isliterally written in Python, with some C extensions written using Cython. So if you "purge Python parts" you will be left with nothing to "distill" into the "minimal and essential form"Quote from: DiTBho on January 21, 2024, 11:01:11 amBut that's not even close to what xpra purports (I don't use it myself) to do. There is a huge difference between doing a "dumb" screen capture, compressing it and streaming it over the network and actually redirecting peripherals, supporting notifications, sound and what not that is required to have a full featured remote desktop session these days.If the dumb capture + keyboard/mouse input is all you need, then just use either VNC or buy/build and deploy something like PiKVM (https://pikvm.org/) and don't mess with (and complain about dependencies of) tools that are not intended for your use case. It is a long solved problem.

author: DiTBho
author_rank: Super Contributor
timestamp: January 21, 2024, 09:39:35 pm
content: Quote from: janoc on January 21, 2024, 08:59:05 pmthese days, then you have to remove them in order to promote "distraction-free" solutions(e.g. remarkable2+folio marketing vs a laptop)Quote from: janoc on January 21, 2024, 08:59:05 pmThe difference, from my point of view, is thepersistent connectionmade "with-in X11", rather than passing through an hw+sw hack as KVM.

author: abeyer
author_rank: Frequent Contributor
timestamp: January 22, 2024, 01:43:21 am
content: Quote from: DiTBho on January 20, 2024, 06:13:02 pmI don't know of anything. There's been a longstanding request to implement X11 forwarding in mosh, which might work for this use case, but afaik it's never been implemented. I'd love to see it built there, though that wouldn't be 100% dependency free.Quote from: DiTBho on January 20, 2024, 06:13:02 pmI suspect you won't be able to get along without Xft as well, since most modern software is going to be reliant on freetype and client-side font rendering.

author: ejeffrey
author_rank: Super Contributor
timestamp: January 22, 2024, 04:25:10 pm
content: NX is a non python terminal multiplexer for x11. It's not "dependency free" but might be closer to what you want than xpra.