diff options
author | epoch <epoch@enzo.thebackupbox.net> | 2022-01-19 06:47:10 +0000 |
---|---|---|
committer | epoch <epoch@enzo.thebackupbox.net> | 2022-01-19 06:47:10 +0000 |
commit | e4581b75d2f157c724f2194002430841cb9dda16 (patch) | |
tree | 6ce5d887dce1a51defb155526d80b41200bcb549 /copy_start_nevermind.sh | |
parent | 285a0741ad4853698b4b2563fb8844b484410def (diff) | |
download | uritools-e4581b75d2f157c724f2194002430841cb9dda16.tar.gz uritools-e4581b75d2f157c724f2194002430841cb9dda16.zip |
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
Diffstat (limited to 'copy_start_nevermind.sh')
-rwxr-xr-x | copy_start_nevermind.sh | 14 |
1 files 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'" ;; *) |