Browse and set wallpaper in Openbox with feh

Pretty much since I started using Openbox, I’ve been wanting a simple way to change the wallpaper from the right-click menu. I eventually found a way, using a script that reads my wallpaper directory and lists files it finds there. Clicking on the menu entry triggers feh, which sets the image to the root window. It’s not ideal, since really I don’t remember what some of those wallpapers look like, and the names aren’t obvious choices. But it’s a simple solution, even if it wasn’t so simple to figure out.

At the same time, I’ve been grinding my teeth over the fact that Ubuntu’s version of Mirage, a nifty GTK image viewer with only one dependency, is saddled with an inordinate amount of optional Gnome baggage. I could use a decent image viewer to screen photos … and sift through my wallpaper folder, to be honest. With Mirage so burdened, I wasn’t keen on auditioning more image viewers.

And then today, about an hour ago, the two puzzle pieces suddenly clicked. I was running Midnight Commander in a terminal emulator and double-clicked on a photo. Boing! Up pops feh, showing me the full image, with a bunch of right-click menu options — including setting the image as the background!

Doh! Of course! feh is an image viewer! Here’s the lightweight customizable command-line-triggerable imageviewer that I’ve been looking for … for months! I only ever install it to set the wallpaper, and it’s something I’ve been using since I started out with Openbox. But that’s just a bonus, an added little something on top of the image slideshow, indexing and montage/collage effects it offers.

I feel like someone punched me in the stomach. All this time and it was right under my nose. :|

So anyway, add this line to an Openbox menu for a pop-up feh window that will let you peruse through a folder of images — of almost any type — and set one to the background through a right-click menu.

feh -g 640x480 -d -S filename /home/kmandla/wallpaper/

The -g option keeps the previews within 640×480, while the -d option shows the filename over the photo, in case you’re keeping track. -S sorts them by filename, and there are other options than that. Change you folder location to match your machine, and while you’re at it you might double-check the other feh options that are available to you. There are a LOT.

Right now I’m going to go kick myself repeatedly, for waiting almost a year to spend the 10 minutes it took to figure this out. :evil:

About these ads

9 Responses to “Browse and set wallpaper in Openbox with feh”

  1. 1 taghof 2007/05/31 at 11:10 AM

    Thanks…just what i needed. Did some further digging and found that with feh’s action and bg-center commands you don’t even need to lift your fingers from the keyboard.

  2. 2 devnet 2007/06/18 at 6:43 AM

    Something I’ve done with openbox on Foresight Linux is to enable gnome-settings-daemon in my

    from there, I can call “nautilis –no-deskop” and browse my file structure in thumbnails so looking at wallpapers becomes a snap :)

    Beware that not adding –no-desktop to the nautilis command will snafu your openbox instance so make sure you remember to add that to your obmenu entry.

  3. 3 mawize 2007/12/16 at 9:26 PM

    Hey just found something interesting

    i think this is much more comfortable

    get deb package at


  4. 4 John 2007/12/31 at 1:30 PM

    Thanks just what I needed!

  5. 5 Jamie 2008/09/30 at 1:15 AM

    Feh is an amazing program :)
    When I was using Gnome, I prefered using Feh to view an image instead of the default programs like Eye Of Gnome (EOG)

  6. 6 Lane Lester 2008/10/15 at 10:14 AM

    That’s a neat trick, but on my Debian Lenny Openbox system, the wallpaper change doesn’t stick after a fresh logon.

  7. 7 K.Mandla 2008/10/15 at 11:16 PM

    Have you adjusted your .xinitrc file to cue the wallpaper with something like

    eval `cat .fehbg` &


  1. 1 More fun GTK1.2 stuff « Motho ke motho ka botho Trackback on 2008/09/02 at 9:40 AM
  2. 2 Making feh work for you « Motho ke motho ka botho Trackback on 2008/09/13 at 10:29 PM

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Visit the Wiki!

Some recent desktops

May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF

May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games

Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 405 other followers


This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,963,645 hits



Get every new post delivered to your Inbox.

Join 405 other followers

%d bloggers like this: