aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-12-12 13:07:47 (GMT)
committerfluxgen <fluxgen>2003-12-12 13:07:47 (GMT)
commit5d4980a9c60aef3f61e0d0cfbf8fc19fff2082ad (patch)
treeaf15b7955e7ebb66d04d370045ee5512b37a99c5 /util
parent96c144540887655c3aa0c391a813fabc38855664 (diff)
downloadfluxbox_pavel-5d4980a9c60aef3f61e0d0cfbf8fc19fff2082ad.zip
fluxbox_pavel-5d4980a9c60aef3f61e0d0cfbf8fc19fff2082ad.tar.bz2
support for bsetroot in fbsetbg
Diffstat (limited to 'util')
-rw-r--r--util/fbsetbg55
1 files changed, 39 insertions, 16 deletions
diff --git a/util/fbsetbg b/util/fbsetbg
index bd285f5..c053ea2 100644
--- a/util/fbsetbg
+++ b/util/fbsetbg
@@ -23,7 +23,7 @@
23# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25# 25#
26# $Id: fbsetbg,v 1.24 2003/12/08 19:31:40 fluxgen Exp $ 26# $Id: fbsetbg,v 1.25 2003/12/12 13:07:47 fluxgen Exp $
27 27
28# Portability notes: 28# Portability notes:
29# To guarantee this script works on all platforms that support fluxbox 29# To guarantee this script works on all platforms that support fluxbox
@@ -59,7 +59,7 @@ command="`basename \"$0\"`"
59# Functions 59# Functions
60display_usage() { 60display_usage() {
61 cat << EOF 61 cat << EOF
62Usage: $command [-u/-U [wallpapersetter]] [-fFcCtTaA /path/to/wallpaper] [-l] [-h] [-i] [-p] 62Usage: $command [-u/-U [wallpapersetter]] [-fFcCtTaA /path/to/wallpaper] [-bB bsetrootoptions] [-l] [-h] [-i] [-p]
63Use \`\`$command -h'' for a complete help message. 63Use \`\`$command -h'' for a complete help message.
64 64
65EOF 65EOF
@@ -71,23 +71,24 @@ display_help() {
71 71
72Options: 72Options:
73 73
74 -f Set fullscreen wallpaper 74 -f Set fullscreen wallpaper.
75 -c Set centered wallpaper 75 -c Set centered wallpaper.
76 -t Set tiled wallpaper 76 -t Set tiled wallpaper.
77 -a Set maximized wallpaper, preserving aspect. 77 -a Set maximized wallpaper, preserving aspect.
78 ( if your bgsetter doesn't support this 78 ( if your bgsetter doesn't support this
79 we fall back to -f ) 79 we fall back to -f )
80 -u Use specified wallpapersetter, use no argument to forget 80 -u Use specified wallpapersetter, use no argument to forget.
81 -b Forward the options to bsetroot.
81 82
82 -F,-C,-T,-A,-U same as uncapsed but without remembering. 83 -F,-C,-T,-A,-U,-B same as uncapsed but without remembering.
83 84
84 -h Display this help 85 -h Display this help.
85 86
86 -l Set previous wallpaper 87 -l Set previous wallpaper.
87 88
88 -i Information about selected wallpaper command 89 -i Information about selected wallpaper command.
89 -d (deprecated, use -i) Debug info 90 -d (deprecated, use -i) Debug info.
90 -p Tips 91 -p Tips.
91 92
92 93
93Files: 94Files:
@@ -162,6 +163,10 @@ message() {
162remembercommand() { 163remembercommand() {
163 grep -vs "|${DISPLAY}$" ${lastwallpaper} > ${lastwallpaper}.tmp 164 grep -vs "|${DISPLAY}$" ${lastwallpaper} > ${lastwallpaper}.tmp
164 mv -f ${lastwallpaper}.tmp ${lastwallpaper} 165 mv -f ${lastwallpaper}.tmp ${lastwallpaper}
166 if [ "$option" = bsetroot ]; then
167 echo $option'|'$wallpaper'|'$DISPLAY >> $lastwallpaper
168 return
169 fi
165 # Make dir/../../path/file.jpg work 170 # Make dir/../../path/file.jpg work
166 case $wallpaper in 171 case $wallpaper in
167 # no spaces allowed between the varname and '|' 172 # no spaces allowed between the varname and '|'
@@ -246,6 +251,15 @@ while [ $# -gt 0 ]; do
246 wallpaper=$2 251 wallpaper=$2
247 remember=false 252 remember=false
248 break ;; 253 break ;;
254 -b) option=bsetroot
255 shift
256 wallpaper=$*
257 break ;;
258 -B) option=bsetroot
259 shift
260 wallpaper=$*
261 remember=false
262 break;;
249 -l) 263 -l)
250 if [ -r "$lastwallpaper" ]; then 264 if [ -r "$lastwallpaper" ]; then
251 option=`grep "|${DISPLAY}$" $lastwallpaper|cut -d'|' -f1` 265 option=`grep "|${DISPLAY}$" $lastwallpaper|cut -d'|' -f1`
@@ -403,16 +417,25 @@ fi
403 417
404option=${option:='$full'} 418option=${option:='$full'}
405 419
406if [ ! -r "$wallpaper" ]; then 420
407 message "Can't find wallpaper $wallpaper"
408 exit 1
409fi
410 421
411if [ -z "$DISPLAY" ];then 422if [ -z "$DISPLAY" ];then
412 message "You are not connected to an X session\nPerhaps you should set the DISPLAY environment variable?" 423 message "You are not connected to an X session\nPerhaps you should set the DISPLAY environment variable?"
413 exit 1 424 exit 1
414fi 425fi
415 426
427if [ "$option" = bsetroot ]; then
428 bsetroot $wallpaper
429 if [ ! "$remember" = false ]; then
430 remembercommand
431 fi
432 exit 0
433fi
434
435if [ ! -r "$wallpaper" ]; then
436 message "Can't find wallpaper $wallpaper"
437 exit 1
438fi
416 439
417$WPSETTER `eval echo $option` "$wallpaper" 440$WPSETTER `eval echo $option` "$wallpaper"
418if [ $? -ne 0 ]; then 441if [ $? -ne 0 ]; then