all repos — fluxbox @ edffe9c93f051e863f9fb9c768a837534c2e567f

custom fork of the fluxbox windowmanager

Allow 'background: unset'

When a user sets 'background: none' it really means "Do not let themes touch the
background I have already set with fbsetbg" -> It does still actually call
fbsetbeg to re-assert the proper background.

This new value 'unset' is for users who will use an alternate method to set
their background (root-tail, xscreensaver, or whatever).  It instructs fluxbox
to *never* run fbsetbg.
Jim Ramsay i.am@jimramsay.com
commit

edffe9c93f051e863f9fb9c768a837534c2e567f

parent

ff6a46391f29922476556f8f198730610f3707c2

3 files changed, 13 insertions(+), 6 deletions(-)

jump to
M doc/asciidoc/fluxbox-style.txtdoc/asciidoc/fluxbox-style.txt

@@ -361,9 +361,12 @@ *fluxbox(1)* will call *fbsetbg(1)* to set the background. The options `gradient',

`solid', and `mod' all require `background.color' to be set. `gradient' and `mod' both require `background.colorTo'. `mod' requires `background.modX' and `background.modY' to be set as well. These options will be passed to -*fbsetroot(1)* to set the background. +*fbsetroot(1)* to set the background. The special option `unset' is for use in +user overlay files only. It specifies that fbsetbg should never be run (by +default, even when `none' is set in the overlay, fluxbox will try to run +``fbsetbg -z'' to restore the last wallpaper). - background: centered|aspect|tiled|fullscreen|random|solid|gradient <texture>|mod|none + background: centered|aspect|tiled|fullscreen|random|solid|gradient <texture>|mod|none|unset background.pixmap: <file or directory> background.color: <color> background.colorTo: <color>
M doc/fluxbox-style.5.indoc/fluxbox-style.5.in

@@ -1,12 +1,12 @@

.\" Title: fluxbox-style .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/> -.\" Date: 02/19/2009 +.\" Date: 05/26/2009 .\" Manual: Fluxbox Manual .\" Source: fluxbox-style.txt 1.1.2 .\" Language: English .\" -.TH "FLUXBOX\-STYLE" "5" "02/19/2009" "fluxbox\-style\&.txt 1\&.1\&.2" "Fluxbox Manual" +.TH "FLUXBOX\-STYLE" "5" "05/26/2009" "fluxbox\-style\&.txt 1\&.1\&.2" "Fluxbox Manual" .\" ----------------------------------------------------------------- .\" * (re)Define some macros .\" -----------------------------------------------------------------

@@ -611,7 +611,7 @@ .RE

.\} .SH "BACKGROUND" .sp -Every style must specify the background option\&. If you don\'t want your style to change the user\'s background, then use `background: none\'\&. The options `centered\', `aspect\', `tiled\', and `fullscreen\' require the `background\&.pixmap\' resource to contain a valid file name\&. The `random\' option requires `background\&.pixmap\' to contain a valid directory name\&. For these options, \fBfluxbox(1)\fR will call \fBfbsetbg(1)\fR to set the background\&. The options `gradient\', `solid\', and `mod\' all require `background\&.color\' to be set\&. `gradient\' and `mod\' both require `background\&.colorTo\'\&. `mod\' requires `background\&.modX\' and `background\&.modY\' to be set as well\&. These options will be passed to \fBfbsetroot(1)\fR to set the background\&. +Every style must specify the background option\&. If you don\'t want your style to change the user\'s background, then use `background: none\'\&. The options `centered\', `aspect\', `tiled\', and `fullscreen\' require the `background\&.pixmap\' resource to contain a valid file name\&. The `random\' option requires `background\&.pixmap\' to contain a valid directory name\&. For these options, \fBfluxbox(1)\fR will call \fBfbsetbg(1)\fR to set the background\&. The options `gradient\', `solid\', and `mod\' all require `background\&.color\' to be set\&. `gradient\' and `mod\' both require `background\&.colorTo\'\&. `mod\' requires `background\&.modX\' and `background\&.modY\' to be set as well\&. These options will be passed to \fBfbsetroot(1)\fR to set the background\&. The special option `unset\' is for use in user overlay files only\&. It specifies that fbsetbg should never be run (by default, even when `none\' is set in the overlay, fluxbox will try to run \(lqfbsetbg \-z\(rq to restore the last wallpaper)\&. .sp .if n \{\ .RS 4

@@ -620,7 +620,7 @@ .fam C

.ps -1 .nf .BB lightgray -background: centered|aspect|tiled|fullscreen|random|solid|gradient <texture>|mod|none +background: centered|aspect|tiled|fullscreen|random|solid|gradient <texture>|mod|none|unset background\&.pixmap: <file or directory> background\&.color: <color> background\&.colorTo: <color>
M src/RootTheme.ccsrc/RootTheme.cc

@@ -202,6 +202,10 @@ std::string img_path = FbTk::Image::locateFile(filename);

filename = FbTk::StringUtil::expandFilename(filename); std::string cmd = realProgramName("fbsetbg") + (m_first ? " -z " : " -Z "); + // user explicitly requests NO background be set at all + if (strstr(m_background->options().c_str(), "unset") != 0) { + return; + } // style doesn't wish to change the background if (strstr(m_background->options().c_str(), "none") != 0) { if (!m_first)