This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/scripts/bin/enable-laptop-keyboard
2017-04-24 08:29:32 -05:00

9 lines
428 B
Bash
Executable file

#!/usr/bin/env bash
KEYBOARD_PARENT_SEARCH_STRING="Virtual core keyboard.*master keyboard"
PARENT_KEYBOARD_ID=$(xinput list | grep "$KEYBOARD_PARENT_SEARCH_STRING" | sed -ne 's/^.*id\=\([0-9]*\).*/\1/p')
KEYBOARD_SEARCH_STRING="AT Translated.*keyboard"
BUILTIN_KEYBOARD_ID=$(xinput list | grep "$KEYBOARD_SEARCH_STRING" | sed -ne 's/^.*id\=\([0-9]*\).*/\1/p')
sudo xinput reattach "$BUILTIN_KEYBOARD_ID" "$PARENT_KEYBOARD_ID"