[openbox] Background

Tim Riley tr at slackzone.org
Fri Nov 21 21:02:05 EST 2003


El sáb, 22-11-2003 a las 11:48, Dhakela Z Nekudichny escribió:
> Hey,
> I saw an old mail about this problem with setting the background in
> openbox3 but the answer wasn't really an answer to the question. Isn't
> it kinda stupid to not even use the old rootCommand:
> function? How should people that only are using openbox be able to use a
> background without setting it manually?
> If anyone knows a way I'll be glad to be informed. 

And I will be glad to inform you.

One way to not have to do it manually is to put a command to set your
background in your .xinitrc.

"A-ha!" you would, however, ejaculate, "This does not reflect any
changes to the background I make _during_ my X session!"

"Fear not!" I boom.  "For I am with you."

I have already put some thought into this in order to respond to
previous queries about background changing on this list.

So, please allow me to present a solution.

Exhibit 1: bgmenu.rb, a nifty little background selector using openbox's
pipe-menu feature.  Supports multiple background dirs, different
background modes etc.  http://tr.openmonkey.com/openbox.php

The key thing about bgmenu is that it uses bgsetbg to set the background
images.  bsetbg is a shell script that wraps whichever image display
program you choose.

I propose that you could modify the bsetbg source for it to print the
command that it uses to set the background into a file (eg.
~/.bsetbg-last-background or something like that).  This way, whenever
the bsetbg command is run, it updates this file.  Then, you could
`source ~/.bsetbg-last-background` in your .xinitrc so that it will
automatically display the most recently used background on startup.

Of course, if you don't want to use a menu-based interface for selecting
background, ditch bgmenu and just use bsetbg manually.

Yes, I said it, the m-word.  Manually.  Can we talk sister to sister,
Dhakela?  I have to say something to you and I must say it straight.  If
you choose to run a window manager like openbox on its own, without any
comfy DE companions, you have chosen a life of hardship.  Nothing will
be done for you, everything will be manual.  Getting persistent
backgrounds is not unachievable, but you will have to do a bit of work
to tailor things to your liking.  But thankfully, Dhakela, I am most
sure that you put the woMAN in MANual (or MAN, whichever the case may
be).

Let me know how you go.

- Tim




More information about the openbox mailing list