-
Notifications
You must be signed in to change notification settings - Fork 17
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
Request for feedback: magick_background widget (background FX) #49
Comments
Here's an example of a frosted glass effect made possible by the latest commits: Settings: "config": {
"image": "...",
"blur_radius": 6,
"brightness": 130,
"saturation": 100,
"css_gradient_overlay": "top, rgba(255,255,255,.3), rgba(255,255,255,.2) 15%, rgba(255,255,255,.3) 95%, rgba(255,255,255,.2)"
} |
I don't think that the configuration should be stored in Would it be possible to store the config information as part of the theme? |
The theme ultimately decides what to do with the information it receives as you can see here. You could create a theme that completely ignores the CSS and implements its own overlay, or ignores the I also don't think we should tie the background effect to the themes in any way, as it requires graphicsmagick, and I'm 100% certain that a lot of users don't want the extra dependency or don't think the effect looks good. While you make a good point that it will be more difficult to installing themes from others I think that the best solution would be that theme creators create themes that will work with any background image, and not depend on this widget. The default theme uses RGBA colors instead of grayscale colors in order to accomplish this. If other themes do the same you could ideally either use the default theme background or any combination of I'm not sure if this is the best or most user-friendly way of doing it though, so please let me know if you have any ideas to how this can be implemented in a better way. |
First of all: holy shit what a lesson in frustration this has been. Thanks for nothing XCB devs, the practically nonexistent docs for working with X pixmaps made this a lot harder than it should have been. This feature enables reading the root pixmap and applying effects directly onto the resulting bitmap so you won't have to supply an image config option to the magick background widget if you set the background on the X root window (feh and other apps do this). Some WMs don't, in those cases you'll still have to specify your background image for this widget to work. The feature works by reading the root window background pixmap, then converting it to a valid BMP file in-memory. GraphicsMagick reads this BMP file and applies effects to the image. Possible stuff that might become issues in the future, and areas that have room for improvement: * system endianness *may* be an issue as we're working directly on RGB integer values stored in memory, so the R and B channels may become swapped on big-endian systems * if X replies with a pixmap that isn't 24-bit the whole thing will probably crash, some error handling should be added for some edge-case scenarios Ref #49
Closing due to lack of feedback. |
I've implemented an alternative way to create background effects, as CSS filters proved to be a bit wonky (the blur effect is a major hassle to implement properly, and the webview frequently crashed due to out of memory errors when testing it with various images and settings).
This feature requires graphicsmagick (switched from imagemagick due to poor performance) to work, which isn't ideal, but I don't know another better way of doing this efficiently. The bg image is generated on startup and don't use any extra resources when wkline is running.
What this widget does is crop an image of your choice, then apply a configurable amount of brightness/saturation/blur to the image, then sets it as the statusline background image.
Here's a screenshot of a test I just did with blur and lower brightness applied:
To enable this widget, make sure you have graphicsmagick installed and recompile wkline. You should now be able to enable the
magick_background
widget in your config.json:These are the options you're most likely to want to use currently, the rest are defined in the widget header file. The brightness and saturation settings are set as percentages in the range 0..100 (100 is default brightness/saturation).
You may need to tweak the values depending on your background image and preference. I found that a blur radius of 3 or 4, brightness of 70-80 and saturation of 0 looks pretty good with medium to dark images.
Anyways, it would be great if you guys could give me some feedback on this and let me know what you think, or if you have suggestions to other effects that can be added (any feature of graphicsmagick is possible).
The text was updated successfully, but these errors were encountered: