m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/platform
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform')
-rw-r--r--src/platform/darwin.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/platform/darwin.sh b/src/platform/darwin.sh
index 7b028f3..86eb325 100644
--- a/src/platform/darwin.sh
+++ b/src/platform/darwin.sh
@@ -31,5 +31,17 @@ tmpdir() {
mount -t hfs -o noatime -o nobrowse "$DARWIN_RAMDISK_DEV" "$SECURE_TMPDIR" || die "Error: could not mount filesystem on ramdisk."
}
+qrcode() {
+ if type imgcat >/dev/null 2>&1; then
+ echo -n "$1" | qrencode --size 10 -o - | imgcat
+ elif type gm >/dev/null 2>&1; then
+ echo -n "$1" | qrencode --size 10 -o - | gm display -title "pass: $2" -geometry +200+200 -
+ elif type display >/dev/null 2>&1; then
+ echo -n "$1" | qrencode --size 10 -o - | display -title "pass: $2" -geometry +200+200 -
+ else
+ echo -n "$1" | qrencode -t utf8
+ fi
+}
+
GETOPT="$(brew --prefix gnu-getopt 2>/dev/null || { which port &>/dev/null && echo /opt/local; } || echo /usr/local)/bin/getopt"
SHRED="srm -f -z"