Set background image in xmonad

40

9

I have just switched from Fluxbox to giving xmonad a go, and I am definitely liking it. However, the one thing I haven't managed to do is to change my desktop background.

I am using Ubuntu 8 (uh, can't remember the value after the point), and I installed xmonad through the package manager, and then ran xmonad from the list of environments available on the login screen.

I have tried setting it using gconftool as suggested on the Haskell wiki, but it doesn't seem to have any effect.

Yacoby

Posted 2009-11-05T00:23:18.387

Reputation: 1 123

Answers

31

Regarding prior comment from grawity, the correct syntax is actually

xloadimage -onroot -fullscreen <path.to.image>

The advantages over xloadiamge on xpmroot are:

  • allows png images
  • on Ubuntu, has its own package, rather than bein contained in the larger fvwm package

(sorry if this would be better as a comment on previous answer: I can't add comments)

Dalker

Posted 2009-11-05T00:23:18.387

Reputation: 485

4I'm new to Haskell and Xmonad, and not exactly sure how to use that command in my Xmonad config. How am I supposed to use xloadimage? – E-rich – 2012-05-30T21:12:57.703

Ubuntu 12.04, didn't fill if the image aspect ratio wasn't the same as my monitor's. – cmc – 2013-02-05T13:22:02.810

1@E-rich, put it in your .xinitrc file, usually before a line alike exec /bin/xmonad. – JMCF125 – 2014-01-06T19:27:33.897

20

I had some trouble with xloadimage (didn't work at all) and xpmroot (only accepts xpms and gimp wrote a strange one that it barfed on), but feh --bg-fill worked wonderfully (thanks to some guys on the arch forum).

raylu

Posted 2009-11-05T00:23:18.387

Reputation: 485

4

Does this command work: xpmroot ~/background.xpm &? Where background.xpm is the filename of the image you want to be your background.

Alvin Row

Posted 2009-11-05T00:23:18.387

Reputation: 595

4Btw, I am not sure if that stays as your background after logging out. You might need to add that command to your ~/.xsessions or ~/.xinitrc – Alvin Row – 2009-11-05T00:52:51.240

For image formats other than XPM, xloadimage -root $path – user1686 – 2009-11-05T15:47:44.403

0

I use feh for this:

feh --bg-fill ~/pictures/background

This lives in my ~/.xprofile and also produces a script ~/.fehbg which may be run to set the same background and configuration later. There are alternative arguments that may be used aside from --bg-fill, man feh elaborates.

Feh is widely available and may be installed from the default Ubuntu and Arch linux package repositories, and likely others.

bschlueter

Posted 2009-11-05T00:23:18.387

Reputation: 168