[GH-ISSUE #468] Hot reload css files imported in style.css #7182

Open
opened 2026-05-23 02:52:53 +01:00 by JakeStanger · 3 comments
Owner

Originally created by @sabisho on GitHub (Feb 24, 2024).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/468

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.

Originally created by @sabisho on GitHub (Feb 24, 2024). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/468 I am using [wallust](https://codeberg.org/explosion-mental/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.
Author
Owner

@JakeStanger commented on GitHub (Feb 24, 2024):

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.

<!-- gh-comment-id:1962647550 --> @JakeStanger commented on GitHub (Feb 24, 2024): From a quick glance through the GTK API docs, this [*may* be possible](https://developer-old.gnome.org/gtk3/stable/GtkCssProvider.html#GtkCssSectionType) 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.
Author
Owner

@sabisho commented on GitHub (Feb 25, 2024):

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.

<!-- gh-comment-id:1962812117 --> @sabisho commented on GitHub (Feb 25, 2024): It works on waybar [have a look](https://github.com/Alexays/Waybar/wiki/Configuration) 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.
Author
Owner

@JakeStanger commented on GitHub (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 :)

<!-- gh-comment-id:1963015332 --> @JakeStanger commented on GitHub (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 in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#7182
No description provided.