commit f5720876449c083528635b92aa8e16e941d002dc parent 6d31bfdf97c470cb36006170a69b6d8cf57fb43f Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Wed, 19 Feb 2020 09:43:14 +0100 Fix https links, use plumb instead of $BROWSER Diffstat:
M | .local/bin/websearch | | | 16 | ++++++++-------- |
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/.local/bin/websearch b/.local/bin/websearch @@ -13,17 +13,17 @@ fi # Detect if url case "$choice" in - http://*|https://) - $BROWSER "$(printf '%s' "$choice" | awk '{print $1}')" + http://*|https://*) + plumb "$(printf '%s' "$choice" | awk '{print $1}')" ;; *!scholar*) - $BROWSER "https://scholar.google.com/scholar?q=$(printf '%s' "$choice" | sed 's/!scholar//')" + plumb "https://scholar.google.com/scholar?q=$(printf '%s' "$choice" | sed 's/!scholar//')" ;; *!map*) - $BROWSER "https://www.openstreetmap.org/search?query=$(printf '%s' "$choice" | sed 's/!map//')" + plumb "https://www.openstreetmap.org/search?query=$(printf '%s' "$choice" | sed 's/!map//')" ;; *!wiki*) - $BROWSER "https://en.wikipedia.org/wiki/Special:Search?search=$(printf '%s' "$choice" | sed 's/!wiki//')" + plumb "https://en.wikipedia.org/wiki/Special:Search?search=$(printf '%s' "$choice" | sed 's/!wiki//')" ;; *!yt*) idiotbox="$HOME/code/idiotbox" @@ -32,14 +32,14 @@ case "$choice" in QUERY_STRING="q=$(printf '%s' "$choice" | sed "s/!yt//" | tr ' ' '+')" \ "$idiotbox/cgi" > "$tmpfile" cp -r "$idiotbox/css" /tmp - $BROWSER "$tmpfile" + plumb "$tmpfile" sleep 5 rm "$tmpfile" else - $BROWSER "https://codemadness.org/idiotbox/?q=$(printf '%s' "$choice" | sed 's/!yt//')&o=relevance&m=Dark" + plumb "https://codemadness.org/idiotbox/?q=$(printf '%s' "$choice" | sed 's/!yt//')&o=relevance&m=Dark" fi ;; *) - $BROWSER "https://duckduckgo.com/?q=$(printf '%s' "$choice" | sed 's/+/%2b/g')&kae=d&kau=-1&kao=-1&kap=-1&kaq=-1&kax=-1&kak=-1&kv=-1&kk=-1&k1=-1&kc=-1" + plumb "https://duckduckgo.com/?q=$(printf '%s' "$choice" | sed 's/+/%2b/g')&kae=d&kau=-1&kao=-1&kap=-1&kaq=-1&kax=-1&kak=-1&kv=-1&kk=-1&k1=-1&kc=-1" ;; esac