Feh

From ArchWiki

Jump to: navigation, search


i18n
English
简体中文
Italiano
Español

Contents

[edit] Introduction

Feh is a lightweight and powerful image viewer that can also be used to manage the desktop wallpaper for standalone window managers lacking such features.

[edit] Installation

# pacman -S feh

[edit] Usage

feh is highly configurable. For a full list of options, run feh --help.

[edit] Image Browser

To quickly browse images in a specific directory, you can launch feh with the following arguments:

$ feh -g 640x480 -d -S filename /path/to/directory
  • The -g flag forces the images to appear no larger than 640x480
  • The -S filename flag sorts the images by filename

This is just one example and there are many more options available, should you desire more flexibility.

[edit] Desktop Wallpaper

feh can be used to manage the desktop wallpaper for window managers that lack desktop features, such as Openbox and Fluxbox. The following command is an example of how to set the initial background:

$ feh --bg-scale /path/to/image.file

Other scaling options include:

--bg-tile FILE
--bg-center FILE
--bg-seamless FILE

To restore the background on the next session, add the following to your startup file (e.g. ~/.xinitrc, ~/.config/openbox/autostart.sh, etc.):

sh ~/.fehbg &

[edit] Random Background Image

A great script from the ubuntu wiki rotates the background image.

#!/bin/bash
WALLPAPERS="$HOME/path_to_your_wallpapers"
ALIST=( `ls -w1 -B --ignore=*.sh $WALLPAPERS` )
RANGE=${#ALIST[*]}
SHOW=$(( $RANDOM % $RANGE ))
feh --bg-scale $WALLPAPERS/${ALIST[$SHOW]}

I created a file, called wallpaper.sh, and have my .xinitrc run it when I log into X

To periodically change your background image, create a cron job (crontab -e) like:

*/2 * * * * DISPLAY=:0.0 /path/to/wallpaper.sh

where 2 is the number of minutes in between wallpaper changes.

Make sure that the wallpaper.sh file is executable! (chmod +x wallpaper.sh)

Of special note: Remember to NOT put any NSFW pictures in your desktop wallpaper folder . . . unless of course you WANT that.

Personal tools