Here's a way to config i3 specific to a computer within a single i3 config file.
This is a version of this article's solution with a few more basics for a n00b like me.
Set a Hostname
First, we must identify our particular computer. We'll do this by setting a hostname. I'll call my host
hostnamectl set-hostname rexkwando
Usually, if I was setting my config in i3, I might set a font face and size like this, the font being "BlexMono Nerd Font Mono" and the size being "10":
font pango:BlexMono Nerd Font Mono 10
But now I'm going to set that font family and size definition in a file that understands hostname conditionals, and that's
*i3font: pango:BlexMono Nerd Font Mono 10 #ifdef SRVR_rexkwando *i3font: pango:BlexMono Nerd Font Mono 12 #endif
This creates a variable named
i3font. The standard font size is "10". But inside the conditional, which checks for a hostname of
rexkwando, the font size will be set to "12".
Using .Xresources Config in i3
And it turns out that i3 can load this i3 variable using
set_from_resource $i3font i3wm.i3font pango:BlexMono Nerd Font Mono 10font $i3font font $i3font
set_from_resourceloads the value from X and a fallback if it's not there and sets it in
fontsets the font for i3 from that value.
Reload to See It
Once you have hostname set,
i3/config, you need to reload them.
~/.Xresources, go to your terminal and type:
To reload i3, use your key shortcut, for me:
bindsym $mod+Shift+c reload
Or in terminal:
rexkwando, you'll see a larger font. Just break the wrist and walk away.