Facebook
From asdasd, 1 Month ago, written in Plain Text.
This paste is a reply to Untitled from deli9cate - view diff
Embed
Download Paste or View Raw
Hits: 137
  1. #!/bin/bash
  2.  
  3. while true; do
  4.     # Check if the keyboard is enabled or disabled using xinput
  5.     status=$(xinput list-props "AT Translated Set 2 keyboard" | grep "Device Enabled" | awk '{print $4}')
  6.  
  7.     # Convert status to human-readable form
  8.     if [ "$status" -eq 1 ]; then
  9.         echo "AT Translated Set 2 keyboard is enabled"
  10.     else
  11.         echo "AT Translated Set 2 keyboard is disabled"
  12.     fi
  13.  
  14.     # Sleep for 2 seconds
  15.     sleep 2
  16. done
  17.