~smlavine/scripts

991da6688e31656cf58722ac900f1331146ce39d — Sebastian LaVine 2 months ago faf7d65
src/mypassmenu: Undocument weight file comments

I didn't use them anyway.
1 files changed, 1 insertions(+), 2 deletions(-)

M src/mypassmenu
M src/mypassmenu => src/mypassmenu +1 -2
@@ 20,7 20,7 @@ passdir="${PASSWORD_STORE_DIR-~/.password-store}"
# File containing all expected password entries and their respective weights.
# Expected format (fields separated by tabs):
# logins/sr.ht/smlavine	59
# logins/aur.archlinux.org/smlavine	4	comment about this line
# logins/aur.archlinux.org/smlavine	4
# logins/github.com/smlavine	0
weights="${MYPASSMENU_WEIGHTS-$XDG_DATA_HOME/mypassmenu.tsv}"



@@ 53,6 53,5 @@ pw="$(sort -rnk 2 "$weights" | cut -f1 | dmenu -i -c -fn 20 -sb '#b00' -l 30)"
pass show -c "$pw"

# Increment the weight of the password chosen.
# FIXME: deletes any comments after the weight amount
awk '$1 == "'"$pw"'" { print $1 "\t" $2+1; next } { print $0 }' "$weights" |
	sponge "$weights"