LBCrion / sfwbar

S* Floating Window Bar
GNU General Public License v3.0
265 stars 17 forks source link

@import statement in sfwbar.css now assumes relative path is relative to $HOME #231

Open jjramsey opened 1 week ago

jjramsey commented 1 week ago

My sfwbar.css file used to have two @import statements that had worked just fine:

@import 'purple-colors.css';
@import 'workrave.css';

Both purple-colors.css and workrave.css were in the same directory as sfwbar.css, and it all just worked.

With the sfwbar compiled from the latest git code, this stopped working, and when I ran sfwbar from the terminal, I saw error messages indicating that sfwbar was trying to load the files $HOME/purple-colors.css and $HOME/workrave.css, and failing.

Currently, I've worked around this by using absolute paths for the @import statement, but this is a bit inconvenient.

LBCrion commented 1 week ago

This one may be impossible to fix. The latest version of sfwbar pre-processes CSS in order to correctly handle the legacy item names. This means we need to load the css via gtk_css_provider_load_from_data rather than gtk_css_provider_load_from_path. In case of the later, GTK uses the path of the file to get the directory, but in case of the former it doesn't have it (and doesn't have a way to supply it). Unfortunately this means there is no way to both pre-process the CSS and to retain it's path for the parser.