Add ability to read search string from stdin
[khome.git] / home / lib / login_functions.sh
index 59989af..3ea0e1d 100644 (file)
@@ -1,5 +1,22 @@
 #
 
+## ws: web search
+ws() {
+    local line search_string0 search_string
+
+    search_string0="$*"
+    case "$search_string0" in
+        '')
+            while read -r line; do
+                search_string="${search_string} ${line}"
+            done;;
+         *)
+            search_string="$search_string0";;
+    esac
+
+    firefox --search "$search_string"
+}
+
 d() {
     local -r word=$(fzf < /usr/share/dict/words)
     dict "$word"
This page took 0.027635 seconds and 4 git commands to generate.