#!/usr/bin/env bash

DEVICE_NAME="AT Translated Set 2 keyboard"
ID=$(xinput list --id-only "$DEVICE_NAME")
is_enabled=$(xinput --list-props "$ID" | awk -F'[\t:]+' '/Device Enabled/ {print $3}')

if [[ $is_enabled == 0 ]]; then
    xinput enable $ID
    status="Enabled"
else
    xinput disable $ID
    status="Disabled"
fi

notify-send "Internal Keyboard" "$status" -i "keyboard"
