View previous topic :: View next topic |
Author |
Message |
humbletech99 Veteran
Joined: 26 May 2005 Posts: 1229 Location: London
|
Posted: Sat Jun 03, 2006 5:29 pm Post subject: Fluxbox can't set background! |
|
|
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 |
|
|
savage Apprentice
Joined: 01 Jan 2003 Posts: 161
|
Posted: Sat Jun 03, 2006 6:01 pm Post subject: Re: Fluxbox can't set background! |
|
|
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 |
|
|
humbletech99 Veteran
Joined: 26 May 2005 Posts: 1229 Location: London
|
Posted: Sat Jun 03, 2006 6:44 pm Post subject: |
|
|
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 |
|
|
KillMinusNine n00b
Joined: 27 Dec 2005 Posts: 44 Location: Washington
|
Posted: Sat Jun 03, 2006 10:56 pm Post subject: |
|
|
humbletech99 wrote: | you meant the init file? |
The line he quoted is in ~/.fluxbox/startup.
For what it's worth (not much) I use
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 |
|
|
humbletech99 Veteran
Joined: 26 May 2005 Posts: 1229 Location: London
|
Posted: Sat Jun 03, 2006 11:10 pm Post subject: |
|
|
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 |
|
|
KillMinusNine n00b
Joined: 27 Dec 2005 Posts: 44 Location: Washington
|
Posted: Sun Jun 04, 2006 4:00 am Post subject: |
|
|
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 |
|
|
humbletech99 Veteran
Joined: 26 May 2005 Posts: 1229 Location: London
|
Posted: Sun Jun 04, 2006 10:10 am Post subject: |
|
|
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 |
|
|
savage Apprentice
Joined: 01 Jan 2003 Posts: 161
|
Posted: Sun Jun 04, 2006 1:10 pm Post subject: |
|
|
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 |
|
|
humbletech99 Veteran
Joined: 26 May 2005 Posts: 1229 Location: London
|
Posted: Sun Jun 04, 2006 5:54 pm Post subject: |
|
|
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 |
|
|
JC Denton Apprentice
Joined: 16 Apr 2003 Posts: 151 Location: USA
|
Posted: Sun Jun 04, 2006 7:41 pm Post subject: Re: Fluxbox can't set background! |
|
|
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 |
|
|
humbletech99 Veteran
Joined: 26 May 2005 Posts: 1229 Location: London
|
Posted: Sun Jun 04, 2006 8:35 pm Post subject: |
|
|
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 |
|
|
sean345 Tux's lil' helper
Joined: 11 Mar 2005 Posts: 103 Location: California
|
Posted: Mon Jun 05, 2006 2:41 am Post subject: |
|
|
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 |
|
|
humbletech99 Veteran
Joined: 26 May 2005 Posts: 1229 Location: London
|
Posted: Mon Jun 05, 2006 7:42 am Post subject: |
|
|
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 |
|
|
sean345 Tux's lil' helper
Joined: 11 Mar 2005 Posts: 103 Location: California
|
Posted: Tue Jun 06, 2006 2:04 am Post subject: |
|
|
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 |
|
|
JC Denton Apprentice
Joined: 16 Apr 2003 Posts: 151 Location: USA
|
Posted: Tue Jun 06, 2006 7:51 am Post subject: |
|
|
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 |
|
|
humbletech99 Veteran
Joined: 26 May 2005 Posts: 1229 Location: London
|
Posted: Tue Jun 06, 2006 8:53 am Post subject: |
|
|
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 |
|
|
KillMinusNine n00b
Joined: 27 Dec 2005 Posts: 44 Location: Washington
|
Posted: Tue Jun 06, 2006 3:17 pm Post subject: |
|
|
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
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 |
|
|
humbletech99 Veteran
Joined: 26 May 2005 Posts: 1229 Location: London
|
Posted: Tue Jun 06, 2006 3:21 pm Post subject: |
|
|
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 |
|
|
KillMinusNine n00b
Joined: 27 Dec 2005 Posts: 44 Location: Washington
|
Posted: Tue Jun 06, 2006 3:38 pm Post subject: |
|
|
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 |
|
|
humbletech99 Veteran
Joined: 26 May 2005 Posts: 1229 Location: London
|
Posted: Tue Jun 06, 2006 3:47 pm Post subject: |
|
|
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 |
|
|
breen n00b
Joined: 17 May 2004 Posts: 20
|
Posted: Thu Sep 06, 2007 2:25 pm Post subject: |
|
|
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 |
|
|
|