mirror of
https://github.com/kmein/niveum
synced 2026-03-18 11:01:07 +01:00
configure niri
This commit is contained in:
18
packages/passmenu.nix
Normal file
18
packages/passmenu.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ writers, wofi, pass, libnotify, ... }:
|
||||
writers.writeBashBin "passmenu" ''
|
||||
shopt -s nullglob globstar
|
||||
|
||||
IFS=$'\n'
|
||||
|
||||
prefix=$(readlink -f $${PASSWORD_STORE_DIR-~/.password-store})
|
||||
password_files=( $( fd -L ".gpg\$" "$prefix" ) )
|
||||
password_files=( "$${password_files[@]#"$prefix"/}" )
|
||||
password_files=( "$${password_files[@]%.gpg}" )
|
||||
|
||||
password=$( printf '%s\n' "$${password_files[@]}" | ${wofi}/bin/wofi -i -k /dev/null -d menu -- "$@" )
|
||||
|
||||
[[ -n $password ]] || exit
|
||||
|
||||
OUT=$(${pass}/bin/pass show --clip "$password")
|
||||
${libnotify}/bin/notify-send -t 5000 "$(echo "$OUT" | grep '^login:' | sed 's/^login: //')"
|
||||
''
|
||||
Reference in New Issue
Block a user