From 28e8bdf7f8286bd431b7f3b709e79f3827b31469 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Wed, 24 Dec 2025 13:54:03 +0900 Subject: updates --- debian/.local/bin/passmenu2 | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 debian/.local/bin/passmenu2 (limited to 'debian/.local/bin/passmenu2') diff --git a/debian/.local/bin/passmenu2 b/debian/.local/bin/passmenu2 new file mode 100755 index 0000000..00a6b35 --- /dev/null +++ b/debian/.local/bin/passmenu2 @@ -0,0 +1,38 @@ +#!/bin/bash + +shopt -s nullglob globstar + +typeit=0 +if [[ $1 == "--type" ]]; then + typeit=1 + shift +fi + +if [[ -n $WAYLAND_DISPLAY ]]; then + dmenu_cmd="dmenu-wl -l 20" + xdotool="ydotool type --file -" +elif [[ -n $DISPLAY ]]; then + dmenu_cmd="dmenu -l 20" + xdotool="xdotool type --clearmodifiers --file -" +else + echo "Error: No Wayland or X11 display detected" >&2 + exit 1 +fi + +prefix=${PASSWORD_STORE_DIR-~/.password-store} +password_files=("$prefix"/**/*.gpg) +password_files=("${password_files[@]#"$prefix"/}") +password_files=("${password_files[@]%.gpg}") + +password=$(printf '%s\n' "${password_files[@]}" | $dmenu_cmd "$@") + +[[ -n $password ]] || exit + +if [[ $typeit -eq 0 ]]; then + pass show -c "$password" 2>/dev/null +else + pass show "$password" | { + IFS= read -r pass + printf %s "$pass" + } | $xdotool +fi -- cgit v1.2.3