Como posso ligar um atalho de teclado no meu tablet Thoinkpad X220?

1

Eu tenho uma nova instalação do Ubuntu Trusty 14.04 no meu Lenovo Thinkpad X220T (ou X220 Tablet).

Eu configurei dois scripts para melhorar a rotação da tela e gostaria de vinculá-los a um atalho de teclado.

Basicamente, adicionei essas linhas em /etc/rc.local :

setkeycodes 67 202 # Launch3
setkeycodes 6c 149 # Launch2

para vincular o segundo e o terceiro botão na borda da tela aos botões "Lauch2" e "Launch3".

Depois,tentoadicionarumatalhopersonalizadoaosmeusscripts,masnadaacontece.

Porfavor,notequeseeuligarosscriptsaumatalhodeteclado,comoctrl+alt+B,elesfuncionam.

Osscriptssãoosseguintes:

#!/bin/sh#Findthelinein"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

e

#!/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

Como posso resolver o problema?

    
por leonard vertighel 24.04.2014 / 10:40

0 respostas