xlucn / fontpreview-ueberzug

preview fonts in fzf
MIT License
163 stars 11 forks source link

Add xresources color support #2

Closed nyxkrage closed 1 year ago

nyxkrage commented 4 years ago

This will use the current terminals foreground and background colors as set in the currently used xresources.

New order of colors is then: ARG -> ENV -> XRES -> Fallback(black and white)

This does not add any additional dependencies. NOTE: This uses currently active window for getting the colors! As such this could fail. Example if used with sleep

sleep 5; fontpreview-ueberzug
xlucn commented 4 years ago

Well, for me I use *.{fore,back}ground in my Xresources file, in which case the method in the PR does not work. And there are some terminal emulators that does not use Xresources but their own config files. So I am afraid the PR could only cover a small part of all cases.

The users might not mind to add one or two lines of env var definitions in their shell rc file if they want to achieve a more blend-in look.