Skip to content

Instantly share code, notes, and snippets.

@michaelfm1211
Created June 26, 2022 03:19
Show Gist options
  • Save michaelfm1211/32336940e1d27c4b2a44c9e3f665f26c to your computer and use it in GitHub Desktop.
Save michaelfm1211/32336940e1d27c4b2a44c9e3f665f26c to your computer and use it in GitHub Desktop.
scripts for use with my TOTP cli app
# helper script to the xbar plugin
# copy this somewhere meaningful, then change TOTP_COPY variable in the plugin
#!/bin/sh
/Users/michaelmcnulty/Desktop/compilers/bin/totp -r "$1" | pbcopy
#!/bin/sh
# an xbar (https://github.com/matryer/xbar) plugin for use with my TOTP cli app (https://github.com/michaelfm1211/totp)
# you need the totp-copy.sh helper script. set its path in the TOTP_COPY variable below the following metadata
# <xbar.title>totp-plugin</xbar.title>
# <xbar.version>v1.0</xbar.version>
# <xbar.author>Michael M</xbar.author>
# <xbar.author.github>michaelfm1211</xbar.author.github>
# <xbar.desc>Quickly copy a TOTP code to your pasteboard</xbar.desc>
# <xbar.dependencies>totp,totp-copy</xbar.dependencies>
# <xbar.abouturl></xbar.abouturl>
TOTP_SECRETS="$HOME/.config/totp_secrets"
TOTP_COPY="/usr/local/bin/totp-copy.sh"
echo "2fa"
echo "---"
services=$(tail -n +2 "$TOTP_SECRETS" | cut -d ":" -f 1)
for service in $services
do
echo "$service | shell=\"$TOTP_COPY\" param1=$service"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment