scripts

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 14fe34943a0b592dd19c2f635672df060762579c
parent d18415aac351b00de010c28519bb48da20a65fd5
Author: AndrewLockVI <andrew@laack.co>
Date:   Wed, 12 Feb 2025 23:58:38 -0600

Created script that makes dmenu work with pass and pass-otp (verified working on alpine)

Diffstat:
Minstall.sh | 33++++++++++++++++++++++++++++-----
Apass.sh | 38++++++++++++++++++++++++++++++++++++++
2 files changed, 66 insertions(+), 5 deletions(-)

diff --git a/install.sh b/install.sh @@ -76,16 +76,20 @@ doas apk add zathura-pdf-mupdf # unmap f # map s LinkHints.activateMode # map S LinkHints.activateModeToOpenInNewTab -# unmap b # unmap f -# unmap t -# unmap r # unmap F -# map b goBack -# map f goForward +# unmap H +# unmap L +# +# map <c-left> previousTab +# map <c-right> nextTab +# +# map <left> goBack +# map <right> goForward # map ys LinkHints.activateModeToCopyLinkUrl doas apk add firefox +doas apk add qutebrowser # LaTeX + filetype conversion # there are alternatives to full, @@ -108,10 +112,29 @@ doas apk add zip # END SCHOOL SECTION +# password manager +# - See my scripts for pass.sh which is taken from the official +# - pass repo and is an integration between pass and dmenu +# - for searching for passwords. If you user ROFI, similar +# - functions also exist. + +doas apk add gpg +doas apk add gpg-agent +doas apk add pass + +# OTPs +doas apk add pass-otp +# these two allow for scanning the QR codes and converting to +# the proper uri format for pass-otp +doas apk add imagemagick +doas apk add zbar + # screenshotting doas apk add slurp doas apk add grim +doas apk add make +doas apk add g++ # tailscale doas apk add tailscale diff --git a/pass.sh b/pass.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# for some reason this stupid +# line fixed the script. +source ~/.bashrc + +shopt -s nullglob globstar + +typeit=0 +if [[ $1 == "--type" ]]; then + typeit=1 + shift +fi + + +prefix='/home/andrew/gitRepos/passwords' +password_files=( "$prefix"/**/*.gpg ) +password_files=( "${password_files[@]#"$prefix"/}" ) +password_files=( "${password_files[@]%.gpg}" ) + + +background="#000000" +foreground="#ffffff" +highlight="#44475a" +border="#6272a4" +prompt="Open" + + +dmenu_cmd="dmenu -nb \"$background\" -nf \"$foreground\" -sb \"$highlight\" -sf \"$foreground\" -p \"$prompt\"" +password=$(printf '%s\n' "${password_files[@]}" | eval "$dmenu_cmd" "$@") + + + +# Handle otp or passwords +if [[ "$password" == *totp* ]]; then + pass otp -c "$password" +else + pass show -c "$password" +fi