Here at Hackaday Central, we fancy that we know a little something about Linux. But if you’d tasked us to run any GUI program inside a Linux terminal, we’d have said that wasn’t possible. But, it turns out, you should have asked [mmulet] who put together term.everything.
You might be thinking that of course, you can launch a GUI program from a terminal. Sure. That’s not what this is. Instead, it hijacks the Wayland protocol and renders the graphics as text. Or, if your terminal supports it, as an image. Performance is probably not your goal if you want to do this. As the old saying goes, “It’s not that the dog can sing well; it’s that the dog can sing at all.”
If, like us, you are more interested in how it works, there’s a write up explaining the nuances of the Wayland protocol. The article points out that Wayland doesn’t actually care what you do with the graphical output. In particular, “… you could print out the graphics and give them to a league of crochet grandmas to individually tie together every single pixel into the afghan of legend!” We expect to see this tested at an upcoming hacker conference. Maybe even Supercon.
We generally don’t like Wayland very much. We use a lot of hacks like xdotool and autokey that Wayland doesn’t like. We also think people didn’t understand X11’s network abilities until it was too late. If you think of it as only a video card driver, then you get what you deserve. But we have to admit, we are humbled by term.everything.
I’ve used X11 since 1988 and I know almost all the tricks at this stage (good and bad). X11 > Wayland in many many many ways, but it does have it’s problems (none of which I am going to list!). I say that even though I own a full set of the X11 manuals (~13 books, at on average 1 kg per book).
Wayland was basically designed as a single user GUI. Long ago I hung about 8-10 cheap diskless clients of a single server and had them network boot and run all their OS and applications over a 10 Mbit/sec half duplex link. Try doing something like that with Wayland today and it would be much much much slower even with 1 Gbit/sec full duplex links, there is just too much bloat. Low networking overhead was not even factored into the design at all.
Try doing that today with X11 and you would have exactly the same problem, except now with the lease useful form of “network transparency” designed for the laziest concept of the 1980s. X11 is brain damage that Wayland does an excellent job of moving the Unix world beyond.
Let cancerous tumors, like X11, drown in chemotherapy.
Where could you buy paper X11 manuals?
They are O’Reilly Manuals, I did not actually buy them. A department in one of the companies I worked at was dumping them because of a global policy change where no software was allowed to be deployed globaly (no matter how good) if it was developed by an individual programmer at any of the company offices (Management fear of the individual employee dying or leaving and having no official means of support/updates). Technically I got them by dumpster diving, in reality they never landed in the dumpster.
“you could print out the graphics and give them to a league of crochet grandmas to individually tie together every single pixel into the afghan of legend!”
I feel like they’re hazy on how crochet works, when it’s something hackers should respect IMO.
Not sure if this is pro-X11 or pro-Wayland. But I think that it’s novel and funny, sort of like cat videos.
We just ran some cat videos through this — hilarious.
Another way to develop a GUI application that can run in a terminal window is the curses library for Python. You can accept keyboard and mouse events and act on them however you like. Which means that at least in principle, you can make a multi-windowed user interface within a terminal window. I used this to produce a user interface that would generate scoreboard and time clock text to use on a live stream. The challenge was that it had to work on institutional MacBooks that were locked down so you couldn’t install an app on them. This sounds like an impossible constraint, BUT you could still run Python.
And now I realize that I just didn’t get it…
Most of these “in the terminal” hacks miss the whole point. They require you to be in a GUI, to do something you can already do in a GUI, but display it poorly in a terminal window.
Why? That isn’t remotely useful.
If I need a browser in a console, I ACTUALLY need a browser in a console. Like, I’m not running a window manager or GUI at all.
Modern “web” is basically unusable at this point with something like Lynx.
Trying to look something up on a forum, get a driver, or download a package from a website is becoming impossible to do from a console connection.
I have had to resort to using my phone, to find a download URL, then type it in manually when I don’t have GUI access on that box…
This is a neat art project, but that is what it is, art. It’s a model car carved from butter just to prove you can. No actual use.
“This is a neat art project, but that is what it is, art. It’s a model car carved from butter just to prove you can. No actual use.”
Much of HaD is a 10:1 scale model 555 carved from Bavarian beaver cheese butter just to prove you can. And goshdarn it, that’s why I read HaD.
Quoting the post: “It’s not that the dog can sing well; it’s that the dog can sing at all.”
So there IS a way to use/pipe Wayland over a network (now). ;-)