Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hot reload css files imported in style.css #468

Open
helixoid opened this issue Feb 24, 2024 · 3 comments
Open

Hot reload css files imported in style.css #468

helixoid opened this issue Feb 24, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@helixoid
Copy link

helixoid commented Feb 24, 2024

I am using wallust (rust replacement for pywal) and whenever I change my colorscheme it doesn't reload the css colors stored in ~/.cache/wal/colors.css but if I open and save the style.css file, it reloads the css style.

I know I can do ironbar load-css to hot-reload any external css file, but it would be awesome if ironbar hot-reloads the css files imported with @import in style.css by default.

Currently I have exec-once = sleep 3; ironbar load-css ~/.cache/wal/colors.css in my hyprland.conf which does the job.

Let me know if this is possible to do in future.

@helixoid helixoid added the enhancement New feature or request label Feb 24, 2024
@helixoid helixoid changed the title Hot reload css files imported in style.css Hot reload css files included in style.css Feb 24, 2024
@helixoid helixoid changed the title Hot reload css files included in style.css Hot reload css files import in style.css Feb 24, 2024
@helixoid helixoid changed the title Hot reload css files import in style.css Hot reload css files imported in style.css Feb 24, 2024
@JakeStanger
Copy link
Owner

From a quick glance through the GTK API docs, this may be possible if I can easily parse the imports.

The file watcher watches the stylesheet's parent directory for changes in order to support temp files from editors such as vim. This would need to be repeated for every import, and I guess ideally recursively in case an import handles an import. The logic around that might get a little tricky and I don't want to overcomplicate things, so I'll see what I can do.

@helixoid
Copy link
Author

It works on waybar have a look at the last option in bar config.
The "reload_style_on_change": true option makes it work like that and I have tested it.
I really like this project more than waybar mainly because of rust :) and favorite workspaces hope it makes it to the next release.

@JakeStanger
Copy link
Owner

JakeStanger commented Feb 25, 2024

Cheers for that, good to know it's at least possible. It looks like they just pull out the import paths with a regex. I'd prefer to...not do that if possible but I'll have a play, and resort to that if needed.

To set realistic expectations, it's unlikely I'll get to this myself for a while, and almost certainly not for next release as I've got a big pile of issues to work through. If anybody else wants to pick this up though, PRs are welcome as always :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants