The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

colors from Xdefaults

asked 2015-02-25 13:27:52 +0000

Kaligule gravatar image

updated 2015-02-25 13:29:36 +0000

Hello,

I would like to use the colors I defined in ~/.Xresources for my i3 config.

For example, in ~/.Xresources I have

#define S_orange #cb4b16

#define S_red #dc322f

#define S_magenta #d33682

and now I would like to use S_blue in my i3 config like

client.focused Sorange Sred S_magenta

or similar. Is it possible to use the settings defined in ~/.Xresources (or .Xdefaults) in i3?

edit retag flag offensive close merge delete

Comments

Small addition: There are tools such as themer that allow you to manage this with templates, if you like.

airblader gravatar imageairblader ( 2015-03-01 00:34:30 +0000 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-02-26 14:54:20 +0000

ANOKNUSA gravatar image

This is not possible. The i3 text parser does not read any files other than the i3 configuration file, and the environment is not sourced when starting i3. Variables for values can only work if those variables are declared within the i3 configuration file itself, as mentioned in section 4.11 of the User's Guide:

Variables are directly replaced in the file when parsing. Variables expansion is not recursive so it is not possible to define a variable with a value containing another variable. There is no fancy handling and there are absolutely no plans to change this. If you need a more dynamic configuration you should create a little script which generates a configuration file and run it before starting i3 (for example in your ~/.xsession file).

edit flag offensive delete link more

Comments

Thank you.

Kaligule gravatar imageKaligule ( 2015-02-27 10:58:00 +0000 )edit

Question Tools

Stats

Asked: 2015-02-25 13:27:52 +0000

Seen: 307 times

Last updated: Feb 26