Compare commits
4 Commits
1851aeae89
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
1fbab72252
|
|||
|
b3a36a9f3c
|
|||
|
2ccd54fe11
|
|||
|
f63038e439
|
16
scan.sh
16
scan.sh
@@ -5,17 +5,19 @@
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1
|
||||
|
||||
if [[ $XDG_SESSION_TYPE != "x11" ]]; then
|
||||
echo "Unsupported session type: $XDG_SESSION_TYPE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
zbarcam $1 | while read line; do
|
||||
zbarcam --nodisplay $1 | while read line; do
|
||||
if [[ $line == *:* ]]; then
|
||||
code="${line#*:}"
|
||||
echo "$code"
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user