aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authormarkt <markt>2006-08-04 23:28:34 (GMT)
committermarkt <markt>2006-08-04 23:28:34 (GMT)
commit53adbd99214d1af6c422dda7d7a1f08b2f95d6c8 (patch)
tree15ee63c5d6bf4fbf7af7caac7f727a18a085f553 /util
parent1dd5e0143e6ab63833851f4b3a42c500a9777162 (diff)
downloadfluxbox_paul-53adbd99214d1af6c422dda7d7a1f08b2f95d6c8.zip
fluxbox_paul-53adbd99214d1af6c422dda7d7a1f08b2f95d6c8.tar.bz2
allow aspect/centered/tiled options with random in fbsetbg
Diffstat (limited to 'util')
-rw-r--r--util/fbsetbg49
1 files changed, 23 insertions, 26 deletions
diff --git a/util/fbsetbg b/util/fbsetbg
index b633222..de46289 100644
--- a/util/fbsetbg
+++ b/util/fbsetbg
@@ -59,9 +59,10 @@ 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] 62Usage: $command [-u/-U [wallpapersetter]] [-fFcCtTaA] /path/to/wallpaper
63 [-r/-R /path/to/wallpaperdirectory] 63 $command [-u/-U [wallpapersetter]] [-fFcCtTaA] -r/-R /path/to/wallpaperdirectory
64 [-b/-B fbsetrootoptions] [-l] [-h] [-i] [-p] 64 $command [-b/-B fbsetrootoptions]
65 $command [-lhip]
65Use \`\`$command -h'' for a complete help message. 66Use \`\`$command -h'' for a complete help message.
66 67
67EOF 68EOF
@@ -73,7 +74,7 @@ display_help() {
73 74
74Options: 75Options:
75 76
76 -f Set fullscreen wallpaper. 77 -f Set fullscreen wallpaper (default).
77 -c Set centered wallpaper. 78 -c Set centered wallpaper.
78 -t Set tiled wallpaper. 79 -t Set tiled wallpaper.
79 -a Set maximized wallpaper, preserving aspect. 80 -a Set maximized wallpaper, preserving aspect.
@@ -181,8 +182,8 @@ remembercommand() {
181 # Make dir/../../path/file.jpg work 182 # Make dir/../../path/file.jpg work
182 case $wallpaper in 183 case $wallpaper in
183 # no spaces allowed between the varname and '|' 184 # no spaces allowed between the varname and '|'
184 /*) echo $option'|'$wallpaper'|'$DISPLAY >> $lastwallpaper ;; 185 /*) echo $option $option2'|'$wallpaper'|'$DISPLAY >> $lastwallpaper ;;
185 *) echo $option'|'$PWD/$wallpaper'|'$DISPLAY >> $lastwallpaper ;; 186 *) echo $option $option2'|'$PWD/$wallpaper'|'$DISPLAY >> $lastwallpaper ;;
186 esac 187 esac
187} 188}
188 189
@@ -240,33 +241,25 @@ while [ $# -gt 0 ]; do
240 -d|-i) debug=true 241 -d|-i) debug=true
241 break ;; 242 break ;;
242 -a) option='$aspect' 243 -a) option='$aspect'
243 wallpaper=$2 244 shift ;;
244 break ;;
245 -f) option='$full' 245 -f) option='$full'
246 wallpaper=$2 246 shift ;;
247 break ;;
248 -c) option='$center' 247 -c) option='$center'
249 wallpaper=$2 248 shift ;;
250 break ;;
251 -t) option='$tile' 249 -t) option='$tile'
252 wallpaper=$2 250 shift ;;
253 break ;;
254 -A) option='$aspect' 251 -A) option='$aspect'
255 wallpaper=$2
256 remember=false 252 remember=false
257 break ;; 253 shift ;;
258 -F) option='$full' 254 -F) option='$full'
259 wallpaper=$2
260 remember=false 255 remember=false
261 break ;; 256 shift ;;
262 -C) option='$center' 257 -C) option='$center'
263 wallpaper=$2
264 remember=false 258 remember=false
265 break ;; 259 shift ;;
266 -T) option='$tile' 260 -T) option='$tile'
267 wallpaper=$2
268 remember=false 261 remember=false
269 break ;; 262 shift ;;
270 -b) option=fbsetroot 263 -b) option=fbsetroot
271 shift 264 shift
272 wallpaper=$* 265 wallpaper=$*
@@ -276,16 +269,20 @@ while [ $# -gt 0 ]; do
276 wallpaper=$* 269 wallpaper=$*
277 remember=false 270 remember=false
278 break ;; 271 break ;;
279 -r) option=random 272 -r) option2=$option
273 option=random
280 wallpaper=$2 # in this case it's a dir 274 wallpaper=$2 # in this case it's a dir
281 break ;; 275 break ;;
282 -R) option=random 276 -R) option2=$option
277 option=random
283 wallpaper=$2 # in this case it's a dir 278 wallpaper=$2 # in this case it's a dir
284 remember=false 279 remember=false
285 break ;; 280 break ;;
286 -l) 281 -l)
287 if [ -r "$lastwallpaper" ]; then 282 if [ -r "$lastwallpaper" ]; then
288 option=`grep "|${DISPLAY}$" $lastwallpaper|cut -d'|' -f1` 283 option=`grep "|${DISPLAY}$" $lastwallpaper|cut -d'|' -f1`
284 option2=`echo $option|cut -d' ' -f2`
285 option=`echo $option|cut -d' ' -f1`
289 wallpaper=`grep "|${DISPLAY}$" $lastwallpaper|cut -d'|' -f2` 286 wallpaper=`grep "|${DISPLAY}$" $lastwallpaper|cut -d'|' -f2`
290 if [ -z "$wallpaper" ]; then 287 if [ -z "$wallpaper" ]; then
291 option=`grep "|${DISPLAY}.0$" $lastwallpaper|cut -d'|' -f1` 288 option=`grep "|${DISPLAY}.0$" $lastwallpaper|cut -d'|' -f1`
@@ -461,7 +458,7 @@ if [ "$debug" = true ]; then
461fi 458fi
462 459
463option=${option:='$full'} 460option=${option:='$full'}
464 461option2=${option2:='$full'}
465 462
466 463
467if [ -z "$DISPLAY" ]; then 464if [ -z "$DISPLAY" ]; then
@@ -505,7 +502,7 @@ if [ "$option" = random ]; then
505 remember=false 502 remember=false
506 #set -x 503 #set -x
507 wallpaper="$wallpaperdir/`ls \"$wallpaperdir\"|sed -n ${wallpapernumber}p`" 504 wallpaper="$wallpaperdir/`ls \"$wallpaperdir\"|sed -n ${wallpapernumber}p`"
508 option='$aspect' # have to choose something... 505 option=$option2 # have to choose something...
509 else 506 else
510 message "Invalid random wallpaper directory specified." 507 message "Invalid random wallpaper directory specified."
511 exit 1 508 exit 1