From 3a379c6211bd2d3179bad609901a701e14cd4520 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 5 Aug 2023 00:16:20 +0300 Subject: [PATCH] we --- config/dwm/scripts/bar.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/dwm/scripts/bar.sh b/config/dwm/scripts/bar.sh index 9d1fcc56..badb43db 100755 --- a/config/dwm/scripts/bar.sh +++ b/config/dwm/scripts/bar.sh @@ -15,6 +15,8 @@ cpu() { printf "^c$white^ ^b$grey^ $cpu_val" } +alias notify-send="sudo -u sako DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send" + battery() { get_capacity="$(cat /sys/class/power_supply/BAT1/capacity)" get_status="$(cat /sys/class/power_supply/BAT1/status)" @@ -22,10 +24,8 @@ battery() { Charging) printf "^c$blue^ 󰂄 $get_capacity" ;; Discharging) if (( $get_capacity <= 20)); then printf "^c$lightred^ 󰂃 $get_capacity" - if [ [$sent_notification = false] ]; then - sudo -u sako \ - DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus \ - notify-send -u critical "Battery low" "Please charge battery" + if [ "$sent_notification" = false ]; then + notify-send -u critical "test" sent_notification=true fi else