2023-06-27 10:13:14 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-08-13 13:39:44 -04:00
|
|
|
FILE="$HOME/.config/.on-release"
|
|
|
|
|
2023-06-27 10:13:14 -04:00
|
|
|
function run() {
|
2023-08-13 13:39:44 -04:00
|
|
|
echo "can_run" > "$FILE"
|
2023-06-27 10:13:14 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
while IFS='$\n' read -r line; do
|
2023-08-13 13:39:44 -04:00
|
|
|
if [[ $(echo "$line" | grep TOUCH_UP) != "" ]]; then
|
|
|
|
run
|
2023-08-13 15:12:49 -04:00
|
|
|
if [[ $(echo "$line" | grep '1 (1)') != "" ]]; then
|
|
|
|
eww update cancel_touch=false
|
|
|
|
fi
|
2023-08-13 13:39:44 -04:00
|
|
|
elif [[ $(echo "$line" | grep release) != "" ]]; then
|
|
|
|
run
|
|
|
|
elif [[ $(echo "$line" | grep 'TOUCH_DOWN.*1 (1)') != "" ]]; then
|
|
|
|
eww update cancel_touch=true
|
|
|
|
else
|
|
|
|
echo "other" > "$FILE"
|
|
|
|
fi
|
|
|
|
done < <(stdbuf -oL libinput debug-events)
|