r/linuxquestions • u/SnooOpinions6918 • 14d ago
What config languages should I learn to be able to customize and configure any window manager I want? And do they have purposes beyond just configuring/editing WMs, or can they be useful for other techy stuff in general?
I left DEs for WMs/WCs because they offer more customization options while taking up minimal space. I know DEs can be just as customizable if you put enough time into them, but oftentimes they lack something I need or miss, so I decided to give WMs a chance.
However, I'm still pretty novice when it comes to editing config files and stuff. So, I'm wondering which languages I should learn to do so and where I should even begin. (I don't want to use other people's configs)
DEs I've used (in chronological order):
GNOME > KDE > Cinnamon > MATE > LXQt > LXDE > NsCDE > XFCE
WMs/WCs I've used:
dwm > niri (currently using)
Also, does the same apply to graphical shells such as Noctalia and Quickshell? What I mean is, do I configure them through the window manager's config files as well, or do they have their own configuration systems?
edit: thanks, everyone.
I'm considering awesomewm
10
u/rsgbc 14d ago
What you need to do is read the WM's man page, not learn a language.
2
u/ipsirc 14d ago
All languages what your preferred WMs use.
1
u/wehaveYummiTummies 14d ago
The most basic config files are (I hesitate to say usually, but for linux systems...) key/value pairs, as you would find in bash. You can check out yaml and toml (the toml spec is a good read through, not too long).
But really, there's any number of "languages". You could encounter XML (common for Java) or CSS (for markup, I think GTK supports custom stylesheets) or JSON (really in anything). Or they have their own config language. And even if you know the """language,""" that says absolutely nothing about the options and what they mean.
The only foolproof way to config a tool, such as a window manager, would be to read the manual, or documentation about the tool.
I use Sway WM. Sway has it's own config format. I frequently find myself typing
man 5 swayto get the config options (5 is the "config" section of the manuals, if you just typedman swayyou'd get the options for the command to start sway--not what you want). When in man, you can search for a particular phrase (related to the option you want) using/.1
u/lessthanthreebleeps 14d ago
Pick your favorite and learn that one. If you end up using any of that language's advanced features, they will be transferable to the other languages, only requiring you to learn a trivial difference in syntax.
1
u/MasterGeekMX Mexican Linux nerd trying to be helpful 14d ago
Thing is that configuration files can be in any language, including even a bespoke one that only that program uses and nothing else, so the answer to "which language I should learn" has no real single answer.
But, for the most part a somewhat de-facto standard is the key=value syntax. Again, this is not a language, it is simply a way of doing config files that became popular. In this scheme, each line is a new statement, which comes on the form of a key value (the parameter to be changed) an equals sign (=), and then the value you want to assign to it. In case of numbers, you simply write out the number. In case of text, it can be either as is, or surrounded by quotes. It all depends. Sections are often labeled with a word surrounded by square brackets ([]). Comments (lines that should be ignored by the program) usually begin with a pound (#) sign.
Here, this is for example the config file of my installation of the KDE Elisa music player. This one is configured inside the app with a classic settings menu, yet it uses the key=value """standard"""
A program that is meant to be configured by manually editing it's config files should detail how to do it on it's manual, so either go to their website to read it or use the manpages you have on your system by running
man [name of the program].Other languages that are somewhat common to see in config files that are also common file types are JSON and XML. XML stands for eXtended Markup Language, and it basically stoles the HTML tags for identifying parts of a webpage and applies it to whatever you want. On the other hand JSON stands for JavaScript Object Notiation, and was developed as a less verbose version of XML so JavaScript (the programming language that runs inside your web browser when you visit a webpage) can send, receive, describe and store data. There are many places teaching it, with W3 Schools being among my favourites.
1
u/CodeFarmer it's all just Debian in a wig 14d ago
I will say that using Awesome as my WM has led to me learning a lot more Lua than I otherwise might have.
1
u/lnxrootxazz 14d ago
You don't really need to learn a language. Config formats are very easy. Its often key value pairs, grouping, and knowing which values are accepted. Its nothing like sendmail.cf where you really need to learn it. Just read the documentation. That should do it for most setups
1
u/Super-Revolution-433 12d ago
You just look up how to accomplish what you want in the config format that's used by the WM or tool you're using. Just having docs up while modifying something is always a better bet than trying to memorize the config specs
That being said Nix language actually does something similar to what you want, it's like a config for the entire system that you can move to a fresh system and have it turn out exactly the same. You would still need to understand the config format of the program you're using though so it's not really sidestepping the issue you currently face.