Created
March 10, 2021 09:33
-
-
Save maltesa/036e594466cf905548ac69efc8e6eefd to your computer and use it in GitHub Desktop.
Activate last keyboard for waybind
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Grep last keyboard (should be internal if no external is connected, and external if external is connected) | |
| target=`cat /proc/bus/input/devices | grep "kbd leds event" | tail -1 | grep -Eo "event[0-9]+"` | |
| echo "Activating Waybind for keyboard ($target)..."; | |
| sed -i -r "s|/dev/input/event[0-9]+|/dev/input/${target}|g" /etc/waybind/config.yml | |
| echo "Reloading waybind..." | |
| if systemctl restart waybind.service; then | |
| echo "Done"; | |
| else | |
| echo "Failed!" | |
| systemctl status waybind.service | |
| fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment