Running wofi
1.2.4 on Arch.
The CSS @import
directive reads the path given relative to wofi
's
current working directory instead of the stylesheet's as would be
expected.
For example, given the following directory structure, with wofi
being started with ~
as the cwd
(what I assume is the most common
use case):
/home/$USER |-- .config | |-- wofi | | |-- config | | |-- style.css | | |-- foo.css
Given a style.css
with @import "foo.css"
at its top, instead of
~/.config/wofi/foo.css
being imported, there is instead an attempt
to read ~/foo.css
, which fails. Should the file in fact be present
in ~
then it is loaded as expected.
I apologise for the formatting mishap, for I keep forgetting sometimes two newlines are necessary for a line break to occur.
The filesystem example was meant to look as follows:
`/home/$USER
|-- .config
| |-- wofi
| | |-- config
| | |-- style.css
| | |-- foo.css`
I'm extremely sorry.
I am having that issue as well.
wofi -s /home/$USER/.config/wofi/style.css (wofi:37088): Gtk-WARNING **: 23:36:03.452: Theme parsing error:<data>:1:29: Failed to import: Error opening file /home/max/.config/foo.css: No such file or directoryThe workaround is to adjust the imported style sheet path by adding
wofi/
prefix such as:@import "wofi/foo.css";
Thanks for bumping this. Due to wofi being somewhat inactive I miss a lot of the bug reports. I'm not sure if there's actually a way to fix this without having wofi set its cwd to the wofi config folder, which actually might be ok. I believe GTK is just using the program cwd for handling @import, which likely makes some amount of sense from GTK's perspective. I don't have a problem changing this I'm just trying to think if there's any gotchas or problems that could be caused by wofi fixing it's cwd
Erratum on my previous message. I executed wofi from my local
~/.config
diectory...But actually, one can change the working directory before running wofi in a script:
#!/bin/bash cd ~/.config/wofi wofiWith the import of further css files in style.css using a relative path:
@import "foo.css"As you said, it is likely that GTK align the current working directory on the location where wofi is launched.