From e4581b75d2f157c724f2194002430841cb9dda16 Mon Sep 17 00:00:00 2001 From: epoch Date: Wed, 19 Jan 2022 06:47:10 +0000 Subject: made QR choice output uri too. added QR-image choice to output to a file and launch it. made shorten use gemini-handler instead of gemini-get directly --- copy_start_nevermind.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/copy_start_nevermind.sh b/copy_start_nevermind.sh index 1869dff..947d1b0 100755 --- a/copy_start_nevermind.sh +++ b/copy_start_nevermind.sh @@ -22,7 +22,7 @@ if [ "$with" != "$(urigetline -a "$uri" < <(uristart.conf))" ];then with="[multiple matches]" fi -selection="$(printf "start with: %s\nremote_csn\ncopy\nshorten\nunshorten\ntitle\nverbose\nforget\nQR\n%s\n" "${with}" "$(printf "%s\n" "$uri" | uricut | grep -v '^whole')" \ +selection="$(printf "start with: %s\nremote_csn\ncopy\nshorten\nunshorten\ntitle\nverbose\nforget\nQR-image\nQR\n%s\n" "${with}" "$(printf "%s\n" "$uri" | uricut | grep -v '^whole')" \ | choose "${prompt}")" # | choose "$(printf "uri: '%s'\nwill be ran with: %s\n" "$uri" "$(urigetline "$uri")" )" -default start )" echo "$selection" @@ -59,6 +59,7 @@ forget) start*) scheme="$(printf "%s\n" "$uri" | uricut -s)" + ### might make sense to use xwindowURI for this value if [ "$(xdotool getwindowfocus)" != 0 ];then refering_window_title="$(xdotool getwindowfocus getwindowname)" else @@ -70,7 +71,7 @@ start*) shorten) escaped="$(uriescape "$uri")" - gemini-get "gemini://epo.k.vu/submit?$escaped" | tr -d '\r' | tail -n+2 | head -n2 | tr '\n' '\0' | xargs -n1 -0 copy_start_nevermind.sh + gemini-handler "gemini://epo.k.vu/submit?$escaped" exit 0 ;; @@ -79,8 +80,15 @@ unshorten) exit 0 ;; +QR-image) + escaped="$(uriescape "$uri")" + file=~/Pictures/qr-codes/"${escaped}".png + qr "$uri" > "$file" + copy_start_nevermind.sh "file://$file" + ;; + QR) - x-terminal-emulator -hold -e qr "$uri" + x-terminal-emulator -hold -e bash -c "qr '$uri';echo 'uri: $uri'" ;; *) -- cgit v1.2.3