naki,
I see how some people tend to dsilike gui,
say that it's bloated and switch to tui.
They also love rust,
and use only rewritten
tools,
and at all productive is their second name
I thought so too. Like, why would I want to use a gui if I already have a terminal opened? Isn't tui more lightweight hence better?
But I changed my mind. And I won't say tui lacks images: it's rather that the problem and its solution are partially my point
First of all, let's refresh the user interface history. First interfaces consisted of punched card readers and printers. Then teleprinters were invented: that's a cli: command line interface. You type a command and its output is printed on a paper
Then printers were replaced by digital displays. The speed of print increased a lot. But more importantly it became possible to draw interfaces. With printer you could draw an interface too, of course. But the problem is that this would take too much time and paper while being without much advantages. Now, a cool interactive interface can be easily drawn on a digital screen. This is called tui, and programs such as vi or ncdu utilize it
Then computers became more capable and displays started offering a feature of showing actual graphical images, so there was a room for a graphical user interface evolvement
So why was I telling all that? Well, as you can see, tui was a technique to display graphics when hardware was not capable of doing real graphics: it's just an intermediate step
Nowadays every computer has a graphical display. Text-only terminals are only simulated, and even ttys in linux are nothing but a simulation displayed on a graphical display
Furthermore, I'd say that emulating graphics in a terminal is a stupid kludge. Terminal per se is an input and output stream, and streams are linear and therefore don't support any graphics. So, some escape code sequences were invented to move cursor around, to change color etc. In my opinion, this is not how things should be done. I don't think that an idea of adding some magic actions to extend functionality is that good
Again, maybe, that was a fine thing in days when text-only glass terminals were the only things available. But now one can simply draw pixels on a screen, without sending any magic requests to the terminal
By all that I wanted to say that gui is cleaner than tui. Latter relies on a kludge, whereas former already operates on a grid of pixels and lacks a need of inventing some escape code sequences
As for performance, gui is not that worse than tui. First, keep in mind that tui is implemented in gui. Second, even if gui is heavier, the difference would be negligible in comparison to other features of an application. I mean, if there's a tui editor that loads all the file into the ram, and a gui editor that loads only the needed part on demand and then unloads it, then the latter is more lightweight even though it's gui
Finally, mice. I don't consider time to move a hand from a keyboard to a mouse that of a waste of time. All that productiveness is just improving something for the sake of improving something, so why would one care
I already said why gui are cool. But how do they operate? Usually, gui consists of windows. And it's possible to have multiple of them, and for example switch between them
And I want to say that a mouse is cleaner for gui than a keyboard
I think the simplest example of a needed functionality of a window manager is switching focus between windows. Like, how do you switch between opened applications?
Well, if window manager is a keyboard-based one, then it needs to register some keybind. For example, pressing arrow buttons switches between windows, done. But let's imagine I start an application that binds arrows as well. What should happen then? Window manager should intercept all arrow button presses. It's possible to invent an escape key: for example a hash sign. So, you press hash and then an arrow, and then this event is passed to an application. This is what, for example, tmux does
To me this approach is smelly. What if I connect to another machine using the same window manager? Then if I should escape all the focus switches for that connection, then if i want to use an appliication that uses arrows inside of that connection, I have to escape them twice
Of course, there are different solutions ranging from "Let's make a grab combination then" (like qemu does) to "Don't do conflicts and you'll be happy"
But there's a solution that works without any buts. Mouse. Let's say, that if a mosue is in an application zone, then all events are passed to that application, and if there's no application under the cursor then events are passed to the window manager. That's it. Focusing is done with cursor moving, other actions like resizing or opening new windows can be done as actions passed to the window manager directly. It's done that way in, for example, acme
That way, no escaping is needed. Mice are natural for gui, and gui is not a bad thing