12 ms·
The failure of the idea of X resources
- gorgoiler 5y agoThis might be a little philosophical for some, but if you ever needed evidence of the awesome level of human contribution to the world of free software, then these kinds of chaotic configuration puzzles are a great example. Take a walk around /etc and you’ll also see evidence of the diversity of contributions in the diversity of config styles. It’s like a community center that has a completely weird set of chairs in the dining area, because every chair came from a different random donation. The design shambles is an awesome emergent property of the level of community engagement. With apologies to ”Facebook is a chair”.
- bitwize 5y agoIndeed. It hearkens back to when Linux was punk. I remember booting it for the first time and watching the kernel say thousands of different things authored by thousands of different hands. These days the scene is dominated by people who think "Everybody listens to boybands so we have to become a boyband too." And shame anyone who speaks up in disagreement.
- throwaway82652 5y agoNot shown: the unpaid volunteers who have to continually figure out who gets what chair, deal with constant complaints from people who sat in a chair they don't like and want another one, figure out how to store the chairs, figure out how to repair each individual chair with its own unique and hard-to-find materials when it breaks, figure out what to do when people start bringing in recliners and sofas that take up all the space... Did I mention you don't get paid for this? And if you ever suggest removing a broken chair, you get a thousand angry emails flaming you because people are emotionally attached to the chair despite it having exposed nails that stab up into the rear end of anyone who sits in it? And if you push back you get absurd comments like "oh the nails are only on the left side, just lean constantly on your right buttock and you won't get stabbed by the nails"
- kirbyfan64sos 5y ago> And if you ever suggest removing a broken chair, you get a thousand angry emails flaming you because people are emotionally attached to the chair despite it having exposed nails that stab up into the rear end of anyone who sits in it? And if you push back you get absurd comments like "oh the nails are only on the left side, just lean constantly on your right buttock and you won't get stabbed by the nails" This is one of the greatest comments I have ever seen.
- jancsika 5y agoThe only thing missing is the exact replica of the community center that got built because some patrons prefer the daily opening and closing procedures be kept in an old hand-written notebook instead of a printed booklet.
- smoldesu 5y agoAnd the part where they tear down the new community center in preparation for the next one, while the replica continues to serve it's happy patrons far into the future.
- throwaway82652 5y agoNobody has torn down any community center. The old community center with all the old chairs are still there, forever archived in case anyone wants to keep using them. I don't think you can say the patrons are happy either, otherwise they wouldn't keep complaining about the new community center that they've professed they don't even want to visit.
- aseipp 5y ago> And if you ever suggest removing a broken chair, you get a thousand angry emails flaming you because people are emotionally attached to the chair despite it having exposed nails that stab up into the rear end of anyone who sits in it? Also 8/10 of these people have used this chair 3 times, grand total of 15 seconds maximum, at best. If you are lucky these occurrences were within the past 10 years. But again: don't you dare do it unless you want an essay on why that shitty chair is actually the most platonically ideal chair that ever graced Gods Earth. Until you fucked it up, that is.
- badsectoracula 5y agoThe reason X resources "failed" - though i do not think they really failed because they do what they are supposed to do - is actually very simple: aside from applications based on Xt and a few others using xlib,etc directly and decide to bother, pretty much no application uses them, often for the same reasons no application uses xlib or xt or even motif directly: partly fashion (IIRC back when they were fashionable and apps used them KDE1's themes would set up X resources for these applications to pick up the same colors as Qt and Gtk apps) and partly because they work only under X11 when many open source applications try to use cross platform solutions (and Qt and Gtk provide their own solutions for the same tasks that do pretty much the same thing but also work in Windows and Mac). At the end of the day X resources are just key-value pairs and the file allows for wildcards, includes, etc so if anything they can be more flexible than the adhoc configuration files many programs use. But there isn't anything special about them, you might as well say that GetPrivateProfileString failed because people write their own INI parsers :-P
- throwaway82652 5y ago>i do not think they really failed because they do what they are supposed to do No, this is wrong. If they were supposed to be a way to configure applications, they failed because they're actually bad for configuring applications. It's basically putting a giant global .ini file into the X server that can't be read or updated without reprocessing the whole thing. I bet you can think of a few reasons why it's a terrible idea to do that. It might make sense in a motif-only world if all you're trying to do is change some global settings, and you never want to have a GUI that can safely change those settings. But the utility of that disappears when you have more than one toolkit with its own settings. They're not the same as GetPrivateProfileString, those manipulate individual files. Xrdb would be like if you you were only ever allowed to call GetPrivateProfileString on one file across the whole system. And yes I know apps can put in whatever logic they want to load their own resource files. If you do that then there is no point to using them over some other configuration mechanism stored outside the currently running X server.
- badsectoracula 5y ago> If they were supposed to be a way to configure applications, they failed because they're actually bad for configuring applications They are at most as bad as any other key-value storage. > It's basically putting a giant global .ini file into the X server that can't be read or updated without reprocessing the whole thing. You can update X resources without reprocessing "the whole thing" - in fact there isn't even a single "whole thing" to process, you can have resources in separate files, import them at any point or even change individual resources. Example: echo 'XTerm.vt100.background: gray10' | xrdb -merge This updates a single resource, leaving everything else as-is, not even involving any files (but the exact same resource could have been inside a file too). > the utility of that disappears when you have more than one toolkit with its own settings. X resources are not locked to a single toolkit, they are locked to X11, but any application using any toolkit could use them. > They're not the same as GetPrivateProfileString, those manipulate individual files. This is irrelevant to the point i was making with referring to GetPrivateProfileString, which was about applications using their own (or their toolkit's) INI parser instead of using what is provided by Windows.
- deleted 5y ago[deleted]
- Epiphany21 5y ago>X resources don't have good answers if you want the same program set up in a few different ways (several setups of xterm, for example) This isn't true. Let's go with the example program provided. XTerm supports the -name flag, which will make it respond to existing resources using that name in the resource database. .Xresources: customxterm1*some*resource: colorhere customxterm1*another*resource: fonthere customxterm2*some*resource: colorhere customxterm2*another*resource: fonthere Then you can launch xterm with "xterm -name customxterm1" and it'll pick up the resources. Edit: Formatting on this site is a pain.
- smhenderson 5y agoBut the author did mention that, albeit not with the level of detail you do... (X resources can sort of be used to provide different options for different invocations of the same program, but how to do it isn't necessarily obvious, it requires additional command line options to the program, and even programs that use X resources don't always support it.)
- Epiphany21 5y agoApps that don't support that flag can be used with the -xrm flag instead. You can put a bunch of these into a wrapper script like this xterm -xrm "someresource: color"
- throwaway82652 5y agoThat doesn't change what the parent post said. Apps still have to explicitly support that xrm flag. Some apps just don't support it.
- Epiphany21 5y agoThis is a toolkit problem then. Apps that use an X11 native UI toolkit like Xaw or Motif will respond to the -xrm flag. It's not the fault of X11 if third party software refuses to follow existing specs.
- sprash 5y agoI think XResources are great. As a programmer you don't have to design a new configuration language and write a parser for it for every new program. However, what makes XResources better than all other configuration systems out there is the wildcard operator (e.g. Want all programs to have black background? simply do "*background: #000") and the fact that remotely forwarded programs also use your local configuration values automatically by default.
- throwaway82652 5y agoThe wildcard operator is probably the worst part, because it makes it impossible to know whether any given setting is going to affect any given program. The only way to know is to restart the program and check if something changed or not. It's also impossible to have a reliable way to edit those wildcard properties from a configuration GUI, for the same reason. The better way is to just have an intentional global setting if that's what you're trying to do. On modern Linux those too can be remote forwarded over D-Bus or with any number of other mechanisms. A configuration system based on wildcard or regex matching is always going to be fragile and hard to use.
- forgotpwd16 5y ago>Modern Unix settings systems do tend to have such global defaults, although part of that is that they often see themselves as part of a coherent system of programs (Gnome programs, KDE programs, etc) Don't those systems have some of aforementioned issues? E.g. is it possible to have several setups of a program utilizing gsettings?
- dredmorbius 5y agoA contrast of X Resources with other modes of configuration, such as the GNOME / KDE / FreeDesktop model reveals some interesting twists. Under X Resources, no, I can't dynamically change the resolution or configuration of a running process. On the other hand, I can update resources and configure different applications independently. One of my frustrations with GNOME/KDE is that the configuration system seems to think that I want the same settings for every application presently running. This might very well not be the case: I could prefer larger and/or different fonts for specific applications or for specific processes or windows. The uncoupling of settings in some cases (e.g., text / font zoom in some apps) suggests that the FreeDesktop folk have become grudgingly aware of this. Many old-school Xt / Motif utilities will also accept commandline options, either via flags or in some cases resources specifications. These can be tied together in scripts to launch, say, a range of values (fonts, sizes, colours) for specific tasks. I'd long done this to differentiate between terminals running (nominally) bash shells, vim, mutt, w3m, and a launcher which would open a set of terminal windows, each with different background colours and geometry specifications to be placed over a desktop workspace when working on multiple remote hosts (colours, prompts, and spatial cues to "this is not your local box"). And of course, since resources live in files, they can be documented, commented, and divided (separate files) for various tasks, as well as version controlled. Few if any of which the GNOME configuration database permits. The files can be readily copied between systems (as I've done for decades). X Resources can be clunky in some regards, but they're also lightweight, powerful, configurable, and get out of the way rather than obstruct my goals.
- h2odragon 5y agoThe failure began when, in the name of "compatibility" or whatever, there could no longer be improvements to the standard. When you enshrine the rot you assure its spread.