summaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
authorRoger Gonzalez <roger@rogs.me>2024-08-12 11:52:54 -0300
committerRoger Gonzalez <roger@rogs.me>2024-08-12 11:52:54 -0300
commit29888c91c0acfffa7ffa54266c53d5735843bc0c (patch)
treeb8bee05f8928f6f96db743a861b6b7bdd84d8092 /.config
parent1ed5dbf4d1855cab45d5b2b79ff5d6b110ed0271 (diff)
Added dnd and protonvpn to polybar
Diffstat (limited to '.config')
-rw-r--r--.config/polybar/config7
-rwxr-xr-x.config/polybar/dnd_status.sh11
-rwxr-xr-x.config/polybar/protonvpn_status.sh11
3 files changed, 28 insertions, 1 deletions
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