diff --git a/justfile b/justfile index 1fd4184..4b99917 100644 --- a/justfile +++ b/justfile @@ -15,7 +15,7 @@ zls-git install-scripts target=(`echo $HOME` + "/.local"): ln -sf \ - `pwd`/scripts/{start-joshuto,withjava,startriver} \ + `pwd`/scripts/{map-touch-display,start-joshuto,withjava,startriver} \ {{target}}/bin cd scripts/randomwallpaper && zig build -Doptimize=ReleaseFast -p {{target}} diff --git a/scripts/map-touch-display b/scripts/map-touch-display new file mode 100755 index 0000000..f6a1bb9 --- /dev/null +++ b/scripts/map-touch-display @@ -0,0 +1,17 @@ +#!/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)))