From 67fc4451789b14fbdff3718b986ab472045e746a Mon Sep 17 00:00:00 2001 From: Maximilian Friedersdorff Date: Wed, 6 Nov 2019 08:54:54 +0000 Subject: [PATCH] Support searching for term --- states/aliases/files/aliases | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/states/aliases/files/aliases b/states/aliases/files/aliases index ff1500e..413e41e 100644 --- a/states/aliases/files/aliases +++ b/states/aliases/files/aliases @@ -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}" +} -- 2.46.2