1
0
Fork 0
This commit is contained in:
Arthur K. 2025-11-11 00:41:42 +03:00
parent 7e5d880156
commit d93f63cf82
40 changed files with 448 additions and 649 deletions

View file

@ -42,7 +42,7 @@ for battery_path in /sys/class/power_supply/!(AC*); do
status_symbol="${custom_icons["$device_name"]}"
elif [ "$capacity" -eq 100 ]; then
status_symbol=" "
elif [[ "$status" = "Discharging" && "$capacity" -le 20 ]]; then
elif [ "$status" = "Discharging" ] && [ "$capacity" -le 20 ]; then
status_symbol="❗"
[ -n "$sep" ] && sep="" || sep=" ";
fi

1
.local/bin/statusbar/sb-silent Executable file
View file

@ -0,0 +1 @@
dunstctl is-paused -e && echo ''

View file

@ -5,26 +5,33 @@
exit 0
}
PIPE="/var/run/vpnd.sock"
send_cmd() {
[ -p $PIPE ] && echo "$@" > $PIPE && \
cat < $PIPE
PIPE="/var/run/vpnd.sock"
[ -p $PIPE ] && echo "$@" > $PIPE && cat < $PIPE
}
IFNAME="$(send_cmd status)"
router_status() {
ssh -i "$HOME"/.ssh/id_watcher router vpn status laptop 2>/dev/null
}
case "$IFNAME" in
"msk") IFNAME="Moscow";;
"rix") IFNAME="Riga";;
case "$(ip link | grep 'awg_' | cut -d ' ' -f2 | tr -d ':' | sed 's,awg_,,')" in
"int") IFNAME="󰻌 Saint-Petersburg";;
"ext") IFNAME="󰦝 Riga";;
esac
if [ -n "$IFNAME" ]; then
echo "󰦝 $IFNAME"
[ -n "$IFNAME" ] && {
echo "$IFNAME"
exit 0
fi
}
DEFAULT_LINK="$(resolvectl status | grep 'Default Route: yes' -B10 | grep 'Link' | tail -1 | grep -Eo '\(.*\)' | tr -d '()')"
DEFAULT_LINK="$(
resolvectl status | \
grep 'Default Route: yes' -B10 | \
grep 'Link' | \
tail -1 | \
grep -Eo '\(.*\)' | \
tr -d '()'
)"
if resolvectl domain "$DEFAULT_LINK" | grep -q 'wzray.com'; then
[ "$(ssh router vpn status laptop 2>/dev/null)" = '1' ] && echo "󰦝 Local"
fi
resolvectl domain "$DEFAULT_LINK" | grep -q 'wzray.com' && \
[ "$(router_status)" = '1' ] && echo "󰦝"