From ce6be946d024aa55a15d576388d05f90be671cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Sat, 8 Oct 2022 12:40:19 +0200 Subject: Sat Oct 8 12:40:19 PM CEST 2022 --- .bin/ag-status | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to '.bin/ag-status') diff --git a/.bin/ag-status b/.bin/ag-status index 3970e54..abd2fff 100755 --- a/.bin/ag-status +++ b/.bin/ag-status @@ -6,10 +6,13 @@ __cleanup_value() { uname=$(uname) +status="" + battery="" battery_status="" time="" volume="" +vpn="" while true; do case "${uname}" in @@ -24,8 +27,9 @@ while true; do ;; Linux) battery=$(acpi -b | - cut -d " " -f 4 | - cut -d "%" -f 1) + tr -s " " "\n" | + grep "%" | + sed 's/[%,]//g') battery_status=$(acpi -a | tr -s " " | cut -d " " -f 3) @@ -33,18 +37,25 @@ while true; do __cleanup_value) if $(pamixer --get-mute); then - volume_status="__mute__" + volume="%mute" fi ;; esac - time=$(date +%Y-%m-%dT%H:%M:%S) status="VOL: ${volume}%" + vpn="" + ! wg && vpn="wireguard" + pgrep openvpn && vpn="openvpn" + if [ -n "${vpn}" ]; then + status="${status} | VPN: ${vpn}" + fi + if [ -n "${battery}" ]; then status="${status} | BATTERY ${battery}%" fi + time=$(date +%Y-%m-%dT%H:%M:%S) status="${status} | DATE: ${time}" echo "${status}" -- cgit v1.2.3