commit 1d32ae7020e694158f1c6ce993b29c7eb3f45584 parent cb6eea5a3e156f0a61f2197299d0d19ea4b00441 Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Thu, 10 Jan 2019 09:53:22 +0100 Add textqr script Diffstat:
A | links/bin/textqr | | | 31 | +++++++++++++++++++++++++++++++ |
1 file changed, 31 insertions(+), 0 deletions(-)
diff --git a/links/bin/textqr b/links/bin/textqr @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -e + +pgrep -x dmenu && exit 1 + +names="Susan\nAnders\nChristian\nJesper\nSimon\nFar\nMor\nLars" +recipient=$(echo -e "${names[@]}" | dmenu -i -p "To:" || exit 1) + +shopt -s extglob # use extended pattern matching +case "$recipient" in + ?(\+)+([0-9])) + number="$recipient" + ;; + +(?)) + number="$(phone_numbers.sh "$recipient")" + *) + echo "Usage: ${0##*/} RECIPIENT MESSAGE" + exit 1 +esac + +keyboard-layout-switch.sh dk +message=$(echo "💬" | dmenu -i -p "Message:") || exit 1 +keyboard-layout-switch.sh us + +qrencode -o - -s 1 \ + "$number $message" | + feh --auto-zoom \ + --fullscreen \ + --force-aliasing \ + --image-bg white \ + -