]> git.friedersdorff.com Git - max/saltfiles.git/commitdiff
Support searching for term
authorMaximilian Friedersdorff <max@friedersdorff.com>
Wed, 6 Nov 2019 08:54:54 +0000 (08:54 +0000)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Wed, 6 Nov 2019 08:54:54 +0000 (08:54 +0000)
states/aliases/files/aliases

index ff1500e753bd7863cf5577c7617dde1e4beb4fff..413e41ed25d7e05f6862d3b3eb1a30f10efda110 100644 (file)
@@ -47,4 +47,7 @@ function ssh_in() {
     ssh -O exit -S \"$control_file\" \"$1\"" 
 }
 
-alias search='w3m duckduckgo.com'
+function search() {
+        quoted=$(python -c "import urllib.parse, sys; print(urllib.parse.quote_plus(' '.join(sys.argv[1:])))" "${@}")
+        w3m "https://duckduckgo.com/?q=${quoted}"
+}