mirror of
https://github.com/actuallymentor/battery.git
synced 2026-09-17 17:02:24 +01:00
🐛 disable maintenance if manual command is called
This commit is contained in:
11
battery.sh
11
battery.sh
@@ -170,6 +170,9 @@ if [[ "$action" == "charging" ]]; then
|
||||
|
||||
log "Setting $action to $setting"
|
||||
|
||||
# Disable running daemon
|
||||
battery maintain stop
|
||||
|
||||
# Set charging to on and off
|
||||
if [[ "$setting" == "on" ]]; then
|
||||
enable_charging
|
||||
@@ -184,6 +187,9 @@ fi
|
||||
# Charging on/off controller
|
||||
if [[ "$action" == "charge" ]]; then
|
||||
|
||||
# Disable running daemon
|
||||
battery maintain stop
|
||||
|
||||
# Start charging
|
||||
battery_percentage=$( get_battery_percentage )
|
||||
log "Charging to $setting% from $battery_percentage%"
|
||||
@@ -282,6 +288,8 @@ if [[ "$action" == "maintain" ]]; then
|
||||
|
||||
# Enable the daemon that continues maintaining after reboot
|
||||
battery create_daemon
|
||||
|
||||
exit 0
|
||||
|
||||
fi
|
||||
|
||||
@@ -328,11 +336,14 @@ if [[ "$action" == "create_daemon" ]];then
|
||||
|
||||
echo "$daemon_definition" > "$daemon_path"
|
||||
|
||||
exit 0
|
||||
|
||||
fi
|
||||
|
||||
# Remove daemon
|
||||
if [[ "$action" == "remove_daemon" ]];then
|
||||
|
||||
rm $daemon_path
|
||||
exit 0
|
||||
|
||||
fi
|
||||
Reference in New Issue
Block a user