hsetroot icon indicating copy to clipboard operation
hsetroot copied to clipboard

[Request] Support bitmap image background

Open mtreca opened this issue 6 years ago • 6 comments

It would be nice to have bitmap support in hsetroot similarly to xsetroot (which is not compatible with compton).

mtreca avatar Oct 22 '19 12:10 mtreca

I can certainly look at it @vxid but could you elaborate what you actually want please?

Are you talking about supporting .bmp files?

himdel avatar Oct 22 '19 12:10 himdel

From xsetroot manpage:

-bitmap filename Use the bitmap specified in the file to set the window pattern. You can make your own bitmap files (little pictures) using the bitmap(1) program. The entire background will be made up of repeated "tiles" of the bitmap.

himdel avatar Oct 22 '19 12:10 himdel

But.. I think that's already doable .. hsetroot -tile your_bitmap

himdel avatar Oct 22 '19 12:10 himdel

Wow, that was reactive.

I think xbm files may work, but I am dealing with xbm files, which are not supported with hsetroot. They are text files really. I could convert them to an image format but you lose the ability to change the bitmap colors on-the-fly (doable in xsetroot with the -fg and -bg files).

mtreca avatar Oct 22 '19 12:10 mtreca

:) Aaah, that helps, thanks :)

So, this is essentially a format support issue + the behaviour of fg and bg.

I'll try to look into the code over the weekend, but it sounds reasonable :).

One question, do you think we should simply add -fg, -bg and -bitmap with the semantics as close to xsetroot as possible? Or would it make sense to reuse the current hsetroot options, use -solid for the background color, -tile for the bitmap, and just add an extra argument to specify the foreground color?

himdel avatar Oct 22 '19 12:10 himdel

Awesome. I looked over the xsetroot source, it seems like it would not be that hard to set a bitmap background. The source can be found here.

I don't think the options should necessarily be similar to the ones of xsetroot, even though -fg and -bg make sense in this case. Maybe arguments of the form -bitmap file bg fg could work?

mtreca avatar Oct 22 '19 12:10 mtreca