textqr (717B)
1 #!/usr/bin/env bash 2 set -e 3 4 pgrep -x dmenu && exit 1 5 6 names="Susan\nAnders\nChristian\nJesper\nSimon\nFar\nMor\nLars" 7 recipient=$(echo -e "${names[@]}" | dmenu -i -p "To:" || exit 1) 8 9 shopt -s extglob # use extended pattern matching 10 case "$recipient" in 11 ?(\+)+([0-9])) 12 number="$recipient" 13 ;; 14 +(?)) 15 number="$(phone_numbers.sh "$recipient")" 16 ;; 17 *) 18 echo "Usage: ${0##*/} RECIPIENT MESSAGE" 19 exit 1 20 esac 21 22 keyboard-layout-switch.sh dk 23 message=$(echo "💬" | dmenu -i -p "Message:") || exit 1 24 keyboard-layout-switch.sh us 25 26 qrencode -o - -s 1 \ 27 "$number $message" | 28 feh --auto-zoom \ 29 --fullscreen \ 30 --force-aliasing \ 31 --image-bg white \ 32 -