demo / network-computer
Public
Copy of github.com/askrobots/network-computer (MIT): a desk you reach from anything. The original lives on GitHub.
GitStable demo
README: say this is a copy and where the original is
cde82c2
14 hours, 3 minutes ago
History
nc-input-hook · 723 bytes · 13 lines
| 1 | #!/bin/sh |
| 2 | # Apply the desk's keyboard layout to every keyboard on the display. |
| 3 | # nc-host runs this after creating its virtual keyboard; nc-keyboard runs it |
| 4 | # after a change. The client sends physical key positions, and X turns them |
| 5 | # into characters with this layout, so it must match the client's keyboard. |
| 6 | . /etc/nc/env 2>/dev/null || exit 0 |
| 7 | [ -n "$NC_KEYBOARD" ] || exit 0 |
| 8 | L=${NC_KEYBOARD%%:*}; V=${NC_KEYBOARD#*:}; [ "$V" = "$NC_KEYBOARD" ] && V="" |
| 9 | export DISPLAY=:0 |
| 10 | setxkbmap -layout "$L" -variant "$V" |
| 11 | for id in $(xinput list 2>/dev/null | awk '/slave keyboard/ { if (match($0, /id=[0-9]+/)) print substr($0, RSTART+3, RLENGTH-3) }'); do |
| 12 | setxkbmap -device "$id" -layout "$L" -variant "$V" 2>/dev/null || true |
| 13 | done |