From 650afbb9ad5702df7f80b59ed25201d4056de5a7 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 25 Apr 2010 17:43:29 +0200 Subject: [PATCH] Check for xwininfo before using it Signed-off-by: Uli Schlachter Signed-off-by: Julien Danjou --- utils/awsetbg | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/utils/awsetbg b/utils/awsetbg index 769abd24..460fc8d3 100755 --- a/utils/awsetbg +++ b/utils/awsetbg @@ -144,6 +144,7 @@ debugawsetbg() { echo echo $debugstory echo $sad_esetroot_story + echo $sad_display_story exit 0 } @@ -320,15 +321,26 @@ if [ "$setterfromcommandline" != true ]; then fi for wpsetter in $wpsetters; do if find_it $wpsetter; then - if [ ! "$wpsetter" = Esetroot ]; then - WPSETTER=$wpsetter - break - elif ldd `which Esetroot`|grep libImlib 2>&1 > /dev/null; then - WPSETTER=$wpsetter - break - else - sad_esetroot_story="I also found Esetroot, but it doesn't have support for setting wallpapers. You need to install libimlib2 and rebuild Eterm to get it working." - fi + case $wpsetter in + Esetroot) + if ldd `which Esetroot`|grep libImlib 2>&1 > /dev/null; then + WPSETTER=$wpsetter + break + else + sad_esetroot_story="I also found Esetroot, but it doesn't have support for setting wallpapers. You need to install libimlib2 and rebuild Eterm to get it working." + fi + ;; + display) + if find_it xwininfo; then + WPSETTER=$wpsetter + break + else + sad_display_story="I also found display, but I need xwininfo for querying the root window geometry." + fi + ;; + *) + WPSETTER=$wpsetter + esac fi done fi