From 29888c91c0acfffa7ffa54266c53d5735843bc0c Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Mon, 12 Aug 2024 11:52:54 -0300 Subject: Added dnd and protonvpn to polybar --- .config/polybar/config | 7 ++++++- .config/polybar/dnd_status.sh | 11 +++++++++++ .config/polybar/protonvpn_status.sh | 11 +++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100755 .config/polybar/dnd_status.sh create mode 100755 .config/polybar/protonvpn_status.sh (limited to '.config') diff --git a/.config/polybar/config b/.config/polybar/config index e05f08bc..3f035d54 100644 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -35,7 +35,7 @@ font-4 = FontAwesome:size=10;0 font-5 = Noto Color Emoji:scale=12;0 modules-left = i3 music modules-center = xwindow -modules-right = pulseaudio xkeyboard cpu memory wireless-network protonvpn-status battery clock +modules-right = pulseaudio xkeyboard cpu memory wireless-network protonvpn-status dnd battery clock [module/i3] @@ -141,6 +141,11 @@ type = custom/script exec = /home/roger/.config/polybar/protonvpn_status.sh interval = 5 +[module/dnd] +type = custom/script +exec = /home/roger/.config/polybar/dnd_status.sh +interval = 1 + [module/cpu-temperature] type = internal/temperature interval = 0.5 diff --git a/.config/polybar/dnd_status.sh b/.config/polybar/dnd_status.sh new file mode 100755 index 00000000..c4e798c7 --- /dev/null +++ b/.config/polybar/dnd_status.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +STATE=$(xfconf-query -c xfce4-notifyd -p /do-not-disturb) + +if [ "$STATE" = "true" ]; then + echo "DND ✅" +else + echo "DND ❌" +fi diff --git a/.config/polybar/protonvpn_status.sh b/.config/polybar/protonvpn_status.sh new file mode 100755 index 00000000..1e2b90a4 --- /dev/null +++ b/.config/polybar/protonvpn_status.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +PROTONVPN_STATUS=$(curl -s https://am.i.mullvad.net/country) + +if echo $PROTONVPN_STATUS | grep -q 'Uruguay'; then + echo "%{u#f90000}VPN %{T5}🚫%{T-}" + else + echo "%{u#75d85a}VPN %{T5}✅%{T-}" +fi -- cgit v1.2.3