From 29d4bbae7b6f9f01508f568b4e294fe21fb9f12e Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 11:53:27 +0100 Subject: [PATCH] i3b/iface: add clipboard insertion of IPs on click --- .config/i3/blocks/iface | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.config/i3/blocks/iface b/.config/i3/blocks/iface index 4b49830..f597580 100755 --- a/.config/i3/blocks/iface +++ b/.config/i3/blocks/iface @@ -51,6 +51,10 @@ LOCIP=$(ip addr show $IF | perl -n -e "/$AF ([^\/]+).* scope global/ && print \$ #------------------------------------------------------------------------ case $BLOCK_BUTTON in - 1) curl -s https://api.ipify.org;; - *) echo "$LOCIP";; + 1) curl -s https://api.ipify.org; + break;; + 2) curl -s https://api.ipify.org | tee >(xclip -i); + break;; + *) echo "$LOCIP" | tee >(xclip -i); + break;; esac