mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-12-14 05:03:46 +01:00
add map-touch-display script
This commit is contained in:
parent
b6f17e2dc6
commit
67f1b269e7
2 changed files with 18 additions and 1 deletions
2
justfile
2
justfile
|
@ -15,7 +15,7 @@ zls-git
|
||||||
|
|
||||||
install-scripts target=(`echo $HOME` + "/.local"):
|
install-scripts target=(`echo $HOME` + "/.local"):
|
||||||
ln -sf \
|
ln -sf \
|
||||||
`pwd`/scripts/{start-joshuto,withjava,startriver} \
|
`pwd`/scripts/{map-touch-display,start-joshuto,withjava,startriver} \
|
||||||
{{target}}/bin
|
{{target}}/bin
|
||||||
|
|
||||||
cd scripts/randomwallpaper && zig build -Doptimize=ReleaseFast -p {{target}}
|
cd scripts/randomwallpaper && zig build -Doptimize=ReleaseFast -p {{target}}
|
||||||
|
|
17
scripts/map-touch-display
Executable file
17
scripts/map-touch-display
Executable file
|
@ -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)))
|
Loading…
Reference in a new issue