You are not logged in.

#1 2008-10-21 22:13:35

Frabato
Member
Registered: 2007-10-24
Posts: 267

Openbox grey background

Hi All,

I just started using openbox with pypanel and all is fine. I like not having a background image but the stock grey is too dark for me. I've looked all through the rc.xml file but I can't find any settings to lighten the background. Can someone tell me what I'm missing? I know that I can use feh or others to set a background but the stock background in openbox must be controllable from somewhere.

Thanks,
Arthur

Offline

#2 2008-10-22 00:49:06

ssjlegendx
Member
Registered: 2008-01-01
Posts: 94
Website

Re: Openbox grey background

This is how the default Openbox autostart.sh (/etc/xdg/openbox/autostart.sh) does it:

# Set a background color
BG=""
if which hsetroot >/dev/null; then
    BG=hsetroot
else
    if which esetroot >/dev/null; then
    BG=esetroot
    else
    if which xsetroot >/dev/null; then
        BG=xsetroot
    fi
    fi
fi
test -z $BG || $BG -solid "#303030"

Essentially, determine which executable (hsetroot/esetroot/xsetroot) you have and then add the following to ~/.config/openbox/autostart.sh:

$BG_SET_PROGRAM -solid "$BG_COLOR"

(replacing $BG_SET_PROGRAM with the executable you have and $BG_COLOR with the color you want).


#!/vim/rocks

Offline

#3 2008-10-22 02:24:07

Frabato
Member
Registered: 2007-10-24
Posts: 267

Re: Openbox grey background

Hi,

Thanks for the reply. I haven't touched the autostart.sh file so how would I know which executable I have?

My /etc/xdg/openbox/autostart.sh looks like this:

# This shell script is run before Openbox launches.
# Environment variables set here are passed to the Openbox session.

# Set a background color
BG=""
if which hsetroot >/dev/null; then
    BG=hsetroot
else
    if which esetroot >/dev/null; then
    BG=esetroot
    else
    if which xsetroot >/dev/null; then
        BG=xsetroot
    fi
    fi
fi
test -z $BG || $BG -solid "#303030"

# D-bus
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
       eval `dbus-launch --sh-syntax --exit-with-session`
fi

# Make GTK apps look and behave how they were set up in the gnome config tools
if test -x /usr/libexec/gnome-settings-daemon >/dev/null; then
  /usr/libexec/gnome-settings-daemon &
elif which gnome-settings-daemon >/dev/null; then
  gnome-settings-daemon &
# Make GTK apps look and behave how they were set up in the XFCE config tools
elif which xfce-mcs-manager >/dev/null; then
  xfce-mcs-manager n &
fi

# Preload stuff for KDE apps
if which start_kdeinit >/dev/null; then
  LD_BIND_NOW=true start_kdeinit --new-startup +kcminit_startup &
fi

# Run XDG autostart things.  By default don't run anything desktop-specific
# See xdg-autostart --help more info
DESKTOP_ENV=""
if which /usr/lib/openbox/xdg-autostart >/dev/null; then
  /usr/lib/openbox/xdg-autostart $DESKTOP_ENV
fi

And I don't have an autostart.sh in  ~/.config/openbox/ so I will create one and add the line:
$BG_SET_PROGRAM -solid "$BG_COLOR"
but make it look more like this?
hsetroot -solid "202020"
if indeed hsetroot is my executable.

Do I have the Idea?

Thanks,
Arthur

Offline

#4 2008-10-22 02:49:01

ssjlegendx
Member
Registered: 2008-01-01
Posts: 94
Website

Re: Openbox grey background

Frabato wrote:

And I don't have an autostart.sh in  ~/.config/openbox/ so I will create one and add the line:
$BG_SET_PROGRAM -solid "$BG_COLOR"
but make it look more like this?
hsetroot -solid "202020"
if indeed hsetroot is my executable.

Do I have the Idea?

Thanks,
Arthur

Yeah, it looks like you've got the idea. smile

If you're not sure which executable you have, try running the following (a modified version of the code from the stock autostart.sh):

BG="None found!" # Default message.

# Test for hsetroot.
if which hsetroot >/dev/null; then
    BG=hsetroot

# Test for esetroot.
elif which esetroot >/dev/null; then
    BG=esetroot

# Test for xsetroot.
elif which xsetroot >/dev/null; then
    BG=xsetroot
fi

# Finally, echo the correct app name (or the default message if none was found).
echo $BG

I have xsetroot on my own system, and so I would add the following line to ~/.config/openbox/autostart.sh:

xsetroot -solid "#202020"

(Note the leading # in the color code. I'm not sure if it is necessary.)

Personally, I use Nitrogen to set my (image) wallpaper, so I am not 100% certain that the above method will do what you want.


#!/vim/rocks

Offline

#5 2008-10-22 03:11:18

Frabato
Member
Registered: 2007-10-24
Posts: 267

Re: Openbox grey background

Thanks so much for your help!

xsetroot -solid "#202020"
was it.

The lower numbers actually make it darker but I found that,

xsetroot -solid "#606060"

was just right.

Thanks Again,
Arthur

Offline

#6 2008-12-15 20:49:38

jai134
Member
Registered: 2008-11-26
Posts: 234

Re: Openbox grey background

Hello. I'm using openbox and have used what you have discussed here and it does change the color of my background. My problem is that I want to use xcompmgr because of my cairo-dock that needs it for transparency. When I start xcompmgr the bg turns back to grey from my choosen color. I have searched for a solution but I have only found a thread that says that hsetroot does the job. When seaching for hsetroot with pacman -Ss I don't get anything back so my question is, what can I do. It cannot be done with xsetroot and hsetroot is not available.

Offline

#7 2008-12-15 21:00:26

SaThaRiel
Member
Registered: 2008-09-24
Posts: 19

Re: Openbox grey background

hsetroot can be found in the AUR: http://aur.archlinux.org/packages.php?O … _Search=Go

Offline

#8 2008-12-16 17:05:09

jai134
Member
Registered: 2008-11-26
Posts: 234

Re: Openbox grey background

Thankyou.

Offline

Board footer

Powered by FluxBB