commit 1b2a86f0e0e029f68d2597a5e7f8becba85cb362
parent 4e0501e956702dff07f023673a34482f727e37ff
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Sat, 10 Apr 2021 16:52:16 -0700
Replace vimb(1) with links(1)
- Add the www script which is a wrapper around links(1) to pass
arguments. It uses graphical links(1) rather than vimb(1) as vimb
requires monsters like webkit and gtk3
- Add the urls and xurls scripts to replace vimb(1) shortcuts
- Add the xgrab script to copy stdin into both the primary selection
and clipboard
- Set BROWSER to www
Diffstat:
8 files changed, 59 insertions(+), 3 deletions(-)
diff --git a/local/Makefile b/local/Makefile
@@ -13,6 +13,7 @@ MODULES =\
shell\
sxiv\
tmux\
+ urls\
vi\
vimb\
whois\
diff --git a/local/bin/.local/bin/urls b/local/bin/.local/bin/urls
@@ -0,0 +1,24 @@
+#!/bin/ksh -eu
+# Copyright 2021 Jacob R. Edwards
+# License: GPLv3
+#
+# urls -- url shortcut
+
+set -o pipefail
+
+s="$1"
+
+get() {
+ grep -m1 "^$s " <"${XDG_CONFIG_HOME:-$HOME/.config}/urls" | cut -f2
+}
+
+insert() (
+ query=$(echo $* | sed -e 's/ /%20/g' -e 's_/_\\/_g')
+ sed "s/%/$query/g"
+)
+
+shift
+get "$s" | insert "$@" || {
+ printf 'urls: %s: Shortcut not found.\n' "$s" 1>&2
+ exit 1
+}
diff --git a/local/bin/.local/bin/www b/local/bin/.local/bin/www
@@ -0,0 +1,7 @@
+#!/bin/sh
+# Copyright 2021 Jacob R. Edwards
+# License: GPLv3
+#
+# www -- browse the world wide web
+
+exec links -g "$@"
diff --git a/local/bin/.local/bin/xgrab b/local/bin/.local/bin/xgrab
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+# Copyright 2021 Jacob R. Edwards
+# License: GPLv3
+#
+# xgrab -- copy input into X buffer
+
+xclip
+xclip -out | xclip -selection clipboard
diff --git a/local/bin/.local/bin/xurls b/local/bin/.local/bin/xurls
@@ -0,0 +1,10 @@
+#!/bin/ksh
+# Copyright 2021 Jacob R. Edwards
+# License: GPLv3
+#
+# xurls -- X11 url shortcut
+
+set -o pipefail
+
+dmenu -p url "$@" </dev/null | xargs urls | xgrab ||
+ herbe 'xurls error' &
diff --git a/local/profile/.profile b/local/profile/.profile
@@ -4,7 +4,7 @@
ulimit -Sc 0
# defaults
-export BROWSER=vimb
+export BROWSER=www
export CC=pcc
export EDITOR=vi
export LOCKER=slock
diff --git a/local/shell/.local/share/shell/simple b/local/shell/.local/share/shell/simple
@@ -5,10 +5,8 @@ curl() command curl -sS "$@"
date() command date "${@:-+%F %T %z}"
doas() command doas -- "$@"
dsu() doas su "$@"
-dump() grab -out "$@"
esed() sed -E "$@"
fn() functions "$@"
-grab() xclip -selection clipboard "$@"
grep() egrep "$@"
ls() 9 ls "$@"
md() mkdir "$@"
diff --git a/local/urls/.config/urls b/local/urls/.config/urls
@@ -0,0 +1,8 @@
+aw https://wiki.archlinux.org/index.php?search=%
+ebay https://www.ebay.com/sch/i.html?_nkw=%&_sop=15
+hw https://handwiki.org/wiki/index.php?search=%
+ia https://archive.org/search.php?query=%
+s https://searx.be/?q=%&categories=general&language=en-US
+sb https://searx.bar/?q=%&catagories=general&language=en-US
+sl http://searx.lukesmith.xyz/?q=%&catagories=general&language=en-US
+w https://en.wikipedia.org/w/index.php?search=%