proper wayland support

This commit is contained in:
Shihaam Abdul Rahman 2024-01-07 02:45:05 +05:00
parent b3a36a9f3c
commit 1fbab72252
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636

12
scan.sh
View File

@ -9,7 +9,15 @@ zbarcam --nodisplay $1 | while read line; do
if [[ $line == *:* ]]; then
code="${line#*:}"
echo "$code"
wtype "$code" & xdotool type --delay 0 "$code" & mpv --quiet --no-video beep.mp3 >> /dev/null
wtype $'\n' & xdotool key Return
if ls /run/user/$(id -u)/wayland-*.lock > /dev/null 2>&1
then
wtype "$code" & mpv --quiet --no-video beep.mp3 >> /dev/null
wtype $'\n'
else
xdotool type --delay 0 "$code" & mpv --quiet --no-video beep.mp3 >> /dev/null
xdotool key Return
fi
fi
done