From 92145b54c7701eeb69242a0b084af3c1ee94be92 Mon Sep 17 00:00:00 2001 From: "flyingscorpio@arch-desktop" Date: Sat, 5 Dec 2020 23:54:37 +0100 Subject: [PATCH] Add whois-firefox, opens whois result in osm.org --- dotfiles/shell/aliases | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dotfiles/shell/aliases b/dotfiles/shell/aliases index e29ef3b..cbf951a 100644 --- a/dotfiles/shell/aliases +++ b/dotfiles/shell/aliases @@ -119,3 +119,11 @@ calc() { echo -n "$* = " python -c "print($*)" } + +whois-firefox() { + mkfifo pipe; cat pipe & + coords=$(whois "$1" | tee pipe | grep geoloc | sed -r 's/^geoloc:\s+//' | sort | uniq) + slash_coords=${coords// /\/} + firefox "https://osm.org/search?query=$coords#map=16/$slash_coords" + rm pipe +}