From ccb45c0cd3d1236cfa78522af76e8aceaa9a9d67 Mon Sep 17 00:00:00 2001 From: Derek Taylor Date: Sat, 7 Sep 2019 19:30:17 -0500 Subject: [PATCH] Added this dmenu script for using the surfraw CLI app. --- .dmenu/dmenu-surfraw.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 .dmenu/dmenu-surfraw.sh diff --git a/.dmenu/dmenu-surfraw.sh b/.dmenu/dmenu-surfraw.sh new file mode 100755 index 0000000..848d556 --- /dev/null +++ b/.dmenu/dmenu-surfraw.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# ____ _____ +# | _ \_ _| Derek Taylor (DistroTube) +# | | | || | http://www.youtube.com/c/DistroTube +# | |_| || | http://www.gitlab.com/dwt1/ +# |____/ |_| +# +# Dmenu script for launching surfaw, a command line search utility. + +cmd="dmenu -i" + +while [ -z "$engine" ]; do +engine=$(sr -elvi | gawk '{if (NR!=1) { print $1 }}' | $cmd -p "Search engine?") || exit +done + +while [ -z "$query" ]; do +query=$(echo "" | $cmd -p "Searching $engine") || exit +done + +st -e sr "$engine" "$query"