Skip to content

Commit

Permalink
rofi-pass, README.md: open URLs in private window
Browse files Browse the repository at this point in the history
  • Loading branch information
moviuro committed Apr 1, 2018
1 parent eb45b86 commit 54bd85b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion rofi-pass
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,20 @@ generateQrCode() {

openURL () {
checkIfPass
$BROWSER "$(PASSWORD_STORE_DIR="${root}" pass "$selected_password" | grep "${URL_field}: " | gawk '{sub(/:/,"")}{print $2}1' | head -1)"; exit;
local url private_switch
url="$(PASSWORD_STORE_DIR="${root}" pass "$selected_password" | grep "${URL_field}: " | gawk '{sub(/:/,"")}{print $2}1' | head -1)"
if PASSWORD_STORE_DIR="${root}" pass "$selected_password" | grep -qE '^(private|incognito)$'; then
# We deal with private browsing
case "$BROWSER" in
*chrom*) private_switch="--incognito" ;;
*firefox*) private_switch="-private-window" ;;
*) # We fail hard
notify-send "can't find private switch for BROWSER $BROWSER; aborting"
exit 99 ;;
esac
fi
$BROWSER "$private_switch" "$url" &
unset url
clearUp
}

Expand Down

0 comments on commit 54bd85b

Please sign in to comment.