From 72dbb25419cf0e052d904144758e9fd7518322d3 Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Tue, 24 Mar 2020 09:41:17 +0100 Subject: [PATCH] Update the "add-password" script --- dotfiles/qutebrowser.org | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dotfiles/qutebrowser.org b/dotfiles/qutebrowser.org index ef04a08..abd1535 100644 --- a/dotfiles/qutebrowser.org +++ b/dotfiles/qutebrowser.org @@ -311,14 +311,17 @@ See Amazon price history using CamelCamelCamel #+begin_src bash url=$(echo "$QUTE_URL" | awk -F[/:] '{print $4}' | rofi -p "URL" -dmenu -lines 1) - username=$(echo "dehaeze.thomas@gmail.com\nthomas.dehaeze@esrf.fr\ntdehaeze" | rofi -p "Username" -dmenu -lines 5) + username=$(echo -e "dehaeze.thomas@gmail.com\nthomas.dehaeze@esrf.fr\ntdehaeze" | rofi -p "Username" -dmenu -lines 5) password=$(rofi -p "Password" -dmenu -password -lines 1) - echo "$password\nlogin: $username\nurl: $QUTE_URL" > /tmp/add-password.txt - - pass insert --multiline "$url/$username" < /tmp/add-password.txt - - rm /tmp/add-password.txt + if [ -z "$url" ] || [ -z "$username" ] || [ -z "$password" ]; then + dunstify "Pass" "Failed to Add Password" + else + echo -e "$password\nlogin: $username\nurl: $QUTE_URL" > /tmp/add-password.txt + pass insert --multiline "$url/$username" < /tmp/add-password.txt; + rm /tmp/add-password.txt + dunstify "Pass" "Password Added" + fi #+end_src ** Cast Youtube to Chromecast