From d02ebebe68b84b6996bcf7e9e76fdabf0d69e47a Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Wed, 28 Sep 2022 19:35:32 +0200 Subject: waybar: add hotspots module --- .config/waybar/modules/hotspots.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 .config/waybar/modules/hotspots.sh (limited to '.config/waybar/modules/hotspots.sh') diff --git a/.config/waybar/modules/hotspots.sh b/.config/waybar/modules/hotspots.sh new file mode 100755 index 0000000..fe2ff65 --- /dev/null +++ b/.config/waybar/modules/hotspots.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -e + +case "$1" in +click) + uri=$(hspl -u) + xdg-open "http://$uri" + ;; +*) + output=$(hspl || echo "none") + if [ "$output" != "none" ]; then + jq -nc \ + --arg text "󱛄 $(head -n1 <<<"$output")" \ + --arg tooltip "$(tail -n+2 <<<"$output")" \ + --arg class "$(if [ "$(hspl -d)" -lt 100 ]; then echo "soon"; else echo ""; fi)" \ + '{text:$text,tooltip:$tooltip,class:$class}' + else + jq -nc '{}' + fi + ;; +esac -- cgit 1.4.1