summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorepoch <epoch@enzo.thebackupbox.net>2021-10-25 07:47:59 +0000
committerepoch <epoch@enzo.thebackupbox.net>2021-10-25 07:47:59 +0000
commit34181aafcfbfeb434d5ff0ebe4bf1d368ac4936c (patch)
tree7db565fef21fadb22cdd8b6fea1fb73e6f9f44e6
parenta847f39dc51ba0bf5acd61648946e88a06a57e2c (diff)
downloaduritools-34181aafcfbfeb434d5ff0ebe4bf1d368ac4936c.tar.gz
uritools-34181aafcfbfeb434d5ff0ebe4bf1d368ac4936c.zip
added a program to act as a generic "search" key-combo handler. just launches a search URI at the end.
-rwxr-xr-xsearch6
1 files changed, 5 insertions, 1 deletions
diff --git a/search b/search
index 1c2e67c..7c8c77a 100755
--- a/search
+++ b/search
@@ -1,2 +1,6 @@
#!/bin/sh
-uristart "search:?q=$(echo | dmenu -p 'search>' | tr '\n' '\0' | xargs -0 uriescape | sed 's/&/%26/g;s/#/%23/g')"
+q="$(printf "%s\n%s\n" "$(xclip -o | head -n1)" "$(xclip -o -selection clipboard | head -n1)" | choose 'search>' | tr '\n' '\0' | xargs -0 uriescape | sed 's/&/%26/g;s/#/%23/g')"
+if [ ! "$q" ];then
+ exit 1
+fi
+exec uristart "search:?q=$q"