SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2014-01-22 23:40:08

josephg
#! Member
From: Surrey
Registered: 2011-10-24
Posts: 79
Website

wallpaper reset on openbox startup [SOLVED]

i keep only openbox relevant stuff in the openbox/autostart, and so have moved what i want to .xsession. this way, i can seemlessly change wm.

my ~/.xsession contains:

hsetroot -solid "#000000" -fill ~/.wallpaper &
...
exec openbox-session

i have commented out wallpaper settings in ~/.config/openbox/autostart, like so:

## Set root window colour
#hsetroot -solid "#2E3436" &

## Group start:
## 1. nitrogen - restores wallpaper
## 2. compositor - start
## 3. sleep - give compositor time to start
## 4. tint2 panel
#nitrogen --restore && \
(\
cb-compositor --start && \
sleep 2s && \
tint2 \
) &

my problem:
hsetroot in .xsession correctly sets my wallpaper. at some point during openbox startup, the wallpaper settings are reset, and i end up with a blank grey background at the end of openbox startup.

my question:
what/where is this happening?

Last edited by josephg (2014-01-23 13:18:27)


leaner code is cleaner code is more efficient code

Offline

Be excellent to each other!

#2 2014-01-23 00:20:07

iann
#! Die Hard
Registered: 2010-09-10
Posts: 708

Re: wallpaper reset on openbox startup [SOLVED]

Is that your entire autostart?  Comment out the compositor, just for fun, then show us what else you have in there.

Offline

#3 2014-01-23 02:23:43

josephg
#! Member
From: Surrey
Registered: 2011-10-24
Posts: 79
Website

Re: wallpaper reset on openbox startup [SOLVED]

this is my entire autostart

## Openbox autostart.sh
## ====================
## When you login to your CrunchBang Openbox session, this autostart script 
## will be executed to set-up your environment and launch any applications
## you want to run at startup.
##
## Note*: some programs, such as 'nm-applet' are run via XDG autostart.
## Run '/usr/lib/openbox/openbox-xdg-autostart --list' to list any
## XDG autostarted programs.
##
## More information about this can be found at:
## http://openbox.org/wiki/Help:Autostart
##
## If you do something cool with your autostart script and you think others
## could benefit from your hack, please consider sharing it at:
## http://crunchbang.org/forums/
##
## Have fun & happy CrunchBangin'! :)

## GNOME PolicyKit and Keyring
eval $(gnome-keyring-daemon -s --components=pkcs11,secrets,ssh,gpg) &

## Set root window colour
#hsetroot -solid "#2E3436" &

## Group start:
## 1. nitrogen - restores wallpaper
## 2. compositor - start
## 3. sleep - give compositor time to start
## 4. tint2 panel
#nitrogen --restore && \
(\
cb-compositor --start && \
sleep 2s && \
tint2 \
) &

## Volume control for systray
#(sleep 2s && pnmixer) &

## Volume keys daemon
#xfce4-volumed &

## Enable power management
#xfce4-power-manager &

## Start Thunar Daemon
#thunar --daemon &

## Detect and configure touchpad. See 'man synclient' for more info.
#if egrep -iq 'touchpad' /proc/bus/input/devices; then
#    synclient VertEdgeScroll=1 &
#    synclient TapButton1=1 &
#fi

## Start xscreensaver
#xscreensaver -no-splash &

## Start Clipboard manager
#(sleep 3s && clipit) &

## Set keyboard settings - 250 ms delay and 25 cps (characters per second) repeat rate.
## Adjust the values according to your preferances.
#xset r rate 250 25 &

## Turn on/off system beep
#xset b off &

## The following command runs hacks and fixes for #! LiveCD sessions.
## Safe to delete after installation.
#cb-cowpowers &

## cb-welcome - post-installation script, will not run in a live session and
## only runs once. Safe to remove.
#(sleep 10s && cb-welcome --firstrun) &

## cb-fortune - have Waldorf say a little adage
#(sleep 120s && cb-fortune) &

