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

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

avlec
Copy link
Contributor

@avlec avlec commented Feb 22, 2021

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
Copy link
Contributor Author

avlec commented Feb 22, 2021

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.

@derf
Copy link
Owner

derf commented Feb 28, 2021

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 derf added the feature label Feb 28, 2021
@avlec
Copy link
Contributor Author

avlec commented Feb 28, 2021

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

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

Successfully merging this pull request may close these issues.

--bg-center ignores XGeometry Feature Idea: Background Persistence
2 participants