diff options
author | epoch <epoch@hack.thebackupbox.net> | 2021-10-30 00:27:43 +0000 |
---|---|---|
committer | epoch <epoch@hack.thebackupbox.net> | 2021-10-30 00:27:43 +0000 |
commit | 3c5cd5e68278f82cc071623419e1a205c6fee38b (patch) | |
tree | 72d8dc4493e399d7ea6cc094826e527ef9e4c564 /copy_start_nevermind.sh | |
parent | 62817acef7618bd5d6e77ffabb39aabe33f5a37c (diff) | |
parent | c38649558142ee7a02c176f373120f417633b022 (diff) | |
download | uritools-3c5cd5e68278f82cc071623419e1a205c6fee38b.tar.gz uritools-3c5cd5e68278f82cc071623419e1a205c6fee38b.zip |
Merge branch 'master' of ssh://git.thebackupbox.net/uritools
Diffstat (limited to 'copy_start_nevermind.sh')
-rwxr-xr-x | copy_start_nevermind.sh | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/copy_start_nevermind.sh b/copy_start_nevermind.sh index 3f7f7af..66bf922 100755 --- a/copy_start_nevermind.sh +++ b/copy_start_nevermind.sh @@ -1,16 +1,35 @@ #!/bin/bash [ "$1" ] || exit 1 uri="$1" + +queryfiltereduri="$(uriqueryfilter "$uri")" +if [ "$uri" != "$queryfiltereduri" ];then + trackeruri="$uri" + uri="$queryfiltereduri" +fi + +### this clipping should be part of choose probably if [ "${uri}" != "${uri:0:64}" ];then prompt="${uri:0:64}..." +else + prompt="${uri}" fi + scheme="$(uricut -s <<< "$uri")" -selection="$(printf "start with: %s\ncopy\nshorten\nverbose\nforget\nQR\n%s\n" "$(urigetline "$uri")" "$(printf "%s\n" "$uri" | uricut | grep -v '^whole')" \ +selection="$(printf "start with: %s\nremote_csn\ncopy\nshorten\nunshorten\ntitle\nverbose\nforget\nQR\n%s\n" "$(urigetline "$uri")" "$(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" case "$selection" in +remote_csn) + remote_host="$(choose "remote host to run URI on> " < ~/.config/urirhosts.conf)" + ### TODO: include in the list our own display either to use -X or use our IP and display number? + display="$(ssh "${remote_host}" myXdisplays | choose "which display?")" + uristart "ssh://${remote_host}/copy_start_nevermind.sh%20${uri}?DISPLAY=$display" + exit 0 + ;; + verbose) x-terminal-emulator -e less -f <(printf "%s" "$uri") exit 0 @@ -21,6 +40,11 @@ copy) exit 0 ;; +title) + copy_start_nevermind.sh "$(urititle "$uri")" + exit 0 + ;; + forget) cp ~/.cache/uristart.log ~/.cache/uristart.log.tmp cat ~/.cache/uristart.log.tmp | grep -vFw "${uri}" > ~/.cache/uristart.log @@ -44,11 +68,18 @@ shorten) exit 0 ;; +unshorten) + copy_start_nevermind.sh "$(unshorten.sh "$uri")" + exit 0 + ;; + QR) x-terminal-emulator -hold -e qr "$uri" ;; *) - exec printf "%s" "$selection" | cut '-d ' -f2- | xclip -i + if [ "$selection" ];then + exec printf "%s" "$selection" | cut '-d ' -f2- | xclip -i + fi ;; esac |