repo: uritools
action: commit
revision: 
path_from: 
revision_from: 80050281a53813021abe6ee7f6d12535d1337774:
path_to: 
revision_to: 
git.thebackupbox.net
uritools
git clone git://git.thebackupbox.net/uritools
commit 80050281a53813021abe6ee7f6d12535d1337774
Author: epoch 
Date:   Wed Oct 20 22:51:31 2021 +0000

    prompt was empty if URL was short enough.

diff --git a/copy_start_nevermind.sh b/copy_start_nevermind.sh
index 3f7f7af8690126837e475ae02c3a9011fac526a7..
index ..66bf9224a9319c772076949b677f0157c1d6748e 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

-----END OF PAGE-----