aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.config/yadm/bootstrap4
l---------.local/share/pass-extensions/dupes.bash1
-rwxr-xr-x.local/share/pass-extensions/duplicates.bash46
-rw-r--r--.profile3
4 files changed, 54 insertions, 0 deletions
diff --git a/.config/yadm/bootstrap b/.config/yadm/bootstrap
index 349476d..f1e3267 100755
--- a/.config/yadm/bootstrap
+++ b/.config/yadm/bootstrap
@@ -59,6 +59,10 @@ begintask "create XDG user directories"
s xdg-user-dirs-update
endtask
+# TODO: GTK themes
+# TODO: OpenZone_Black cursor theme
+# TODO: install from scratch and see what's missing
+
cat << EOF
bootstrap finished in $(finishtime)!
diff --git a/.local/share/pass-extensions/dupes.bash b/.local/share/pass-extensions/dupes.bash
new file mode 120000
index 0000000..4bbc733
--- /dev/null
+++ b/.local/share/pass-extensions/dupes.bash
@@ -0,0 +1 @@
+duplicates.bash \ No newline at end of file
diff --git a/.local/share/pass-extensions/duplicates.bash b/.local/share/pass-extensions/duplicates.bash
new file mode 100755
index 0000000..57fdbe0
--- /dev/null
+++ b/.local/share/pass-extensions/duplicates.bash
@@ -0,0 +1,46 @@
+#!/bin/bash
+cd "${PASSWORD_STORE_DIR-$HOME/.password-store}" || exit 1
+
+declare -A dupe_tally dupe_map
+
+pass_names="$(\
+ find . -type d -name '.git' -prune -o -name '*.gpg' -type f -print |\
+ cut -c3- | rev | cut -c5- | rev)"
+
+pass_count="$(echo "$pass_names" | wc -l)"
+if [ "$pass_count" -gt 10 ] ; then
+ cat << EOF >&2
+pass-duplicates needs to decrypt all your passwords one-by-one to cross-match
+them. This is all done in-memory, and nothing is saved to disk. You appear to
+have $pass_count passwords, so this may take some time...
+
+EOF
+fi
+
+while read pass_name ; do
+ hash="$(pass show "$pass_name" | head -n1 | sha1sum | cut -c1-40)"
+
+ dupe_map["$pass_name"]="$hash"
+ dupe_tally["$hash"]=$(( ${dupe_tally["$hash"]} + 1 ))
+done < <(echo "$pass_names")
+
+duplicates=0
+
+for talley_key in "${!dupe_tally[@]}" ; do
+ [ "${dupe_tally["$talley_key"]}" -le 1 ] && continue;
+ duplicates=$(( $duplicates + 1 ))
+
+ echo "same password:"
+ for pass_name in "${!dupe_map[@]}" ; do
+ [ "${dupe_map["$pass_name"]}" != "$talley_key" ] && continue;
+ echo "- $pass_name"
+ done
+ echo
+done
+
+echo "summary:"
+if [ $duplicates -eq 0 ] ; then
+ echo "- no duplicates"
+else
+ echo "- found $duplicates password(s) that were used more than once"
+fi
diff --git a/.profile b/.profile
index 3e91f2a..83f2477 100644
--- a/.profile
+++ b/.profile
@@ -46,6 +46,7 @@ export COLORTERM="truecolor"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
+export XDG_STATE_HOME="$HOME/.local/state"
# script locations
export PATH="$HOME/.local/share/bin:$PATH"
@@ -61,6 +62,8 @@ export FZF_DEFAULT_COMMAND="find ."
export FZF_DEFAULT_OPTS="--color=16"
export GOPATH="$HOME/.local/go"
[ -e "$XDG_CONFIG_HOME/gtk-4.0/env" ] && . "$XDG_CONFIG_HOME/gtk-4.0/env"
+export PASSWORD_STORE_ENABLE_EXTENSIONS=true
+export PASSWORD_STORE_EXTENSIONS_DIR="$XDG_DATA_HOME/pass-extensions"
# use .config/ instead of home directory
export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android"