## Run the conky
#conky -q &

just for fun iann, did you want me to comment out the compositor also, like this? smile

## Group start:
## 1. nitrogen - restores wallpaper
## 2. compositor - start
## 3. sleep - give compositor time to start
## 4. tint2 panel
#(\
#nitrogen --restore && \
#cb-compositor --start && \
#sleep 2s && \
#tint2 \
#) &
tint2 &

i don't find any difference whether cb-compositor is on/off. openbox startup still resets my wallpaper set in .xsession.

Last edited by josephg (2014-05-29 08:31:48)


leaner code is cleaner code is more efficient code

Offline

#4 2014-01-23 06:21:43

porkpiehat
#! Die Hard
Registered: 2012-10-02
Posts: 720

Re: wallpaper reset on openbox startup [SOLVED]

Look at /usr/bin/openbox-session (it's just a script). On my 32-bit install, it calls /usr/lib/openbox/openbox-autostart, and this file contains a call to set the background color. Comment out that section (or just the last line that starts "test -z $BG").

Last edited by porkpiehat (2014-01-23 06:22:41)


Sarcasm is often an appropriate response to stupidity.

Offline

#5 2014-01-23 13:00:37

josephg
#! Member
From: Surrey
Registered: 2011-10-24
Posts: 79
Website

Re: wallpaper reset on openbox startup [SOLVED]

thanks for the hint to look at openbox configs. i suspected something running from somewhere in my user configs. it is rather strange that openbox would contain hard-coded configs overwriting user settings. i would consider this a bug. would this be openbox upstream or crunchbang specific?

/usr/bin/openbox-session calls
1. /etc/xdg/openbox/environment
2. $HOME/.config/openbox/environment
3. /usr/lib/openbox/openbox-autostart

/usr/lib/openbox/openbox-autostart sets background, resetting any user settings for background/wallpaper. then it calls
1. /etc/xdg/openbox/autostart
2. $HOME/.config/openbox/autostart
3. /usr/lib/openbox/openbox-xdg-autostart

which means that any ~/.xsession settings, conflicting in any of the above files, would be overwritten. openbox expects all user x configs to be within openbox only, which i think is plain wrong.

i have commented out the background color section in /usr/lib/openbox/openbox-autostart, which resolves my op. thanks porkpiehat smile

/etc/X11/openbox/ is yet another directory with openbox configs

i am loathe to edit system configs, as they might conflict with upstream upgrades later when i might not remember what/why i changed something. hence why i keep them pristine, preferring to keep my settings in local user configs. this also help me seemlessly switch wm and/or carry them over to other machines.

would openbox expect users to call ~/.xsession at the end of ~/.config/openbox/autostart? that would be crazy logic  yikes

Last edited by josephg (2014-01-23 13:13:46)


leaner code is cleaner code is more efficient code

Offline

#6 2014-01-23 14:03:05

iann
#! Die Hard
Registered: 2010-09-10
Posts: 708

Re: wallpaper reset on openbox startup [SOLVED]

I think the logic is that the desktop background shouldn't be set in X, but in the desktop manager or window manager.  Or at least anything that is configured in X should be overridable by Openbox.  Openbox doesn't expect all X configs to be set within Openbox configs, although certainly you could do this.  It expects desktop configs to be set within Openbox.

I think the grey background is Crunchbang-specific, but the practice of setting the background at this point is normal, followed later by a wallpaper if desired.  I set my wallpaper in autostart under my home directory.

Offline

#7 2014-01-24 00:33:14

porkpiehat
#! Die Hard
Registered: 2012-10-02
Posts: 720

Re: wallpaper reset on openbox startup [SOLVED]

iann wrote:

I think the grey background is Crunchbang-specific

Actually, no, even vanilla Openbox on Arch (which makes no changes to the upstream package) has this grey background code. It just happens to look like something Crunchbang would use.

But you are correct -- Openbox does this just so there will be some background color set, and then expects the user to make desired changes in ~/.config/openbox/autostart.

josephg, if you simply start "openbox" instead of "openbox-session" this background-setting code will not run; but neither will your personal .config/openbox/autostart so you will have to set up everything in your .xsession file.


Sarcasm is often an appropriate response to stupidity.

Offline

#8 2014-01-24 16:20:42

josephg
#! Member
From: Surrey
Registered: 2011-10-24
Posts: 79
Website

Re: wallpaper reset on openbox startup [SOLVED]

porkpiehat wrote:
iann wrote:

I think the grey background is Crunchbang-specific

Actually, no, even vanilla Openbox on Arch (which makes no changes to the upstream package) has this grey background code. It just happens to look like something Crunchbang would use.

thanks for the clarification. i suspected something leftover from legacy #! configs.

i'll report this upstream. i don't think openbox or any wm should reset wallpaper/background. a user should not need to specify wallpaper/background settings for every wm and then again go through the same procedure for each change. best left to user configs and not at the system level.

porkpiehat wrote:

josephg, if you simply start "openbox" instead of "openbox-session" this background-setting code will not run; but neither will your personal .config/openbox/autostart so you will have to set up everything in your .xsession file.

thanks porkpiehat, didn't know. in this particular case, this tip is very helpful. but practically speaking, it is useful to have wm specific configs too. i might need some openbox specific configs or autostart some programs (like tint2) only for openbox, and not for every other wm that i use.

btw, i moved everything from ~/.config/openbox/autostart to ~/.xsession, and find x startup much faster. can anyone else confirm?

Last edited by josephg (2014-01-24 16:22:07)


leaner code is cleaner code is more efficient code

Offline

#9 2014-01-24 21:29:40

porkpiehat
#! Die Hard
Registered: 2012-10-02
Posts: 720

Re: wallpaper reset on openbox startup [SOLVED]

josephg wrote:

practically speaking, it is useful to have wm specific configs too. i might need some openbox specific configs or autostart some programs (like tint2) only for openbox, and not for every other wm that i use.

Well, openbox/autostart is just a script, so you could run it yourself from .xsession before you start openbox, and leave your openbox-specific configs in autostart, while keeping your general configs in .xsession.

This is a variation on another common way to handle this: a "wrapper script" -- the script contains wm-specifc startup code (like your tint2 example), and ends with "exec <windowmanager>" -- then instead of calling "exec <windowmanager>" from .xsession (or .xinitrc, in my case) you just call the wrapper script, which runs the wm-specific configs first, then starts the wm. 

Like everything in Linux, there are many ways to skin this particular cat.


Sarcasm is often an appropriate response to stupidity.

Offline

#10 2014-01-25 12:05:55

josephg
#! Member
From: Surrey
Registered: 2011-10-24
Posts: 79
Website

Re: wallpaper reset on openbox startup [SOLVED]

i really like this "wrapper script" way of skinning this cat - much cleaner. thank you porkpiehat! i've just given up on openbox-session for openbox now. can't understand this logic of trawling through half-dozen+ openbox init haystack looking for my needle. and i thought openbox was simple?

it is good for the user to have additional ways to autostart things within the wm. but i don't agree that every wm insist their own inits should be the only ones, overwriting the simpler standard way. actually, i don't know of any wm that did so, until now with openbox. before you ask, i don't use gnome/kde/similar bloatware rubbish. i might as well use *gasp* windoze.

in fact, i'm taking this a bit further with "nested" wrapper scripts, where many of the wm share some startup code. for eg, tint2 might be needed for some wm, but not all wm. so i have a group of wm, where i start some programs not needed by any other wm. some wm, like ratpoison and dwm, would be in another group. they would all share the initial code. then depending on what group they are in, the inits would diverge, finally ending with "exec wm".

thinking further, i could have all user x inits in one script itself, with a few "case"s. so much cleaner now! gonna go that way now.. thanks again!

Last edited by josephg (2014-01-25 12:06:46)


leaner code is cleaner code is more efficient code

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo