From b9c14ef8bd5b0441c4ed6e544d7dbd5adb12e25a Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Sat, 7 Jan 2023 19:41:47 +0100 Subject: waybar: cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert Günzler --- .config/waybar/modules/timetracked.sh | 4 ++++ .config/waybar/modules/vpn.sh | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to '.config/waybar/modules') diff --git a/.config/waybar/modules/timetracked.sh b/.config/waybar/modules/timetracked.sh index 52611a3..4e384bf 100755 --- a/.config/waybar/modules/timetracked.sh +++ b/.config/waybar/modules/timetracked.sh @@ -3,6 +3,10 @@ set -e [ -n "$DEBUG" ] && set -x +if ! command -v timetrace >/dev/null 2>&1; then + exit 0 +fi + case "$1" in on-click) timetrace status >/dev/null && timetrace stop diff --git a/.config/waybar/modules/vpn.sh b/.config/waybar/modules/vpn.sh index 4fc5bdd..c4d50fa 100755 --- a/.config/waybar/modules/vpn.sh +++ b/.config/waybar/modules/vpn.sh @@ -3,6 +3,10 @@ set -e [ -n "$DEBUG" ] && set -x +case "$1" in +toggle) exit 1 ;; +esac + extern_ip=$(curl -SsfL http://api.ipify.org/?format=text) vpn_is_up() { @@ -13,7 +17,8 @@ vpn_is_up() { } if vpn_is_up; then - printf '{"text": "󰒃 ", "tooltip": "external ip is %s"}\n' "$extern_ip" + printf '{"text": "󰒃", "tooltip": "external ip is %s"}\n' "$extern_ip" else + # printf '{"text": "󰦜", "tooltip": "disconnected"}\n' printf '{}\n' fi -- cgit 1.4.1