7

I have a ThinkPad X201 tablet.

On the tablet there is a button that rotates the screen. It works great in Windows but doesn't work properly in Linux; it rotates the screen but doesn't rotate the wacom (stylus and finger touching)

The keycode (from showkeys) for the button is 154.

I'd like it to do the following bash script:

#!/bin/bash

xrandr -o right
xsetwacom set "Serial Wacom Tablet stylus" Rotate CCW
xsetwacom set "Serial Wacom Tablet eraser" Rotate CCW
exit 0

I have two questions:

  1. How can assign a script to the button? (#154)
  2. How can I run this assignment on startup?

1 Answer 1

2

This is usually done via ACPI calls. First of all make sure that acpid daemon is installed and running. Then you will need to create rule for it to start your script when button is pressed. The tricky part here is to identify the button name. You can do it by running acpid daemon in foreground with debugging enabled and then press the button. If you see some messages then write down the button name and use it to write a rule that calls your custom script. Read man acpid for details.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .