summaryrefslogtreecommitdiffstats
path: root/.bin/ag-status
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2022-10-08 12:40:19 +0200
committerRomain Gonçalves <me@rgoncalves.se>2022-10-08 12:40:19 +0200
commitce6be946d024aa55a15d576388d05f90be671cf2 (patch)
treefa1053446a3fb06daee8438c1ff664cb36c0abcb /.bin/ag-status
parent703ed1915c69911a95cab6e1fb6524629c976800 (diff)
downloaddots-ce6be946d024aa55a15d576388d05f90be671cf2.tar.gz
Sat Oct 8 12:40:19 PM CEST 2022
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.