xrandr event watcher
nodejs(v13 is required for building and development)
on ArchLinux, use AUR helper yay to install xrandr-watch
yay -S xrandr-watch-gitthis AUR includes a user system unit xrandr-watcher.service:
systemctl --user start xrandr-watcher.service
journalctl --user-unit=xrandr-watcher.service -f # change screen setting to see if it is workingcreate a script ~/.xrandr-changed with execution permission to perform tasks you want to run after screen changed, for example:
#!/bin/sh
xinput map-to-output "Wacom HID 4861 Finger touch" "eDP1"and restart, test and enable the service:
systemctl --user restart xrandr-watcher.service
journalctl --user-unit=xrandr-watcher.service -f # change screen setting to see if it is working
systemctl --user enable xrandr-watcher.servicePS : The PKGBUILD file and the xrandr-watcher.service are in the master branch.
xrandr-watcher path/to/handler/script [notifyMask]
path/to/handler/script should have execution permission
notifyMask is by default ScreenChange, and can be one of All, ScreenChange, CrtcChange, OutputChange, OutputProperty
git clone git@github.com:pastleo/xrandr-watcher.git
cd xrandr-watcher
makethen ./xrandr-watcher is the built executable
git clone git@github.com:pastleo/xrandr-watcher.git
cd xrandr-watcher
npm install
npm start