Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?
share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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