bin:zoom-links: Only copy if browser opened

Do not overwrite the link in the clipboard if nothing opened.
This commit is contained in:
2021-04-19 18:17:36 +02:00
parent b71e768d1c
commit 987cabb841

View File

@@ -23,5 +23,5 @@ echo "$1" | grep -Eq "^https://tu-berlin.zoom.us/(j|wc/join)/[0-9]*\?pwd=.+" ||
link="$(echo "${1%?pwd=*}" | sed 's_/j/_/wc/join/_')"
# Open link in private browser
firefox --no-remote -P zoom --private-window "$link" >/dev/null 2>&1 &
# Put password in clipboard
echo -n "${1##*pwd=}" | xclip -selection c
# Put password in clipboard if successful
(( $? )) || echo -n "${1##*pwd=}" | xclip -selection c