I have a fresh install of Ubuntu Trusty 14.04 on my Lenovo Thinkpad X220T (or X220 Tablet).
I have set up two scripts to enhance the screen rotation, and I would like to bind them to a keyboard shortcut.
Basically, I added these lines on /etc/rc.local
:
setkeycodes 67 202 # Launch3
setkeycodes 6c 149 # Launch2
to bind the second and the third buttons on the edge of the screen to the "Lauch2" and "Launch3" buttons.
Then I try to add a custom shortcut to my scripts, but nothing happends.
Please note that if I link the scripts to a keyboard shortcut, like ctrl+alt+B
, they work.
The scripts are the following:
#!/bin/sh
# Find the line in "xrandr -q --verbose" output that contains current screen orientation and "strip" out current orientation.
rotation=`xrandr -q --verbose | grep 'connected' | egrep -o '\) (normal|left|inverted|right) \(' | egrep -o '(normal|left|inverted|right)'`
# Using current screen orientation proceed to rotate screen and input tools.
echo $rotation
case "$rotation" in
normal)
# -rotate to inverted
xrandr -o inverted
xsetwacom set "10" Rotate half
xsetwacom set "11" Rotate half
xsetwacom set "15" Rotate half
;;
right)
# -rotate to inverted
xrandr -o inverted
xsetwacom set "10" Rotate half
xsetwacom set "11" Rotate half
xsetwacom set "15" Rotate half
;;
inverted)
# -rotate to normal
xrandr -o normal
xsetwacom set "10" Rotate none
xsetwacom set "11" Rotate none
xsetwacom set "15" Rotate none
;;
esac
exit 0
and
#!/bin/sh
# Find the line in "xrandr -q --verbose" output that contains current screen orientation and "strip" out current orientation.
rotation=`xrandr -q --verbose | grep 'connected' | egrep -o '\) (normal|left|inverted|right) \(' | egrep -o '(normal|left|inverted|right)'`
# Using current screen orientation proceed to rotate screen and input tools.
echo $rotation
case "$rotation" in
normal)
# -rotate to the right
xrandr -o right
xsetwacom set "10" Rotate ccw
xsetwacom set "11" Rotate ccw
xsetwacom set "15" Rotate ccw
;;
inverted)
# -rotate to the right
xrandr -o right
xsetwacom set "10" Rotate ccw
xsetwacom set "11" Rotate ccw
xsetwacom set "15" Rotate ccw
;;
right)
# -rotate to normal
xrandr -o normal
xsetwacom set "10" Rotate none
xsetwacom set "11" Rotate none
xsetwacom set "15" Rotate none
;;
esac
exit 0
How can I resolve the issue?
0 Answers