From cb7fb95e6a3881df29e41b2dbab8464276639044 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 19 Jan 2019 15:00:35 +0100 Subject: [PATCH] Add click actions for github and wifi Signed-off-by: Knut Ahlers --- .config/i3blocks/github | 3 +++ .config/i3blocks/wifi | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.config/i3blocks/github b/.config/i3blocks/github index 00e4fc6..410b2ca 100755 --- a/.config/i3blocks/github +++ b/.config/i3blocks/github @@ -1,6 +1,9 @@ #!/bin/bash set -euo pipefail +# In case we got a click, open the notifications page +[ -n "${BLOCK_BUTTON}" ] && xdg-open "https://github.com/notifications" >/dev/null 2>&1 + [ -f ${HOME}/.config/i3blocks/.env ] && source ${HOME}/.config/i3blocks/.env # Get token from vault diff --git a/.config/i3blocks/wifi b/.config/i3blocks/wifi index 3e01f7a..6013735 100755 --- a/.config/i3blocks/wifi +++ b/.config/i3blocks/wifi @@ -17,3 +17,6 @@ network=$(iwgetid -r) [ -z "${network}" ] && exit printf "\uf9a1 %s (%s)" ${network} ${ip} + +# On click copy IP +[ -n "${BLOCK_BUTTON}" ] && echo -n "${ip}" | tr -d '\n' | xclip -selection c