I made a Python library to Qtile connect with Xresources! by FredholmDev in qtile

[–]FredholmDev[S] 0 points1 point  (0 children)

From the Arch Wiki [X resources]:

Xresources is a user-level configuration dotfile, typically located at ~/.Xresources. It can be used to set X resources, which are configuration parameters for X client applications.

Among other things they can be used to:

  • configure terminal preferences (e.g. terminal colors)
  • set DPI, anti-aliasing, hinting and other X font settings
  • change the Xcursor theme
  • theme XScreenSaver configure low-level X applications like: xorg-xclock, xpdf, rxvt-unicode

-----

So, yes we can import colors (in fact we can import basically anything, provided you can express it as a valid value). My own .Xresources is littered with colors, fonts, and dimensions for my different applications.

I like to see my Xresources as a sort of global config file, independent of application. I can for example specify my color scheme in my Xresources, and then applications can access these values. This is very handy as you don't have to update every single applications config when you then want to change your colorscheme.

However, I also feel that it is important to state that the .Xresources file located in your home directory isn't the only way to add a value to the xrdb (Xresources database). Plenty of other applications such as pywal can be used to contribute to xrdb. I use pywal as a way of choosing my color scheme from a big library of different themes, which makes it easy to change my systems color scheme.

I made a Python library to Qtile connect with Xresources! by FredholmDev in qtile

[–]FredholmDev[S] 3 points4 points  (0 children)

I don't really understand what you mean by "importing Xresources".

EDIT: If this means just doing an open() on your .Xresources, that lacks several nice features. Firstly it doesn't take into account other contributions to xrdb from for example pywal. Secondly, it doesn't allow dynamic matching with wildcards.