macOS: some scripts for Bartender 6 triggers
This commit is contained in:
15
scripte/Bartender/battery-percent.sh
Normal file
15
scripte/Bartender/battery-percent.sh
Normal 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
|
||||||
11
scripte/Bartender/cpu-usage.sh
Normal file
11
scripte/Bartender/cpu-usage.sh
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# GPL (c) 2025 by Michael Förster <mfo1009@googlemail.com>
|
||||||
|
|
||||||
|
CPU=`/opt/homebrew/bin/tmux-mem-cpu-load -g 5 | cut -d '%' -f 1 | cut -d ']' -f 2 | cut -d '.' -f 1`
|
||||||
|
RESULT=0
|
||||||
|
|
||||||
|
if [ $CPU -gt 50 ]; then
|
||||||
|
RESULT=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $RESULT
|
||||||
Reference in New Issue
Block a user