macOS: some scripts for Bartender 6 triggers

This commit is contained in:
2025-12-15 21:49:19 +01:00
parent f1e3df69a8
commit f14f8fc589
2 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
#!/bin/sh
# GPL (c) 2025 by Michael Förster <mfo1009@googlemail.com>
PERCENT=`pmset -g batt | grep -Eo "\d+%" | cut -d% -f1`
RESULT=0
if [ $PERCENT -lt 21 ]; then
RESULT=1
fi
if [ $PERCENT -gt 79 ]; then
RESULT=1
fi
echo $RESULT