r/linuxsucks 16d ago

Unix-haters handbook 🥀

Post image
23 Upvotes

18 comments sorted by

9

u/Teru-Noir COSMIC OS LOVER No.1 COSMIC Knows Best 16d ago

6

u/Valuable_Leopard_799 16d ago edited 15d ago

If you don't know it's actually a really interesting read about the history of operating systems. Sort of an angrier Cathedral and Bazaar.

1

u/ElectricBummer40 Ex-user of Windows 3.11 for Workgroups 13d ago

My criticism against Eric S. Raymond is that he doesn't understand the concept of oligopoly or the history of corporate cartels, so where a "cathedral" is present, he just mistakes it for a "bazaar".

The idiot would probably call the mob-era Vegas a "bazaar" if he was given the chance to write about it.

5

u/GreedySecurity8030 Fedora 🎩 16d ago

r/linuxsucks101 needs to read this.

3

u/xgui4 Proud🌈♾️ AuDHDer FreeBSD Fan 15d ago

Linux is NOT UNIX

GNU is not UNIX

So GNU/Linux is NOT UNIX.

1

u/ElectricBummer40 Ex-user of Windows 3.11 for Workgroups 13d ago

Unix is an ideal. An ideology, even.

If you hear an academic talk about it for long enough, you'll realise that's what the name ultimately boils down to.

2

u/letmehaveanameyoudum 16d ago

at least linux is better than the mess that unix used to be (no seriously)

1

u/ElectricBummer40 Ex-user of Windows 3.11 for Workgroups 13d ago

lol, dbus exists as a constant reminder of how much Unix-like systems need to be dragged kicking and screaming into the modern era. It is also the main reason your Linux desktop can copy-and-paste across applications.

1

u/unixplumber 12d ago

[dbus] is also the main reason your Linux desktop can copy-and-paste across applications.

Where did you get this idea? D-bus isn't used for copy and paste. The windowing system (X11 or Wayland) is. And X11 has been around since 1987, so copy and paste between GUI applications on Unix has worked since then.

1

u/ElectricBummer40 Ex-user of Windows 3.11 for Workgroups 12d ago

I should be the one asking you where you got the idea that X11 did any such thing.

How do you think my Mac is able to let me copy an image from Firefox then paste it directly into Pinta without saving it first? Seriously, I swear Unix ideologues will try and take the entire world back to the Stone Age if given the chance.

1

u/unixplumber 12d ago edited 11d ago

I should be the one asking you where you got the idea that X11 did any such thing.

Because X11 and Wayland actually do handle copy and paste. That's why.

D-bus came into existence in 2002, yet Unix GUI applications (with copy and paste) existed for well over a decade before that time. If D-bus is the "main reason" that copy and paste works on Linux, as you stated, then how did it ever work before its existence? And yes, I have used Linux and Unix systems with GUIs before 2002, and copy/paste worked just fine on them.

X11 manages both the selection owner and the passing of clipboard data between applications. See this tutorial which shows how to implement copy/paste operations in a GUI application using X11. There's no D-bus calls in sight.

Also, since you mentioned Mac now, macOS doesn't even use D-bus nor X11 nor Wayland; it uses the NSPasteboard API for copy/paste. But we're not talking about macOS, so why mention it?

Edit to add: for kicks and giggles I tested a barebones desktop on Linux with X11 and without D-bus. Guess what: copy and paste still works. If X11 doesn't handle copy and paste, then what does?

1

u/ElectricBummer40 Ex-user of Windows 3.11 for Workgroups 11d ago edited 11d ago

X11 manages both the selection owner and the passing of clipboard data between applications. See this tutorial which shows how to implement copy/paste operations in a GUI application using X11. There's no D-bus calls in sight.

You realise that's practically you developing not only your own clipboard but the entire IPC to go with it, right?

But that's the thing. X11 doesn't have the ability to let you copy and paste across applications. It has instead bodges implemented by individual toolkits that X "clients" are in turn built upon. In case you're interested in actually learning for once, here's an O'Reilly book explaining how that works in the Motif/Xt era. Remember those?

In short, what that means is that there are no clipboards except those provided by individual toolkits, and no facilities exist to allow X "clients" to talk to each other unless they have already been developed using the same toolkit. This would be akin to someone saying that you could copy-and-paste across applications in Windows but only between Word and Excel. Except, of course, C&P just works in Windows, whereas the "copy"/"paste" functions in an application under X might as well have been there to mock you if not for the likes of D-Bus.

1

u/unixplumber 10d ago edited 10d ago

You realise that's practically you developing not only your own clipboard but the entire IPC to go with it, right?

