summaryrefslogtreecommitdiff
path: root/util/fbsetbg
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-08-06 06:40:18 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-08-06 06:40:18 (GMT)
commitc52a84a1704a2963b3d454a43617d8911778fb72 (patch)
tree256f5d56ab4e19912661e383fc645de57f642432 /util/fbsetbg
parent9e259590a2a59b89471bf3f42366c2209c69bf9c (diff)
downloadfluxbox_lack-c52a84a1704a2963b3d454a43617d8911778fb72.zip
fluxbox_lack-c52a84a1704a2963b3d454a43617d8911778fb72.tar.bz2
make wallpapers do The Right Thing (tm)
Diffstat (limited to 'util/fbsetbg')
-rw-r--r--util/fbsetbg39
1 files changed, 31 insertions, 8 deletions
diff --git a/util/fbsetbg b/util/fbsetbg
index 0f38d4c..a12d427 100644
--- a/util/fbsetbg
+++ b/util/fbsetbg
@@ -155,14 +155,14 @@ remembercommand() {
155 grep -vs "|${DISPLAY}$" ${lastwallpaper} > ${lastwallpaper}.tmp 155 grep -vs "|${DISPLAY}$" ${lastwallpaper} > ${lastwallpaper}.tmp
156 mv -f ${lastwallpaper}.tmp ${lastwallpaper} 156 mv -f ${lastwallpaper}.tmp ${lastwallpaper}
157 if [ "$option" = fbsetroot ]; then 157 if [ "$option" = fbsetroot ]; then
158 echo $option"|$wallpaper|"$DISPLAY >> $lastwallpaper 158 echo $option"|$wallpaper|$style|"$DISPLAY >> $lastwallpaper
159 return 159 return
160 fi 160 fi
161 # Make dir/../../path/file.jpg work 161 # Make dir/../../path/file.jpg work
162 case $wallpaper in 162 case $wallpaper in
163 # no spaces allowed between the varname and '|' 163 # no spaces allowed between the varname and '|'
164 /*) echo $option $option2"|$wallpaper|"$DISPLAY >> $lastwallpaper ;; 164 /*) echo $option $option2"|$wallpaper|$style|"$DISPLAY >> $lastwallpaper ;;
165 *) echo $option $option2"|$PWD/$wallpaper|"$DISPLAY >> $lastwallpaper ;; 165 *) echo $option $option2"|$PWD/$wallpaper|$style|"$DISPLAY >> $lastwallpaper ;;
166 esac 166 esac
167} 167}
168 168
@@ -252,13 +252,11 @@ while [ $# -gt 0 ]; do
252 -b) option=fbsetroot 252 -b) option=fbsetroot
253 shift 253 shift
254 wallpaper=$* 254 wallpaper=$*
255 use_fbsetroot
256 break ;; 255 break ;;
257 -B) option=fbsetroot 256 -B) option=fbsetroot
258 shift 257 shift
259 wallpaper=$* 258 wallpaper=$*
260 remember=false 259 remember=false
261 use_fbsetroot
262 break ;; 260 break ;;
263 -r) option2=$option 261 -r) option2=$option
264 option=random 262 option=random
@@ -285,15 +283,36 @@ while [ $# -gt 0 ]; do
285 message "No previous wallpaper recorded for display ${DISPLAY}" 283 message "No previous wallpaper recorded for display ${DISPLAY}"
286 exit 1 284 exit 1
287 fi 285 fi
288 if [ "$option" = "fbsetroot" ]; then
289 use_fbsetroot
290 fi
291 else 286 else
292 message "No previous wallpaper recorded for display ${DISPLAY}" 287 message "No previous wallpaper recorded for display ${DISPLAY}"
293 exit 1 288 exit 1
294 fi 289 fi
295 remember=false 290 remember=false
296 break ;; 291 break ;;
292 -z)
293 if [ -r "$lastwallpaper" ]; then
294 option=`grep "|${DISPLAY}$" $lastwallpaper|cut -d'|' -f1`
295 option2=`echo $option|cut -d' ' -f2`
296 option=`echo $option|cut -d' ' -f1`
297 style=`grep "|${DISPLAY}$" $lastwallpaper|cut -d'|' -f3`
298 wallpaper=`grep "|${DISPLAY}$" $lastwallpaper|cut -d'|' -f2`
299 if [ -z "$wallpaper" ]; then
300 option=`grep "|${DISPLAY}.0$" $lastwallpaper|cut -d'|' -f1`
301 option2=`echo $option|cut -d' ' -f2`
302 option=`echo $option|cut -d' ' -f1`
303 style=`grep "|${DISPLAY}.0$" $lastwallpaper|cut -d'|' -f3`
304 wallpaper=`grep "|${DISPLAY}.0$" $lastwallpaper|cut -d'|' -f2`
305 fi
306 fi
307 if [ "$style" != "style" -a -n "$wallpaper" ]; then
308 remember=false
309 break
310 fi
311 style="style"
312 shift ;;
313 -Z)
314 style="style"
315 shift ;;
297 -p) display_tips ; exit 0 ;; 316 -p) display_tips ; exit 0 ;;
298 -h) display_help ; exit 0 ;; 317 -h) display_help ; exit 0 ;;
299 --) 318 --)
@@ -323,6 +342,10 @@ while [ $# -gt 0 ]; do
323 esac 342 esac
324done 343done
325 344
345if [ "$option" = "fbsetroot" ]; then
346 use_fbsetroot
347fi
348
326# Find the default wallpapersetter 349# Find the default wallpapersetter
327if [ "$setterfromcommandline" != true ]; then 350if [ "$setterfromcommandline" != true ]; then
328 if [ -r "$lastwallpaper" ]; then 351 if [ -r "$lastwallpaper" ]; then