midori-display: Only hack mouse pointer functionality if (a) xmodmap is installed and (b) POINTER_BUTTON_MAP is a non-empty string.

This commit is contained in:
Mike Gabriel 2017-03-21 18:49:27 +01:00
parent cb6e552b5d
commit 318bf177cb
1 changed files with 7 additions and 3 deletions

View File

@ -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