Home directory variable in gtk.css

A line in my ~/.config/gtk-3.0/gtk.css has my home directory hardcoded in it:

@import url('/home/myusername/.local/share/.../maximized.css');

I would like to share this dotfile across different users, which is why the home path would need to be variable. Something like this:

@import url('$HOME/.local/share/.../maximized.css');

Is this possible?

Many thanks.

No, it’s not possible.

It seems you could use relative paths that will resolve relative to ~/.config/gtk-3.0:

@import url('../../.local/share/maximized.css');

I just tried it and it worked for me.

2 Likes

Works like a charm, thanks.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.