Linux: run a command any time the screen resolution or monitors change

0

I have a laptop with a touch screen. I've created a small script that binds the touch screen resolution to the screen it is attached to (based on the xinput map-to-output command).

The problem is that, while the xinput arguments use the display's name to set the touch range, the underlying configuration does not. As a result, any time I add an external monitor or remove it, the command needs to be run again.

I want to know whether there is a facility to run it automatically on resolution change.

I'm working with Ubuntu 18.04 and KDE.

Shachar Shemesh

Posted 2019-07-26T06:12:44.820

Reputation: 163

No answers