From cbb66c88a87b9fab23f803d72687fbfc2fd9f833 Mon Sep 17 00:00:00 2001 From: randomuser Date: Mon, 10 May 2021 16:55:41 -0500 Subject: [PATCH] add urlhandler --- Makefile | 1 + scripts/urlhandle | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100755 scripts/urlhandle diff --git a/Makefile b/Makefile index 181e1e0..e3f316d 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ sh: cp -f scripts/shime $(DESTDIR)$(PREFIX)/bin cp -f scripts/wall $(DESTDIR)$(PREFIX)/bin cp -f scripts/yt $(DESTDIR)$(PREFIX)/bin + cp -f scripts/urlhandle $(DESTDIR)$(PREFIX)/bin mkc: cc progs/scream.c -o progs/scream c: diff --git a/scripts/urlhandle b/scripts/urlhandle new file mode 100755 index 0000000..b8a3658 --- /dev/null +++ b/scripts/urlhandle @@ -0,0 +1,18 @@ +#!/bin/sh + +# access gemini and gopher urls within vimb with vulpes proxy + +# yes, this will result in urls like +# 'proto://host.tld/page?q="://" becoming +# 'proto/host.tld/page?q="/" +stripped_url=`printf "%s" $1 | sed 's|://|/|g'` + +# use xdotool to type the correct commands into the vimb +# window, assuming that the window is currently focused (which +# happens most of the time) +xdotool key Escape +xdotool key Escape +xdotool type "ohttp://proxy.vulpes.one/${stripped_url}" +xdotool key Return + +exit 0