aboutsummaryrefslogtreecommitdiff
path: root/util/fbsetbg
diff options
context:
space:
mode:
authorsimonb <simonb>2005-03-10 13:53:26 (GMT)
committersimonb <simonb>2005-03-10 13:53:26 (GMT)
commitb7d3dc2fa389706bde066219b11d3b66832cfa9e (patch)
treebef84fcad42c7788ff3473b9f8a6f51c4e33ed8e /util/fbsetbg
parentaa0a9cd50674fbf55ae05c29ae4cbb873f2c55c0 (diff)
downloadfluxbox_paul-b7d3dc2fa389706bde066219b11d3b66832cfa9e.zip
fluxbox_paul-b7d3dc2fa389706bde066219b11d3b66832cfa9e.tar.bz2
fix 'which' program compatibility.
Test the capabilities of the one we find, rather than guessing based on the system type
Diffstat (limited to 'util/fbsetbg')
-rw-r--r--util/fbsetbg42
1 files changed, 21 insertions, 21 deletions
diff --git a/util/fbsetbg b/util/fbsetbg
index 3db53da..a75f461 100644
--- a/util/fbsetbg
+++ b/util/fbsetbg
@@ -130,28 +130,28 @@ Common tips to use with $command:
130EOF 130EOF
131} 131}
132 132
133# ugly code for solaris compat. 133# some which's have a reliable return code, some don't
134case `uname` in 134# Lets figure out which which we have.
135 Linux|*BSD) 135if which this_program_does_not_exist-no_really-aA1zZ9 >/dev/null 2>/dev/null; then
136 find_it() { 136 # can't rely on return value
137 which $1 > /dev/null 2>&1 && shift && $* 137 find_it() {
138 } 138 file=`which $1 2> /dev/null`
139 ;; 139 if [ -x "$file" ]; then
140 *) 140 if [ $# -gt 1 ]; then
141 find_it() { 141 shift
142 file=`which $1 2> /dev/null` 142 $*
143 if [ -x "$file" ]; then
144 if [ $# -gt 1 ]; then
145 shift
146 $*
147 fi
148 return 0
149 else
150 return 1
151 fi 143 fi
152 } 144 return 0
153 ;; 145 else
154esac 146 return 1
147 fi
148 }
149else
150 # can rely on return value
151 find_it() {
152 which $1 > /dev/null 2>&1 && shift && $*
153 }
154fi
155 155
156message() { 156message() {
157 157