From ef8045b0eaf7389f9ee860843064a6787c8a8e77 Mon Sep 17 00:00:00 2001 From: Mirko König Date: Tue, 11 May 2021 17:00:28 +0200 Subject: : Added userscript to handle 1password --- misc/userscripts/qute-1pass | 127 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100755 misc/userscripts/qute-1pass diff --git a/misc/userscripts/qute-1pass b/misc/userscripts/qute-1pass new file mode 100755 index 000000000..014fdc44d --- /dev/null +++ b/misc/userscripts/qute-1pass @@ -0,0 +1,127 @@ +#!/usr/bin/env bash + +# Copyright 2021 Mirko König +# Based on 1password script for MacOs from https://github.com/tomoakley +# https://github.com/tomoakley/dotfiles/blob/master/qutebrowser/userscripts/1password +# +# This file is part of qutebrowser. +# +# qutebrowser is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published bjy +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# qutebrowser is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with qutebrowser. If not, see . + +set -e + +# JS field injection code from https://github.com/qutebrowser/qutebrowser/blob/master/misc/userscripts/password_fill +javascript_escape() { + # print the first argument in an escaped way, such that it can safely + # be used within javascripts double quotes + # shellcheck disable=SC2001 + sed "s,[\\\\'\"],\\\\&,g" <<< "$1" +} + +js() { +cat < 0 && elem.offsetHeight > 0; + }; + function hasPasswordField(form) { + var inputs = form.getElementsByTagName("input"); + for (var j = 0; j < inputs.length; j++) { + var input = inputs[j]; + if (input.type == "password") { + return true; + } + } + return false; + }; + function loadData2Form (form) { + var inputs = form.getElementsByTagName("input"); + for (var j = 0; j < inputs.length; j++) { + var input = inputs[j]; + if (isVisible(input) && (input.type == "text" || input.type == "email")) { + input.focus(); + input.value = "$(javascript_escape "${USERNAME}")"; + input.dispatchEvent(new Event('change')); + input.blur(); + } + if (input.type == "password") { + input.focus(); + input.value = "$(javascript_escape "${PASSWORD}")"; + input.dispatchEvent(new Event('change')); + input.blur(); + } + } + }; + var forms = document.getElementsByTagName("form"); + for (i = 0; i < forms.length; i++) { + if (hasPasswordField(forms[i])) { + loadData2Form(forms[i]); + } + } +EOF +} + +URL=$(echo "$QUTE_URL" | awk -F/ '{print $3}' | sed 's/www.//g') +echo "message-info 'Looking for password for $URL...'" >> $QUTE_FIFO + +TOKEN=$(rofi -dmenu -password -p "1password: "| op signin --output=raw) || TOKEN="" + +if [ -n "$TOKEN" ]; then + UUID_URL=$(op list items --cache --session="$TOKEN" | jq -r '.[] | "\(.uuid):\(.overview.url)"' | grep "$URL") || UUID_URL="" + + if [ -z "$UUID_URL" ];then + $(echo "message-error 'No entry found for $URL'" >> $QUTE_FIFO) + TITLE=$(op list items --cache --session="$TOKEN" | jq -r '.[].overview.title' | rofi -dmenu -i) || TITLE="" + echo "$TITLE"|xclip -in -selection clipboard + if [ -n "$TITLE" ]; then + UUID_URL=$(op list items --cache --session="$TOKEN" | jq -r '.[] | "\(.uuid):\(.overview.title)"' | grep "$TITLE") || UUID_URL="" + else + UUID_URL="" + fi + fi + + if [ -n "$UUID_URL" ];then + IFS=: read -r UUID var2 <<< "$UUID_URL" + ITEM=$(op get item --cache --session="$TOKEN" "$UUID") + + PASSWORD=$(echo "$ITEM" | jq -r '.details.fields | .[] | select(.designation=="password") | .value') + + if [ -n "$PASSWORD" ]; then + TITLE=$(echo "$ITEM" | jq -r '.overview.title') + USERNAME=$(echo "$ITEM" | jq -r '.details.fields | .[] | select(.designation=="username") | .value') + + printjs() { + js | sed 's,//.*$,,' | tr '\n' ' ' + } + echo "jseval -q $(printjs)" >> "$QUTE_FIFO" + + TOTP=$(echo "$ITEM" | op get totp --cache --session="$TOKEN" "$UUID") || TOTP="" + if [ -n "$TOTP" ]; then + echo "$TOTP" | xclip -in -selection clipboard + notify-send "One time password for $TITLE: $TOTP in clipboard" -a "Qutebrowser 1Password" + fi + else + notify-send "No password found for $URL" -a "Qutebrowser 1Password" + fi + else + $(echo "message-error 'Entry not found for $UUID_URL'" >> $QUTE_FIFO) + fi +else + $(echo "message-error 'Wrong master password'" >> $QUTE_FIFO) +fi -- cgit v1.2.3-54-g00ecf From 13eeb90b8f0a7c4be68d229d0b5c2b92430ef389 Mon Sep 17 00:00:00 2001 From: Mirko König Date: Fri, 14 May 2021 12:05:46 +0200 Subject: Removed surrounding $() resolve CI warnings. --- misc/userscripts/qute-1pass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/userscripts/qute-1pass b/misc/userscripts/qute-1pass index 014fdc44d..27fe1282e 100755 --- a/misc/userscripts/qute-1pass +++ b/misc/userscripts/qute-1pass @@ -86,7 +86,7 @@ if [ -n "$TOKEN" ]; then UUID_URL=$(op list items --cache --session="$TOKEN" | jq -r '.[] | "\(.uuid):\(.overview.url)"' | grep "$URL") || UUID_URL="" if [ -z "$UUID_URL" ];then - $(echo "message-error 'No entry found for $URL'" >> $QUTE_FIFO) + echo "message-error 'No entry found for $URL'" >> $QUTE_FIFO TITLE=$(op list items --cache --session="$TOKEN" | jq -r '.[].overview.title' | rofi -dmenu -i) || TITLE="" echo "$TITLE"|xclip -in -selection clipboard if [ -n "$TITLE" ]; then @@ -120,8 +120,8 @@ if [ -n "$TOKEN" ]; then notify-send "No password found for $URL" -a "Qutebrowser 1Password" fi else - $(echo "message-error 'Entry not found for $UUID_URL'" >> $QUTE_FIFO) + echo "message-error 'Entry not found for $UUID_URL'" >> $QUTE_FIFO fi else - $(echo "message-error 'Wrong master password'" >> $QUTE_FIFO) + echo "message-error 'Wrong master password'" >> $QUTE_FIFO fi -- cgit v1.2.3-54-g00ecf From 235b0ba5394e21922d275691c0971611f8f99098 Mon Sep 17 00:00:00 2001 From: Mirko König Date: Mon, 31 May 2021 08:41:07 +0200 Subject: : Multiple url per login are considered. --- misc/userscripts/qute-1pass | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/misc/userscripts/qute-1pass b/misc/userscripts/qute-1pass index 27fe1282e..4cce900a1 100755 --- a/misc/userscripts/qute-1pass +++ b/misc/userscripts/qute-1pass @@ -1,24 +1,5 @@ #!/usr/bin/env bash -# Copyright 2021 Mirko König -# Based on 1password script for MacOs from https://github.com/tomoakley -# https://github.com/tomoakley/dotfiles/blob/master/qutebrowser/userscripts/1password -# -# This file is part of qutebrowser. -# -# qutebrowser is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published bjy -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# qutebrowser is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with qutebrowser. If not, see . - set -e # JS field injection code from https://github.com/qutebrowser/qutebrowser/blob/master/misc/userscripts/password_fill @@ -83,10 +64,11 @@ echo "message-info 'Looking for password for $URL...'" >> $QUTE_FIFO TOKEN=$(rofi -dmenu -password -p "1password: "| op signin --output=raw) || TOKEN="" if [ -n "$TOKEN" ]; then - UUID_URL=$(op list items --cache --session="$TOKEN" | jq -r '.[] | "\(.uuid):\(.overview.url)"' | grep "$URL") || UUID_URL="" + #UUID_URL=$(op list items --cache --session="$TOKEN" | jq -r '.[] | "\(.uuid):\(.overview.url)"' | grep "$URL") || UUID_URL="" + UUID_URL=$(op list items --cache --session="$TOKEN" | jq -r '.[] | {uuid, url: [.overview.URLs[]?.u, .overview.url][]?}| "\(.uuid):\(.url)"' | grep "$URL") || UUID_URL="" if [ -z "$UUID_URL" ];then - echo "message-error 'No entry found for $URL'" >> $QUTE_FIFO + $(echo "message-error 'No entry found for $URL'" >> $QUTE_FIFO) TITLE=$(op list items --cache --session="$TOKEN" | jq -r '.[].overview.title' | rofi -dmenu -i) || TITLE="" echo "$TITLE"|xclip -in -selection clipboard if [ -n "$TITLE" ]; then @@ -120,8 +102,8 @@ if [ -n "$TOKEN" ]; then notify-send "No password found for $URL" -a "Qutebrowser 1Password" fi else - echo "message-error 'Entry not found for $UUID_URL'" >> $QUTE_FIFO + $(echo "message-error 'Entry not found for $UUID_URL'" >> $QUTE_FIFO) fi else - echo "message-error 'Wrong master password'" >> $QUTE_FIFO + $(echo "message-error 'Wrong master password'" >> $QUTE_FIFO) fi -- cgit v1.2.3-54-g00ecf From d2e2c8a8b3bb2875574ee19a4564db7380f41b71 Mon Sep 17 00:00:00 2001 From: Mirko König Date: Thu, 10 Jun 2021 09:39:48 +0200 Subject: Removed old line that was commented. --- misc/userscripts/qute-1pass | 1 - 1 file changed, 1 deletion(-) diff --git a/misc/userscripts/qute-1pass b/misc/userscripts/qute-1pass index 4cce900a1..237a0a03a 100755 --- a/misc/userscripts/qute-1pass +++ b/misc/userscripts/qute-1pass @@ -64,7 +64,6 @@ echo "message-info 'Looking for password for $URL...'" >> $QUTE_FIFO TOKEN=$(rofi -dmenu -password -p "1password: "| op signin --output=raw) || TOKEN="" if [ -n "$TOKEN" ]; then - #UUID_URL=$(op list items --cache --session="$TOKEN" | jq -r '.[] | "\(.uuid):\(.overview.url)"' | grep "$URL") || UUID_URL="" UUID_URL=$(op list items --cache --session="$TOKEN" | jq -r '.[] | {uuid, url: [.overview.URLs[]?.u, .overview.url][]?}| "\(.uuid):\(.url)"' | grep "$URL") || UUID_URL="" if [ -z "$UUID_URL" ];then -- cgit v1.2.3-54-g00ecf From 468401eecc6f54cf9b1deeb1fbccc0b0a79c45c9 Mon Sep 17 00:00:00 2001 From: Mirko König Date: Thu, 17 Jun 2021 14:14:57 +0200 Subject: : Fixed some issues reported by the CI checks. Some change in jq query. --- misc/userscripts/qute-1pass | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/misc/userscripts/qute-1pass b/misc/userscripts/qute-1pass index 237a0a03a..c142c024b 100755 --- a/misc/userscripts/qute-1pass +++ b/misc/userscripts/qute-1pass @@ -59,26 +59,26 @@ EOF } URL=$(echo "$QUTE_URL" | awk -F/ '{print $3}' | sed 's/www.//g') -echo "message-info 'Looking for password for $URL...'" >> $QUTE_FIFO +echo "message-info 'Looking for password for $URL...'" >> "$QUTE_FIFO" TOKEN=$(rofi -dmenu -password -p "1password: "| op signin --output=raw) || TOKEN="" if [ -n "$TOKEN" ]; then - UUID_URL=$(op list items --cache --session="$TOKEN" | jq -r '.[] | {uuid, url: [.overview.URLs[]?.u, .overview.url][]?}| "\(.uuid):\(.url)"' | grep "$URL") || UUID_URL="" + UUID=$(op list items --cache --session="$TOKEN" | jq --arg url "$URL" -r '[.[] | {uuid, url: [.overview.URLs[]?.u, .overview.url][]?} | select(.uuid != null) | select(.url != null) | select(.url|test(".*\($url).*"))][.0].uuid') || UUID="" - if [ -z "$UUID_URL" ];then - $(echo "message-error 'No entry found for $URL'" >> $QUTE_FIFO) + if [ -z "$UUID" ];then + echo "message-error 'No entry found for $URL'" >> "$QUTE_FIFO" TITLE=$(op list items --cache --session="$TOKEN" | jq -r '.[].overview.title' | rofi -dmenu -i) || TITLE="" echo "$TITLE"|xclip -in -selection clipboard if [ -n "$TITLE" ]; then - UUID_URL=$(op list items --cache --session="$TOKEN" | jq -r '.[] | "\(.uuid):\(.overview.title)"' | grep "$TITLE") || UUID_URL="" + UUID=$(op list items --cache --session="$TOKEN" | jq -r '.[] | "\(.uuid):\(.overview.title)"' | grep "$TITLE") || UUID="" else - UUID_URL="" + UUID="" fi fi - if [ -n "$UUID_URL" ];then - IFS=: read -r UUID var2 <<< "$UUID_URL" + if [ -n "$UUID" ];then + #IFS=: read -r UUID var2 <<< "$UUID" ITEM=$(op get item --cache --session="$TOKEN" "$UUID") PASSWORD=$(echo "$ITEM" | jq -r '.details.fields | .[] | select(.designation=="password") | .value') @@ -95,14 +95,14 @@ if [ -n "$TOKEN" ]; then TOTP=$(echo "$ITEM" | op get totp --cache --session="$TOKEN" "$UUID") || TOTP="" if [ -n "$TOTP" ]; then echo "$TOTP" | xclip -in -selection clipboard - notify-send "One time password for $TITLE: $TOTP in clipboard" -a "Qutebrowser 1Password" + echo "message-info 'Pasted one time password for $TITLE to clipboard'" >> "$QUTE_FIFO" fi else - notify-send "No password found for $URL" -a "Qutebrowser 1Password" + echo "message-error 'No password found for $URL'" >> "$QUTE_FIFO" fi else - $(echo "message-error 'Entry not found for $UUID_URL'" >> $QUTE_FIFO) + echo "message-error 'Entry not found for $UUID'" >> "$QUTE_FIFO" fi else - $(echo "message-error 'Wrong master password'" >> $QUTE_FIFO) + echo "message-error 'Wrong master password'" >> "$QUTE_FIFO" fi -- cgit v1.2.3-54-g00ecf From 8653a1d37d76aff2a5faf39d9923aa186c502b61 Mon Sep 17 00:00:00 2001 From: Mirko König Date: Fri, 18 Jun 2021 14:03:51 +0200 Subject: : Added qute-1pass to README. --- misc/userscripts/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/userscripts/README.md b/misc/userscripts/README.md index 395797805..2e7d5cd74 100644 --- a/misc/userscripts/README.md +++ b/misc/userscripts/README.md @@ -23,6 +23,7 @@ The following userscripts are included in the current directory. dmenu-compatible application (e.g. dmenu, rofi -dmenu, ...). - [qute-lastpass](./qute-lastpass): Similar to qute-pass, for Lastpass. - [qute-bitwarden](./qute-bitwarden): Similar to qute-pass, for Bitwarden. +- [qute-1pass](./qute-1pass): Insert login information using onepassword and rofi. - [qutedmenu](./qutedmenu): Handle open -s && open -t with bemenu. - [readability](./readability): Executes python-readability on current page and opens the summary as new tab. -- cgit v1.2.3-54-g00ecf From 7f2e3bcd4a2ecc90b642992bd672f8bc704c5ff0 Mon Sep 17 00:00:00 2001 From: Mirko König Date: Mon, 9 Aug 2021 10:44:26 +0200 Subject: Listing all possible entries when website could not be found is fixed. --- misc/userscripts/qute-1pass | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/misc/userscripts/qute-1pass b/misc/userscripts/qute-1pass index c142c024b..7d6c4fb72 100755 --- a/misc/userscripts/qute-1pass +++ b/misc/userscripts/qute-1pass @@ -66,19 +66,17 @@ TOKEN=$(rofi -dmenu -password -p "1password: "| op signin --output=raw) || TOKEN if [ -n "$TOKEN" ]; then UUID=$(op list items --cache --session="$TOKEN" | jq --arg url "$URL" -r '[.[] | {uuid, url: [.overview.URLs[]?.u, .overview.url][]?} | select(.uuid != null) | select(.url != null) | select(.url|test(".*\($url).*"))][.0].uuid') || UUID="" - if [ -z "$UUID" ];then + if [ -z "$UUID" ] || [ $UUID == "null" ];then echo "message-error 'No entry found for $URL'" >> "$QUTE_FIFO" TITLE=$(op list items --cache --session="$TOKEN" | jq -r '.[].overview.title' | rofi -dmenu -i) || TITLE="" - echo "$TITLE"|xclip -in -selection clipboard if [ -n "$TITLE" ]; then - UUID=$(op list items --cache --session="$TOKEN" | jq -r '.[] | "\(.uuid):\(.overview.title)"' | grep "$TITLE") || UUID="" + UUID=$(op list items --cache --session="$TOKEN" | jq --arg title "$TITLE" -r '[.[] | {uuid, title:.overview.title}|select(.title|test("\($title)"))][.0].uuid') || UUID="" else UUID="" fi fi if [ -n "$UUID" ];then - #IFS=: read -r UUID var2 <<< "$UUID" ITEM=$(op get item --cache --session="$TOKEN" "$UUID") PASSWORD=$(echo "$ITEM" | jq -r '.details.fields | .[] | select(.designation=="password") | .value') -- cgit v1.2.3-54-g00ecf From 1ad1771e6474429d590bd79ac29d121f20750132 Mon Sep 17 00:00:00 2001 From: Mirko König Date: Mon, 6 Sep 2021 07:08:58 +0200 Subject: : Added double quotes to fix error reported by shellcheck. --- misc/userscripts/qute-1pass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/userscripts/qute-1pass b/misc/userscripts/qute-1pass index 7d6c4fb72..52562db21 100755 --- a/misc/userscripts/qute-1pass +++ b/misc/userscripts/qute-1pass @@ -66,7 +66,7 @@ TOKEN=$(rofi -dmenu -password -p "1password: "| op signin --output=raw) || TOKEN if [ -n "$TOKEN" ]; then UUID=$(op list items --cache --session="$TOKEN" | jq --arg url "$URL" -r '[.[] | {uuid, url: [.overview.URLs[]?.u, .overview.url][]?} | select(.uuid != null) | select(.url != null) | select(.url|test(".*\($url).*"))][.0].uuid') || UUID="" - if [ -z "$UUID" ] || [ $UUID == "null" ];then + if [ -z "$UUID" ] || [ "$UUID" == "null" ];then echo "message-error 'No entry found for $URL'" >> "$QUTE_FIFO" TITLE=$(op list items --cache --session="$TOKEN" | jq -r '.[].overview.title' | rofi -dmenu -i) || TITLE="" if [ -n "$TITLE" ]; then -- cgit v1.2.3-54-g00ecf From b5815e61133eabacdadfad8750b201ee9b0dc6bc Mon Sep 17 00:00:00 2001 From: Mirko König Date: Tue, 14 Sep 2021 08:22:33 +0200 Subject: Prevent pasting secrets to the wrong page. --- misc/userscripts/qute-1pass | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/misc/userscripts/qute-1pass b/misc/userscripts/qute-1pass index 52562db21..de1975d70 100755 --- a/misc/userscripts/qute-1pass +++ b/misc/userscripts/qute-1pass @@ -7,7 +7,7 @@ javascript_escape() { # print the first argument in an escaped way, such that it can safely # be used within javascripts double quotes # shellcheck disable=SC2001 - sed "s,[\\\\'\"],\\\\&,g" <<< "$1" + sed "s,[\\\\'\"\/],\\\\&,g" <<< "$1" } js() { @@ -50,10 +50,14 @@ cat < Date: Fri, 8 Oct 2021 19:49:19 +0200 Subject: Added token handling to make use of the cache. --- misc/userscripts/qute-1pass | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/misc/userscripts/qute-1pass b/misc/userscripts/qute-1pass index de1975d70..c6afa9f77 100755 --- a/misc/userscripts/qute-1pass +++ b/misc/userscripts/qute-1pass @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set +e # JS field injection code from https://github.com/qutebrowser/qutebrowser/blob/master/misc/userscripts/password_fill javascript_escape() { @@ -65,7 +65,17 @@ EOF URL=$(echo "$QUTE_URL" | awk -F/ '{print $3}' | sed 's/www.//g') echo "message-info 'Looking for password for $URL...'" >> "$QUTE_FIFO" -TOKEN=$(rofi -dmenu -password -p "1password: "| op signin --output=raw) || TOKEN="" +if [ -f "$HOME/tmp/1pass.token" ]; then + TOKEN=$(cat "$HOME/tmp/1pass.token") + if ! op signin --session="$TOKEN" --output=raw > /dev/null; then + TOKEN=$(rofi -dmenu -password -p "1password: "| op signin --output=raw) || TOKEN="" + echo "$TOKEN" > "$HOME/tmp/1pass.token" + fi +else + TOKEN=$(rofi -dmenu -password -p "1password: "| op signin --output=raw) || TOKEN="" + echo "$TOKEN" > "$HOME/tmp/1pass.token" +fi + if [ -n "$TOKEN" ]; then UUID=$(op list items --cache --session="$TOKEN" | jq --arg url "$URL" -r '[.[] | {uuid, url: [.overview.URLs[]?.u, .overview.url][]?} | select(.uuid != null) | select(.url != null) | select(.url|test(".*\($url).*"))][.0].uuid') || UUID="" -- cgit v1.2.3-54-g00ecf From cf9ad69a045a3c327a32e30111d38cb070d809c5 Mon Sep 17 00:00:00 2001 From: Mirko König Date: Mon, 1 Nov 2021 12:13:53 +0100 Subject: Token is stored with read write permissions for user only. --- misc/userscripts/qute-1pass | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/misc/userscripts/qute-1pass b/misc/userscripts/qute-1pass index c6afa9f77..83c9690bc 100755 --- a/misc/userscripts/qute-1pass +++ b/misc/userscripts/qute-1pass @@ -63,17 +63,21 @@ EOF } URL=$(echo "$QUTE_URL" | awk -F/ '{print $3}' | sed 's/www.//g') +TOKEN_TMPDIR="${TMPDIR:-/tmp}" +TOKEN_CACHE="$TOKEN_TMPDIR/1pass.token" + echo "message-info 'Looking for password for $URL...'" >> "$QUTE_FIFO" -if [ -f "$HOME/tmp/1pass.token" ]; then - TOKEN=$(cat "$HOME/tmp/1pass.token") +if [ -f "$TOKEN_CACHE" ]; then + TOKEN=$(cat "$TOKEN_CACHE") if ! op signin --session="$TOKEN" --output=raw > /dev/null; then TOKEN=$(rofi -dmenu -password -p "1password: "| op signin --output=raw) || TOKEN="" - echo "$TOKEN" > "$HOME/tmp/1pass.token" + echo "$TOKEN" > "$TOKEN_CACHE" fi else TOKEN=$(rofi -dmenu -password -p "1password: "| op signin --output=raw) || TOKEN="" - echo "$TOKEN" > "$HOME/tmp/1pass.token" + install -m 600 /dev/null $TOKEN_CACHE + echo "$TOKEN" > "$TOKEN_CACHE" fi -- cgit v1.2.3-54-g00ecf From 13c6134e12ba3b46320506c3fb4fd5fa643a111d Mon Sep 17 00:00:00 2001 From: Mirko König Date: Mon, 1 Nov 2021 12:17:37 +0100 Subject: Fixed shellcheck issue --- misc/userscripts/qute-1pass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/userscripts/qute-1pass b/misc/userscripts/qute-1pass index 83c9690bc..091f841fc 100755 --- a/misc/userscripts/qute-1pass +++ b/misc/userscripts/qute-1pass @@ -76,7 +76,7 @@ if [ -f "$TOKEN_CACHE" ]; then fi else TOKEN=$(rofi -dmenu -password -p "1password: "| op signin --output=raw) || TOKEN="" - install -m 600 /dev/null $TOKEN_CACHE + install -m 600 /dev/null "$TOKEN_CACHE" echo "$TOKEN" > "$TOKEN_CACHE" fi -- cgit v1.2.3-54-g00ecf