From 2bdc8ae953b8945c27ed1859f341a43cb30347b2 Mon Sep 17 00:00:00 2001 From: base47 Date: Sun, 11 Jan 2026 20:35:05 +0100 Subject: [PATCH] Remove visudo related checks from change_magsafe_led_color() --- battery.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/battery.sh b/battery.sh index aa50ceb..342e44d 100755 --- a/battery.sh +++ b/battery.sh @@ -229,16 +229,9 @@ function log_smc_capabilities() { # Change magsafe color # see community sleuthing: https://github.com/actuallymentor/battery/issues/71 function change_magsafe_led_color() { - log "MagSafe LED function invoked" - color=$1 + local color=$1 - # Check whether user can run color changes without password (required for backwards compatibility) - if sudo -n smc -k ACLC -r &>/dev/null; then - log "💡 Setting magsafe color to $color" - else - log "🚨 Your version of battery is using an old visudo file, please run 'battery visudo' to fix this, until you do battery cannot change magsafe led colors" - return - fi + log "💡 Setting magsafe color to $color" if [[ "$color" == "green" ]]; then log "setting LED to green"