forked from liquidprompt/liquidprompt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pmset-simulator
48 lines (45 loc) · 1.03 KB
/
pmset-simulator
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Simulator for "pmset -g batt" for testing the implementation of
# battery display on MacOS X
pmset()
{
case "$pmset_sim" in
iMac|no-battery)
# https://github.com/nojhan/liquidprompt/issues/315
cat <<EOF
Now drawing from 'AC Power'
EOF
;;
attached)
# https://github.com/nojhan/liquidprompt/issues/326#issuecomment-66120495
cat <<'EOF'
Now drawing from 'AC Power'
-InternalBattery-0 37%; AC attached; not charging
EOF
;;
charging)
# https://github.com/nojhan/liquidprompt/issues/326
cat <<'EOF'
Now drawing from 'AC Power'
-InternalBattery-0 8%; charging; 2:46 remaining
EOF
;;
discharging)
# https://github.com/nojhan/liquidprompt/issues/326
cat <<'EOF'
Now drawing from 'Battery Power'
-InternalBattery-0 9%; discharging; (no estimate)
EOF
;;
warning-Early)
# https://github.com/nojhan/liquidprompt/issues/326
cat <<'EOF'
Now drawing from 'Battery Power'
-InternalBattery-0 7%; discharging; 0:13 remaining
Battery Warning: Early
EOF
;;
*)
echo "unsupported '$pmset_sim' pmset simulation"
;;
esac
}