Compare commits

...

4 Commits

Author SHA1 Message Date
1fbab72252 proper wayland support 2024-01-07 02:45:05 +05:00
b3a36a9f3c added wayland support 2024-01-07 02:19:56 +05:00
2ccd54fe11 systemd and vars dont work well 2024-01-07 02:09:12 +05:00
f63038e439 disable GUI 2024-01-07 02:03:05 +05:00

20
scan.sh
View File

@@ -5,17 +5,19 @@
cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1
if [[ $XDG_SESSION_TYPE != "x11" ]]; then zbarcam --nodisplay $1 | while read line; do
echo "Unsupported session type: $XDG_SESSION_TYPE"
exit 1
fi
zbarcam $1 | while read line; do
if [[ $line == *:* ]]; then if [[ $line == *:* ]]; then
code="${line#*:}" code="${line#*:}"
echo "$code" echo "$code"
xdotool type --delay 0 "$code" & mpv --quiet --no-video beep.mp3 >> /dev/null
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 fi
done done