summaryrefslogtreecommitdiffstats
path: root/.bin/ag-status
diff options
context:
space:
mode:
Diffstat (limited to '.bin/ag-status')
-rwxr-xr-x.bin/ag-status19
1 files changed, 15 insertions, 4 deletions
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}"
remember that computers suck.