From 318bf177cbeacc4c6ecf311949f0f6864d5f9da8 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 21 Mar 2017 18:49:27 +0100 Subject: midori-display: Only hack mouse pointer functionality if (a) xmodmap is installed and (b) POINTER_BUTTON_MAP is a non-empty string. --- bin/midori-display | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/midori-display b/bin/midori-display index afb34c0..5949686 100755 --- a/bin/midori-display +++ b/bin/midori-display @@ -127,9 +127,13 @@ fi sanitized_pointer_button_map=$(echo ${POINTER_BUTTON_MAP//[^0-9\ ]/} | sed -e 's/^\s*//' -e 's/\s*$//') count_buttons_pointer_button_map=$(echo -n "${sanitized_pointer_button_map//[0-9]/}"| wc -m) -if [ "x$POINTER_BUTTON_MAP" = "x$sanitized_pointer_button_map" ] && \ - [ $count_buttons_pointer_button_map -lt 32 ]; then - xmodmap -e "pointer = $POINTER_BUTTON_MAP" +if which xmodmap 1>/dev/null; then + if [ -n "$POINTER_BUTTON_MAP" ] && [ "x$POINTER_BUTTON_MAP" = "x$sanitized_pointer_button_map" ] && \ + [ $count_buttons_pointer_button_map -lt 32 ]; then + xmodmap -e "pointer = $POINTER_BUTTON_MAP" + fi +else + $OUTPUT "WARNING: Cannot strip down mouse/pointer button functionality. Make sure 'xmodmap' is installed." fi # if FAKE_HOSTNAME is not empty, use that string for hostname -- cgit v1.2.3