aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-04-29 13:50:05 (GMT)
committerfluxgen <fluxgen>2003-04-29 13:50:05 (GMT)
commit80c1f78cb55923980a2121dac2dfa2d330669fdd (patch)
treecedf33eea6db143c5faa98c808d9932e4981d255
parent6b125d1c6046ed1ec1fca92c371f3b7c39449755 (diff)
downloadfluxbox_pavel-80c1f78cb55923980a2121dac2dfa2d330669fdd.zip
fluxbox_pavel-80c1f78cb55923980a2121dac2dfa2d330669fdd.tar.bz2
update from Han
-rw-r--r--util/fbsetbg25
1 files changed, 16 insertions, 9 deletions
diff --git a/util/fbsetbg b/util/fbsetbg
index 0aa0a31..09bcc77 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.3 2003/04/29 11:26:34 rathnor Exp $ 26# $Id: fbsetbg,v 1.4 2003/04/29 13:50:05 fluxgen Exp $
27 27
28# 28#
29# Portability notes: 29# Portability notes:
@@ -49,7 +49,7 @@ WHOAMI=`whoami`
49# Functions 49# Functions
50display_usage() { 50display_usage() {
51 cat <<EOF 51 cat <<EOF
52Usage: fbsetbg [-fct /path/to/wallpaper ] [ -l ] [ -h ] 52Usage: fbsetbg [ -fcta /path/to/wallpaper ] [ -l ] [ -h ] [ -d ]
53EOF 53EOF
54} 54}
55 55
@@ -229,8 +229,8 @@ case "${COMMAND_LINE_ARGUMENT}" in
229 ;; 229 ;;
230 l) 230 l)
231 if [ -r $lastwallpaper ];then 231 if [ -r $lastwallpaper ];then
232 option=$(head -n1 $lastwallpaper) 232 option=`head -n1 $lastwallpaper`
233 wallpaper=$(tail -n1 $lastwallpaper) 233 wallpaper=`tail -n1 $lastwallpaper`
234 else 234 else
235 message 'No previous wallpaper recorded.' 235 message 'No previous wallpaper recorded.'
236 fi 236 fi
@@ -238,19 +238,26 @@ case "${COMMAND_LINE_ARGUMENT}" in
238 h) display_help ; exit 0 ;; 238 h) display_help ; exit 0 ;;
239 T) display_tips ; exit 0 ;; 239 T) display_tips ; exit 0 ;;
240 -) echo "fbsetbg doesn't recognize -- gnu-longopts." 240 -) echo "fbsetbg doesn't recognize -- gnu-longopts."
241 echo "Use fbsetbg -h for a long help message." 241 echo 'Use fbsetbg -h for a long help message.'
242 display_usage 242 display_usage
243 exit 1 243 exit 1
244 ;; 244 ;;
245 *) if [ ! -r "$1" ]; then
246 echo "$1 isn't an existing wallpaper or a valid option." >&2
247 display_usage
248 exit 1
249 fi
250 if [ -z "$1" ];then
251 message 'No wallpaper to set' >&2
252 display_usage
253 exit 1
254 fi
255 ;;
245esac 256esac
246 257
247option=${option:=$full} 258option=${option:=$full}
248wallpaper=${wallpaper:=$1} 259wallpaper=${wallpaper:=$1}
249 260
250if [ -z "$wallpaper" ];then
251 message 'No wallpaper to set'
252 exit 1
253fi
254 261
255if [ ! -r "$wallpaper" ];then 262if [ ! -r "$wallpaper" ];then
256 message "Can't find wallpaper $wallpaper" 263 message "Can't find wallpaper $wallpaper"