6

I have an Acrobat reader that does not zoom on Control+plus but rather on Control+acute (Control-plus annoyingly rotates the document).

I would like to fix this using xbindkeys and xdotool but the complication is that Control-plus is also used by other applications.

So the idea is to intercept Control-plus, check if Acrobat is the active window. If so send Acrobat a Control-acute, otherwise send the Control-plus.

Here my current attempt for the script that xbindkeys starts on Control+plus:

WM_CLASS=$(xprop -id `xdotool getactivewindow` WM_CLASS |awk '{print $4}')

if [ "$WM_CLASS" = "\"Acroread"\" ];
then
   sleep 0.1s;
   xdotool key --clearmodifiers ctrl+acute
else
   killall xbindkeys
   xdotool key --clearmodifiers ctrl+plus
   xbindkeys
fi

This actually works but the problem is that if I would not kill xbindkeys than xdotool sending ctrl-plus would again trigger xbindkeys and so on.

But of course this means that every time I hit Control+plus in a non-acrobat window xbindkeys needs to be killed and restarted...

Is there a better way to do this?

Many thanks!

  • Unrelated crystal ball: you have a german-language keyboard and acroread thinks the layout is U.S., is that intentional? – Ulrich Schwarz Feb 2 '15 at 16:30
0

Based this answer on Ask Ubuntu, it would appear that killing and then restarting xbindkeys is not necessary.

  • If that AU link becomes deleted, would you please import the relevant bits here? Thank you! – Jeff Schaller May 5 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.