feh icon indicating copy to clipboard operation
feh copied to clipboard

Preserve Background and use Geometry Size from Options (bg-center)

Open avlec opened this issue 4 years ago • 3 comments
trafficstars

Implemented preservation of existing backgrounds. Can be used to layer multiple --bg-center calls ontop of one another. (note. have a patch in development for other background calls)

Feh now uses XGeometry width and height to resize images for --bg-center. If width is zero and height is specified, width has its size determined from the aspect ratio of the image, and vice versa. However if width and height are both zero they are ignored.

2021-02-22-123615_2560x2160_scrot

This background is generated with the following.

~/feh/src/feh --bg-center ~/.xmonad/backgrounds/foundation_and_earth.jpg -g +25+25
~/feh/src/feh --bg-center ~/.xmonad/backgrounds/giskard.jpg --bg-preserve
~/feh/src/feh --bg-center ~/.xmonad/backgrounds/trantorian_dream.jpg -g 500x760-25-25 --bg-preserve

closes #590 closes #592

avlec avatar Feb 22 '21 20:02 avlec

Thought just occured it might be nice if --bg-preserve is speicified to append the command onto the end of an existing .fehbg if one exists.

avlec avatar Feb 22 '21 20:02 avlec

Hi, thanks for the PR!

While I'd prefer people to use ImageMagick for that and just provide a complete background to feh, I see how this might be useful when doing only small alterations and/or if the original background file is not readily available at the moment. I suppose trying to keep the (already very large) amount of feh options constant and discard this feature would not be in the best interest of most users.

So I'm not opposed per se, but I will let this PR open for a while until I have determined what kind of new feature policy I'd like to use.

derf avatar Feb 28 '21 08:02 derf

I am open to any feedback and discussion around the PR. I am also working on a refactor of the background setting code because I have been spending a lot of time in there recently. Which if the background preservation is decided isn't a feature suitable for feh (which I agree it may not be) however, the XGeometery change and, also closing #575 as well as some other tweaks could instead be organized in a different PR. I am currently working on that here https://github.com/avlec/feh/blob/wallpaper_refactor/src/wallpaper.c

avlec avatar Feb 28 '21 08:02 avlec