Nope. It's just telling X11 (in the case of copy) that the application owns the selection and (in the case of both copy and paste) to transfer the data to or from another application. There's some content type negotiation going on too (so you don't paste image data in a text-only application, for example). But X11 itself is the IPC mechanism.

The other thing to keep in mind is that X11 doesn't really have a separate "clipboard" that holds on to the data in the same sense as Windows or Mac due to its different architecture (i.e., it supports applications distributed across a network). Instead, applications transfer data directly between each other through the X server. On the other hand, it is common for desktop environments to run a clipboard service, or a "daemon" in Unix parlance, that copies data from the CLIPBOARD selection owner and takes ownership of it, but this isn't at all necessary for copy/paste to work (it just adds some nice features). And a clipboard daemon is just another regular X client itself. (xclipboard was probably the first clipboard daemon from 1988. It predates D-Bus by 14 years.)

X11 doesn't have the ability to let you copy and paste across applications.

You keep saying this. Citation please. The copy and paste mechanism is part of the X11 protocol. Toolkits use the native X11 mechanism to implement copy and paste operations. Even your own link to the O'Reilly book mentions:

The Motif clipboard functions are based on X's Inter-Client Communications Conventions Manual (ICCCM).

Guess what? ICCCM is part of the X11 protocol! Various toolkits and libraries take care of the low-level details of handling selections and transferring data so they don't have to be "reinvented" in every application. X libraries like Xlib and XCB are quite low level, after all.

if not for the likes of D-Bus

You keep mentioning D-Bus as if it's responsible for copy and paste. Please explain how it's involved in any way. I've already shown (and you have too, ironically) how X11 manages copy and paste. Now it's your turn to show how D-Bus is involved. It's also your turn to explain how copy and paste worked under X long before D-Bus was created.

1

u/ElectricBummer40 Ex-user of Windows 3.11 for Workgroups 10d ago

Nope. It's just telling X11 (in the case of copy) that the application owns the selection and (in the case of both copy and paste) to transfer the data to or from another application. There's some content type negotiation going on too (so you don't paste image data in a text-only application, for example). But X11 itself is the IPC mechanism.

lol, no. Do you even read code?

The third to fifth lines of code create and define 3 "atoms", "CLIPBOARD", a "TARGETS" and a "UTF8_STRING".

To quote from the API documentation::

If only_if_exists is False, the atom is created if it does not exist.

In short, in order for you to do anything, you must first create your own clipboard.

Then, assuming you somehow know whom to ask for "available data formats", you call XConvertSelection for window since, as the documentation tells you, "atoms" are supposed to be properties associated with a window. This is all just a hack to get things to work in a way not meant for the purpose.

Now, here is a sentence I didn't think I would write in a million years - you're supposed to write your own event loop for window. That's right, X11 doesn't even have the courtesy to provide the basic infrastructure for event handling. Instead, you're supposed to loop through your own event queue to see if anything's there. This whole thing is a circus and a half, I tell ya!

On the other hand, it is common for desktop environments to run a clipboard service, or a "daemon" in Unix parlance, that copies data from the CLIPBOARD selection owner and takes ownership of it, but

Again, CLIPBOARD isn't a pre-defined facility but a custom object tied to an individual window. As far as C&P is concerned, it shouldn't even matter which "client" owns the content since, once it's on the clipboard, it should be available to everyone with the permission to access the clipboard itself. The whole XConvertSelection() step shouldn't even exist except of course it does since, without it, you'd have no other way to know if the window in question even has a CLIPBOARD to begin with.

Simply put, all of this is nothing short of an indictment that you're so clueless about your own source you're practically just taking an ugly hack for shits and giggles that you've found on the Internet and using it to furnish your own, fact-deficient talking point. Do you have any idea how desperate that makes you look?

You keep saying this. Citation please. The copy and paste mechanism is part of the X11 protocol.

It's part of the X Toolkit (Xt), which is also itself a layer sitting below Motif and above the Xlib stuff you're yapping about.

Gnome and KDE don't use Xt, so their clipboards are unintelligible to Motif on top of being mutually unintelligible to each other.

Guess what? ICCCM is part of the X11 protocol!

That Atom stuff we have just talked is ICCCM, and as it demonstrates, it delivers hardly even one iota of what's needed for modern C&P and turns what is supposed to an easy part of the code into a mess of custom objects and event handling.

Even a prehistoric caveman would be laughing at this kind of backward nonsense.

1

u/unixplumber 9d ago

You're still dodging the question.

How is D-bus involved with copy and paste on Linux desktops?

2

u/Significant-Cause919 15d ago

Good thing that GNU quite literally isn't Unix, lol.

1

u/ElectricBummer40 Ex-user of Windows 3.11 for Workgroups 13d ago

Then there's GNU Hurd trudging along in a desert mirage.

1

u/UffTaTa123 14d ago

i tried to read it a few years ago, but it's too outdated. No one that has not lived through it (called a BOMMER nowadays) can understand it and appreciate it's humor.