Whenever I open an image in feh, the background is set to the standard, dark gray and gray checkboard pattern like this:

enter image description here

As you can see, it's the checkboard background. How do I permanently change this to black?

I've search Google and other places, but I can't seem to find a straight answer. I'm guessing feh's config file is involved, but I can't find any examples of how to do it in the config file. I know you can do it in the command line with --bg-color black (or something) but I'd like to just have it set to black by default.

6 Answers 6


It seems that you cannot put your desired default options in a config file.

If you know about $PATH you can resort to a hack.

Create this script:

feh --bg-color black "$@"

Call it feh and place it in your $PATH before /usr/bin/ (assuming that feh itself is in /usr/bin/).

Some distros have ~/bin/ in $PATH by default. So you would put that script into ~/bin/ (and make it executable). Otherwise just create this folder yourself and prepend it to your $PATH.

Also, if you want to set multiple default options, you can group them into themes. (Theme is the feh developer's name for a named group of options.) Create ~/.config/feh/themes and add this line to that file:

default --bg-color black

feh -Tdefault will then start feh with your desired default options. This is handy if you want to set multiple options at once. Unfortunately there is no way to set a default theme either. So, in your case it doesn't help. But you can fallback to the same hack as above:

feh -Tdefault "$@"


If you are just going to call feh manually from the commandline, you can instead set an alias in your shell. In bash you would add this line to your ~/.bashrc and restart the interpreter (e.g. re-open the terminal):

alias feh="feh --bg-color black"

In fish shell you would run:

abbr -a feh feh --bg-color black
  • 7
    In feh-3.1.1-1, I get unrecognized option '--bg-color'.
    – Kevin
    Commented Jan 23, 2019 at 0:59
  • 3
    This answer need to be updated, the flag doesn't exist anymore, it is image-bg now. Moreover, we can customize feh by creating a $XDG_CONFIG_HOME/feh/themes instead of creating alias. Using themes file works even when using absolute path to feh. Specifically, the content of themes file for this to work is feh --image-bg black
    – DDMC
    Commented Dec 22, 2020 at 3:49
  • It's been a while since I checked this thread but I'm impressed with the answers. I chose this one, even if it's out date, because the comments have the answer as well. Thanks.
    – M. Knepper
    Commented Jun 1, 2021 at 4:25

I would like to add this as a comment to the only answer but I do not have enough reputation.

A look into the man page of feh reveals that the alias should look like this:

alias feh="feh --image-bg black -Z -."

I also added -Z and -. for convenience, -Z zooms pictures to screen size, -. scales down images to fit window geometry


The default theme is named "feh", so you can add

feh --image-bg black

to ~/.config/feh/themes and it will be applied by default (unless you call feh with some other theme -Tother).

  • This worked for me today and is better than the accepted answer, though it likely was not available at the time the question was asked.
    – Iiridayn
    Commented Sep 4, 2022 at 7:29

Add feh='feh -B black' to your ~/.bash_aliases file if running from shell.

Set Exec=feh -B black %F on feh's .desktop file (usually located at /usr/share/applications) if running feh's default bin.

From feh's man page:

-B, --image-bg style
Use style as background for transparent image parts and the like. Accepted values: default, checks, or an XColor (e.g. "black" or "#428bdd"). Note that some shells treat the hash symbol as a special character, so you may need to quote or escape it for the XColor code to work. In windowed mode, the default is checks (a checkered background so transparent image parts are easy to see). In fullscreen and background setting mode, checks is not accepted and the default is black.


Another option (or in addition to the above) is to create/edit a feh.desktop file for "feh" application in ~/.local/share/applications. That way you'll have your default options for feh as used from your desktop "open with" menu. Normally, one would be created by the installation, but here you can edit your own default launch options out of the rich variety offered by feh program.

Mine looks like this:

[Desktop Entry]
GenericName=Image viewer
GenericName[en_US]=Image viewer
Comment=Image viewer and cataloguer
Exec=feh --cache-size 200 -g 1400x800 --keep-zoom-vp --scale-down --start-at %F

Yes, you can set default options by adding the command-line you want as default into .config/feh/themes.

From the man page:

.config/feh/themes allows the naming of option groups, called themes. It takes entries of the form theme options ..., where theme is the name of the entry and options are the options which will be applied when the theme is used.

The theme can be set via --theme or the program name (e.g. with symlinks), > so by default feh will look for a "feh" theme.

So the easiest way to change the default behavior is to enter the following line into config/feh/themes.

feh --image-bg black

And then use feh as normal

$ feh myImage.png
# the background is now black

You could also create a symlink

$ ln -s /usr/bin/feh /usr/local/bin/foo

And add another line to .config/feh/themes. You can set other options too, so we will add the convenient auto-zoom to this one.

feh --image-bg black
foo --image-bg pink --auto-zoom

Now you can view pictures like this if you're feeling groovy:

$ foo myImage.png
# The background is pink and the image zooms to fit

Tested with feh 3.10, older versions my differ.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .