Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Fluxbox can't set background!
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
humbletech99
Veteran
Veteran


Joined: 26 May 2005
Posts: 1229
Location: London

PostPosted: Sat Jun 03, 2006 5:29 pm    Post subject: Fluxbox can't set background! Reply with quote

I've had this problem for quite and while and it's driving me nuts...

When I change to a style in Fluxbox the style doesn't set the background, even though the style is correct, this happens for every single style, including the default ones. The style will set the window decorations and the taskbar but not the background.

This problem is a configuration issue because when I start fluxbox in a fresh user account and select the same styles, they all set the background image correctly every time - there is noting wrong with the styles themselves. When logged in as my regular user I can set the backgound myself using fbsetbg. Fbsetbg -i tells me I am using Esetroot:
Code:
$ fbsetbg -i
Esetroot is a nice wallpapersetter. You won't have any problems

rubbing salt in the wound? The thing is, fbsetbg does work, at least if I type it into an xterm myself, and the styles use the rootcommand fbsetbg /path/to/jpeg to set the wallpaper so I don't understand why this doesn't work.

All suggestions welcome!
_________________
The Human Equation:

value(geeks) > value(mundanes)
Back to top
View user's profile Send private message
savage
Apprentice
Apprentice


Joined: 01 Jan 2003
Posts: 161

PostPosted: Sat Jun 03, 2006 6:01 pm    Post subject: Re: Fluxbox can't set background! Reply with quote

humbletech99 wrote:
I've had this problem for quite and while and it's driving me nuts...

When I change to a style in Fluxbox the style doesn't set the background, even though the style is correct, this happens for every single style, including the default ones. The style will set the window decorations and the taskbar but not the background.

This problem is a configuration issue because when I start fluxbox in a fresh user account and select the same styles, they all set the background image correctly every time - there is noting wrong with the styles themselves. When logged in as my regular user I can set the backgound myself using fbsetbg. Fbsetbg -i tells me I am using Esetroot:
Code:
$ fbsetbg -i
Esetroot is a nice wallpapersetter. You won't have any problems

rubbing salt in the wound? The thing is, fbsetbg does work, at least if I type it into an xterm myself, and the styles use the rootcommand fbsetbg /path/to/jpeg to set the wallpaper so I don't understand why this doesn't work.

All suggestions welcome!


fbsetbg is just a wrapper for whatever program it finds and thinks is best for drawing the background. If you want it to paint the background for you, look in your .fluxbox directory - look at the startup file and the lastwallpaper file. In the startup file, try commenting out the "/usr/bin/fbsetroot -solid black" entry, and see if that helps.
Back to top
View user's profile Send private message
humbletech99
Veteran
Veteran


Joined: 26 May 2005
Posts: 1229
Location: London

PostPosted: Sat Jun 03, 2006 6:44 pm    Post subject: Reply with quote

you meant the init file?

I removed the line
Code:
session.screen0.rootCommand: fbsetbg -l

and the styles are now allowed to set the wallpaper again.

The problem now is that I have the choice between styles being able to set the backgound and being able to set it myself and have it be remembered....

any ideas?
_________________
The Human Equation:

value(geeks) > value(mundanes)
Back to top
View user's profile Send private message
KillMinusNine
n00b
n00b


Joined: 27 Dec 2005
Posts: 44
Location: Washington

PostPosted: Sat Jun 03, 2006 10:56 pm    Post subject: Reply with quote

humbletech99 wrote:
you meant the init file?


The line he quoted is in ~/.fluxbox/startup.

For what it's worth (not much) I use

Code:
fbsetbg -l


in my ~/.fluxbox/startup, which sets my background to whatever I was using last, and doesn't interfere with style BG settings. YMMV, I don't really know why things are[n't] working the way they are.

You said things are working the way you want for new users, though, have you tried re-setting your main account's fluxbox stuff? That is,

Code:
cd ~
mv .fluxbox .fluxbox.bak


and then restarting fluxbox? Then you can move any relevant files from .fluxbox.bak/ to .fluxbox one at a time as you want things, reload config, and see if it still works right. Should help you track down the problem.
Back to top
View user's profile Send private message
humbletech99
Veteran
Veteran


Joined: 26 May 2005
Posts: 1229
Location: London

PostPosted: Sat Jun 03, 2006 11:10 pm    Post subject: Reply with quote

I remember when I tried doing this in the ~/.fluxbox/startup file, the fbsetbg -l never applied the background because either it was executed before fluxbox started or it was executed after fluxbox finished.
_________________
The Human Equation:

value(geeks) > value(mundanes)
Back to top
View user's profile Send private message
KillMinusNine
n00b
n00b


Joined: 27 Dec 2005
Posts: 44
Location: Washington

PostPosted: Sun Jun 04, 2006 4:00 am    Post subject: Reply with quote

That seems strange. Have you tried it again recently? You should just put the fbsetbg -l line just before it executes Fluxbox.

fbsetbg functions independent of fluxbox itself, it just pastes a wallpaper onto the desktop root. Starting fluxbox after fbsetbg shouldn't do anything to the fbset wallpaper unless you have a style set up that changes the bg itself - and then the style should be setting the wallpaper, which isn't a problem, is it?
Code:
fbsetbg -l
exec /usr/bin/fluxbox


fbsetbg -l just posts whatever the last wallpaper was back up (stored in ~/.fluxbox/lastwallpaper), the first time you'll need to be more specific, like fbsetbg -a path/somepicture
Also, do what savage said in his first post (there's no need for that line to execute anyway).
Back to top
View user's profile Send private message
humbletech99
Veteran
Veteran


Joined: 26 May 2005
Posts: 1229
Location: London

PostPosted: Sun Jun 04, 2006 10:10 am    Post subject: Reply with quote

I have had that line commented out for a very long time.

Trying to add the fbsetbg -l to the startup file again, I've put it immediately before the exec fluxbox line. I then set the wallpaper using fbsetbg to something other than the background for my current style and the logged off and back on, only to be greeted by the error:
Code:
fbsetbg: No previous wallpaper recorded for display :0

However, if I open up an xterm and type fbsetbg -l then it does correctly set the background to what it was previously, having checked the lastwallpaper file it does have the correct references at the time of the error message, so the only explanation is that this command is somehow dependent on fluxbox being started.
_________________
The Human Equation:

value(geeks) > value(mundanes)
Back to top
View user's profile Send private message
savage
Apprentice
Apprentice


Joined: 01 Jan 2003
Posts: 161

PostPosted: Sun Jun 04, 2006 1:10 pm    Post subject: Reply with quote

If you check out their changelog, version 0.9.15.1 changed some background stuff. It also says that they removed background settings from themes if they aren't doing it the "new way"
Check it out:http://fluxbox.org/version-0.9.php I tried removing the "rootCommand" line from my ~/.fluxbox/init (just removed the line completely), as well as commenting out the "/usr/bin/fbsetroot -solid black" command in the startup file. Still, my backgrounds are not set by my current style.
Back to top
View user's profile Send private message
humbletech99
Veteran
Veteran


Joined: 26 May 2005
Posts: 1229
Location: London

PostPosted: Sun Jun 04, 2006 5:54 pm    Post subject: Reply with quote

I'm only using Fluxbox 0.9.14-gentoo-r1 so this shouldn't affect me, besides, I don't even know if this is a big deal, I assume that all styles which use fbsetbg via rootCommand will still work, which is most styles.
_________________
The Human Equation:

value(geeks) > value(mundanes)
Back to top
View user's profile Send private message
JC Denton
Apprentice
Apprentice


Joined: 16 Apr 2003
Posts: 151
Location: USA

PostPosted: Sun Jun 04, 2006 7:41 pm    Post subject: Re: Fluxbox can't set background! Reply with quote

humbletech99 wrote:
When I change to a style in Fluxbox the style doesn't set the background, even though the style is correct, this happens for every single style, including the default ones. The style will set the window decorations and the taskbar but not the background.

So you want the styles to be able to override your custom wallpaper? Or, do you want the styles to set your custom wallpaper?
Back to top
View user's profile Send private message
humbletech99
Veteran
Veteran


Joined: 26 May 2005
Posts: 1229
Location: London

PostPosted: Sun Jun 04, 2006 8:35 pm    Post subject: Reply with quote

I think we've solved the whole styles don't set the background thing, but now it's the question of how to get the last background re-applied after logging back in and for the last background set to override the default background of the theme if it was overridden manually last session
_________________
The Human Equation:

value(geeks) > value(mundanes)
Back to top
View user's profile Send private message
sean345
Tux's lil' helper
Tux's lil' helper


Joined: 11 Mar 2005
Posts: 103
Location: California

PostPosted: Mon Jun 05, 2006 2:41 am    Post subject: Reply with quote

I use the following line in .fluxbox/init to set the background each time I login to the last wallpaper used. This works for version 0.9.14.
Code:
session.screen0.rootCommand: fbsetbg -l


- Sean
_________________
If cities were built like software is built, the first woodpecker to come along would level civilization.
Black Frog Studios
Back to top
View user's profile Send private message
humbletech99
Veteran
Veteran


Joined: 26 May 2005
Posts: 1229
Location: London

PostPosted: Mon Jun 05, 2006 7:42 am    Post subject: Reply with quote

that's what I used to do but it stops the styles from being able to set the background.

seems you can't have it both ways...
_________________
The Human Equation:

value(geeks) > value(mundanes)
Back to top
View user's profile Send private message
sean345
Tux's lil' helper
Tux's lil' helper


Joined: 11 Mar 2005
Posts: 103
Location: California

PostPosted: Tue Jun 06, 2006 2:04 am    Post subject: Reply with quote

humbletech99 wrote:
that's what I used to do but it stops the styles from being able to set the background.

seems you can't have it both ways...
I used to use the backgrounds given in styles and it worked for me. You might try upgrading to the latest version 0.9.15. There is a new way for handling backgrounds and it might work better.

- Sean
_________________
If cities were built like software is built, the first woodpecker to come along would level civilization.
Black Frog Studios
Back to top
View user's profile Send private message
JC Denton
Apprentice
Apprentice


Joined: 16 Apr 2003
Posts: 151
Location: USA

PostPosted: Tue Jun 06, 2006 7:51 am    Post subject: Reply with quote

humbletech99 wrote:
I think we've solved the whole styles don't set the background thing, but now it's the question of how to get the last background re-applied after logging back in and for the last background set to override the default background of the theme if it was overridden manually last session

I can only think of three options:
  • Remove write permission from the 'lastwallpaper' file. This way the "last" wallpaper is never overriden by a style.
  • Edit each style, and adjust the wallpaper settings manually.
  • Set your init file's 'rootCommand' to set the wallpaper to what you want (e.g., fbsetbg -c wallpaper.png).
Unless I'm misunderstanding what you want to do, I think one of these options will work; although, it will be somewhat of a jury-rig.
Back to top
View user's profile Send private message
humbletech99
Veteran
Veteran


Joined: 26 May 2005
Posts: 1229
Location: London

PostPosted: Tue Jun 06, 2006 8:53 am    Post subject: Reply with quote

Thanks for the advice Jim, I think the third one is the proper way to do it but unfortunately it stops styles setting the background when you select a different style, which is how this thread began.

I would like the style to set the background when it is changed, if I don't like the default then I can change it, but I just don't want the background to go back to the default one every time the session is restarted. If I choose a style and want another background with it, then I effectively have to edit the style which is not a very good hack.

Tricky.
_________________
The Human Equation:

value(geeks) > value(mundanes)
Back to top
View user's profile Send private message
KillMinusNine
n00b
n00b


Joined: 27 Dec 2005
Posts: 44
Location: Washington

PostPosted: Tue Jun 06, 2006 3:17 pm    Post subject: Reply with quote

humbletech99 wrote:
Thanks for the advice Jim, I think the third one is the proper way to do it but unfortunately it stops styles setting the background when you select a different style, which is how this thread began.

I would like the style to set the background when it is changed, if I don't like the default then I can change it, but I just don't want the background to go back to the default one every time the session is restarted. If I choose a style and want another background with it, then I effectively have to edit the style which is not a very good hack.

Tricky.


I had an idea last night that I think will solve your problem. Take the code below and save it into a file like (for instance) ~/fbsetbgwrapper

Code:
#!/bin/bash
cp ~/.fluxbox/lastwallpaper ~/.fluxbox/lastwallpaper2
sleep 4.0 #This may need to be higher on a slower startup process, or lower to make it 'nicer'.
mv ~/.fluxbox/lastwallpaper2 ~/.fluxbox/lastwallpaper
fbsetbg -l


Then:

Code:
chmod 544 ~/fbsetbgwrapper


Then edit ~/.fluxbox/startup and add

Code:
~/fbsetbgwrapper &


Immediately before the exec /usr/bin/fluxbox line.

If it seems like there's too long a delay between boot and the wallpaper being set, try decreasing the number in sleep. If too short (the style is still setting the BG), increase the number.


This should solve the problem because...

Currently, what seems to be happening is that when the session starts, the style resets its background. We don't like this, we only want to do it when we set the style. Another way to look at it is that we only want it to set the style when we're NOT starting. So, during the startup we'll backup lastwallpaper so that the style can't modify it. We wait for the style to set the background (sleep) and then re-set it to whatever we were using when we shut down. Then we change the permissions on the wallpaper file back to what it was so that we can once again edit lastwallpaper.

It's not a perfect solution - the wallpaper will still be the style's for a second or two - but I think it'll work.


Last edited by KillMinusNine on Tue Jun 06, 2006 4:19 pm; edited 4 times in total
Back to top
View user's profile Send private message
humbletech99
Veteran
Veteran


Joined: 26 May 2005
Posts: 1229
Location: London

PostPosted: Tue Jun 06, 2006 3:21 pm    Post subject: Reply with quote

good idea, do you know if the styles will object to this? will they give xmessage errors?

if not then it's a cheap way to get the job done, which I could live with until fluxbox developers sort out a proper way of doing this...

thanks!

If I come up with another way, I'll post it back here.
_________________
The Human Equation:

value(geeks) > value(mundanes)
Back to top
View user's profile Send private message
KillMinusNine
n00b
n00b


Joined: 27 Dec 2005
Posts: 44
Location: Washington

PostPosted: Tue Jun 06, 2006 3:38 pm    Post subject: Reply with quote

humbletech99

Sorry, when I first posted that I didn't realize that fbsetbg was aggressive enough to reset the permissions on a file so that it could write to it, even when I was explicitly trying to stop it. The replacement code (above) ought to fix my oversight by moving the lastwallpaper out of the way.
Back to top
View user's profile Send private message
humbletech99
Veteran
Veteran


Joined: 26 May 2005
Posts: 1229
Location: London

PostPosted: Tue Jun 06, 2006 3:47 pm    Post subject: Reply with quote

I doubt that, it'll probably just recreate the lastwallpaper file...

anyway, this is moot, I gotta upgrade to .15 which I think is still in testing but I'll accept the keywords and get it anyway.

there is a new way of doing it, you don't explicitly call fbsetbg any more. It's safer.

Gotta one-liner all my styles though...
_________________
The Human Equation:

value(geeks) > value(mundanes)
Back to top
View user's profile Send private message
breen
n00b
n00b


Joined: 17 May 2004
Posts: 20

PostPosted: Thu Sep 06, 2007 2:25 pm    Post subject: Reply with quote

As the new way was not posted here, I'm guess it's this, which I've been wrestling with for quite some time:

To have a background set by a style, the style file must contain two key lines:

background: aspect | tiled | centered
background.pixmap: /path/to/wallpaper

(i.e. Choose one of aspect, tiles or centered).

As it turns out, you need both lines or styles will not load backgrounds. You should not use rootCommand in styles any longer, as these two lines above pass the arguments to fbsetbg. You still need feh or the like, and you can still override the style backgrounds with a rootCommand in your init file.

Cheers,
David
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum