This commit is contained in:
tavo-wasd 2024-05-03 14:15:16 -06:00
parent 8a4fc10e9f
commit 1b32e0e6b8
4 changed files with 55 additions and 1 deletions

View file

@ -1,5 +1,8 @@
#!/bin/sh
# Ref: http://info2html.sourceforge.net/cgi-bin/info2html-demo/info2html?%28pinentry%29Protocol
#
# $ printf 'pinentry-program /home/tavo/.config/scripts/anypinentry' > ~/.gnupg/gpg-agent.conf
# $ gpg-agent reload
set -e

View file

@ -1,6 +1,9 @@
#!/bin/sh
VDIR="$HOME/.local/share/contacts"
STDIN="$(cat)"
[ -n "$STDIN" ] && printf '%s' "$STDIN" > "$VDIR/temp-contact.vcf"
QUERY="$(grep -r '^FN:' "$VDIR" | sed 's/.*://' | tr -d '\r' | menu "Contact:")"
[ -z "$QUERY" ] && exit 0
FILE="$(grep -r "^FN:$QUERY" "$VDIR" | cut -d ':' -f 1)"

49
scripts/qr-scan Executable file
View file

@ -0,0 +1,49 @@
#!/bin/sh
FILE="$1"
qr_code () {
[ -n "$1" ] &&
ZBARCMD="zbarimg -q $1" ||
ZBARCMD="zbarcam -q"
$ZBARCMD | while read line ; do
printf '%s\n' "$line"
check="${line#*:}" ; check="${check%%:*}"
case "$check" in
"BEGIN") multiline=1 ;;
"VCARD") multiline= ;;
esac
[ "$multiline" != 1 ] &&
pkill zbarcam &&
return 0
done
}
QRCODE="$(qr_code "$FILE" 2>/dev/null)"
QRCODE="${QRCODE#*:}"
QRTYPE="${QRCODE%%:*}"
case "$QRTYPE" in
"http"|"https"|"gopher"|"gemini"|"ftp"|"ftps"|"sftp"|"ssh"|"git"|"www"|"magnet"|"xmpp"|"mailto"|"nc")
printf '%s\n' "$QRCODE"
printf '%s' "$QRCODE" | xsel -ib
break ;;
"WIFI")
SSID="${QRCODE##*S:}" ; SSID="${SSID%%;[A-Za-z]:*}"
PASSW="${QRCODE##*P:}" ; PASSW="${PASSW%%;[A-Za-z]:*}"
wpa_passphrase "$SSID" "$PASSW"
break ;;
"BEGIN")
printf '%s\n' "$QRCODE"
printf '%s' "$QRCODE" | contact
break ;;
*)
printf '%s\n' "$QRCODE"
break ;;
esac

View file

@ -29,7 +29,6 @@ alias \
# Command shortcuts
alias \
claws-mail='HOME="$XDG_DATA_HOME"/claws-mail && mkdir -p "$HOME" && claws-mail' \
mgr-all="mgr pacman_upgrade apt_upgrade flatpak_update distrobox_update pip_update configs passmgr" \
df-short="df -h | grep -v '\s/dev.*$\|\s/run.*$\|\s/boot.*$'" \
wacom-setup-menu="wacom-setup menu" \