]> Sergey Matveev's repositories - dotfiles.git/commitdiff
links starter
authorSergey Matveev <stargrave@stargrave.org>
Mon, 1 May 2023 16:54:18 +0000 (19:54 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 1 May 2023 16:54:18 +0000 (19:54 +0300)
links/bin/lg [new file with mode: 0755]

diff --git a/links/bin/lg b/links/bin/lg
new file mode 100755 (executable)
index 0000000..57d4f5c
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh -e
+
+url="$@"
+if [ $# -gt 1 ] ; then
+    sel="$1"
+    shift
+    case "$sel" in
+    gg) url="https://www.google.com/search?q=$@" ;;
+    oid) url="https://oidref.com/$@" ;;
+    pep) url="https://www.python.org/dev/peps/pep-0$@/" ;;
+    py) url="https://pypi.org/project/$@/" ;;
+    rfc) url="https://datatracker.ietf.org/doc/html/rfc$@" ;;
+    s) url="https://html.duckduckgo.com/html?q=$@" ;;
+    we) url="https://en.wikipedia.org/wiki/$@" ;;
+    wr) url="https://ru.wikipedia.org/wiki/$@" ;;
+    esac
+fi
+exec links -g "$url"