Преглед изворни кода

Fix alternate password filtering

master
= пре 3 година
родитељ
комит
01d77c1903
1 измењених фајлова са 13 додато и 4 уклоњено
  1. +13
    -4
      prompt

+ 13
- 4
prompt Прегледај датотеку

@@ -135,7 +135,7 @@ notify-send -u low -t 3000 "Download complete"
download_music() {
youtube-dl --no-progress -f bestaudio -o \
"$HOME/downloads/music/%(track)s - %(artist)s.%(ext)s" "$(xclip -selection clipboard -o)"
if [ $? ]; then
if [ ! $? ]; then
youtube-dl --no-progress -f bestaudio -o \
"$HOME/downloads/music/%(title)s - %(artist)s.%(ext)s" "$(xclip -selection clipboard -o)"
fi
@@ -300,6 +300,7 @@ sel_account() {
dmenu -p 'account'
)
if [ -z "$account" ]; then exit; fi
printf "$account"
}

username() {
@@ -322,14 +323,22 @@ password() {

}

# Giving multiple accounts for the same service the same username may cause problems.
# It assumes that the password is always the first line of the account's section,
# and the username is always the second
other_password() {
account=$(sel_account)
name=$(pass show "$account" | sed -n -e "s/^username: //p" |
dmenu -p 'which user password')
dmenu -i -p 'which user password')
if [ -z "$name" ]; then exit; fi
pass show $account | sed "/^$/,/^username: $name/ { /^$/n }" | head -n1 | tr -d '\n' | xclip -selection clipboard
copy=$(pass show $account | grep -B 1 "^username: $name" | head -n1 | tr -d '\n')
printf "$copy" | xclip -selection clipboard
notify-send -u low -t 2000 "password copied" "$account: $name"
sleep 30s
new_copy=$(xclip -o -selection clipboard)
if [ "$copy" = $newcopy ]; then
printf '' | xclip -selection clipboard
fi
}

show_password() {


Loading…
Откажи
Сачувај