Skip to content

Commit 7fc6066

Browse files
authored
Merge pull request #35 from mdrocan/simple_looping_for_charge_checks
simplified looping
2 parents a453cca + c37519e commit 7fc6066

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

charging_level.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ osascript -e 'display notification "Battery is discharging currently." with titl
1616

1717
if [ "$batterylevel" -lt 30 ]; then
1818
notification30
19+
if [ "$charge_state" = "discharging" ] || [ "$charge_state2" = "AC attached; not charging present: true" ]; then
20+
charge_state_inactive
21+
else
22+
exit 0
23+
fi
1924
else
20-
exit 0
21-
fi
22-
23-
if [ "$charge_state" = "discharging" ] || [ "$charge_state2" = "AC attached; not charging present: true" ]; then
24-
charge_state_inactive
25-
else
26-
exit 0
25+
:
2726
fi

0 commit comments

Comments
 (0)