dotfiles/scripts/map-touch-display

18 lines
551 B
Text
Raw Normal View History

2023-02-12 23:03:29 +01:00
#!/usr/bin/env racket
#lang racket
;; This script is used to map the xinput device(s) of my external touch
;; display to the correspondung X screen.
(define screen
(vector-ref (current-command-line-arguments) 0))
(define output
(with-output-to-string
(λ () (system* (find-executable-path "xinput") "--list"))))
(for ([line (string-split output "\n")])
(when (string-contains? line "TSTP MTouch")
(match-define (list _ id) (regexp-match #px"id=(\\d+)" line))
(system* (find-executable-path "xinput") "map-to-output" id screen)))