-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Battery requests to install a backwards incompatible update every time the app is started on MacOS Sequoia #312
Comments
I have the same issue. I installed with Homebrew cask on latest version of MacOS Sonoma |
Ditto here with v1.2.2 installed via Homebrew on Sonoma 14.7 (23H124). |
Dupe of #300. |
Same issue on my side with Sequoia 15.1 |
EDIT: THIS DIDNT WORK FOR ME, IT WAS A VALIENT ATTEMPT, THOBattery App Password-Free Setup ScriptIf you're tired of entering your password every time the Battery app starts up, this script will configure your system to allow the Battery app to run without password prompts. What This Script Does
How to Use
The Script#!/bin/bash
# Color codes for output
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Get current user
CURRENT_USER=$(whoami)
if [ "$CURRENT_USER" = "root" ]; then
CURRENT_USER=$SUDO_USER
fi
# Logging function
log() {
echo -e "${YELLOW}[$(date '+%Y-%m-%d %H:%M:%S')]${NC} $1"
}
error() {
echo -e "${RED}[$(date '+%Y-%m-%d %H:%M:%S')] ERROR:${NC} $1"
}
success() {
echo -e "${GREEN}[$(date '+%Y-%m-%d %H:%M:%S')] SUCCESS:${NC} $1"
}
# Check if script is run as root
if [ "$EUID" -ne 0 ]; then
error "Please run this script with sudo"
exit 1
fi
# Print script start information
log "Starting battery sudo configuration script"
log "Configuring for user: $CURRENT_USER"
# Create backup of sudoers
log "Creating backup of sudoers configuration..."
if cp /etc/sudoers /etc/sudoers.backup; then
success "Backup created at /etc/sudoers.backup"
else
error "Failed to create sudoers backup"
exit 1
fi
# Create new sudoers file for battery app
log "Creating battery app sudoers configuration..."
cat > /etc/sudoers.d/battery-app << EOL
$CURRENT_USER ALL=(ALL) NOPASSWD: /usr/local/bin/smc -k CH0C -r
$CURRENT_USER ALL=(ALL) NOPASSWD: /usr/local/bin/smc -k CH0I -r
$CURRENT_USER ALL=(ALL) NOPASSWD: /usr/local/bin/smc -k ACLC -r
$CURRENT_USER ALL=(ALL) NOPASSWD: /usr/local/bin/smc -k ACLC -w 02
$CURRENT_USER ALL=(ALL) NOPASSWD: /usr/local/bin/battery
EOL
# Set correct permissions
log "Setting correct permissions..."
if chmod 440 /etc/sudoers.d/battery-app; then
success "Permissions set correctly"
else
error "Failed to set permissions"
rm /etc/sudoers.d/battery-app
exit 1
fi
# Validate sudoers syntax
log "Validating sudoers syntax..."
if visudo -c -f /etc/sudoers.d/battery-app; then
success "Sudoers syntax validated successfully"
else
error "Sudoers syntax validation failed"
rm /etc/sudoers.d/battery-app
exit 1
fi
# Test the configuration
log "Testing configuration with actual commands..."
# Test array of commands
declare -a test_commands=(
"/usr/local/bin/smc -k CH0C -r"
"/usr/local/bin/smc -k CH0I -r"
"/usr/local/bin/smc -k ACLC -r"
)
# Run tests
TEST_FAILED=0
for cmd in "${test_commands[@]}"; do
log "Testing command: $cmd"
if sudo -n $cmd &>/dev/null; then
success "Command executed without password: $cmd"
else
error "Failed to execute without password: $cmd"
TEST_FAILED=1
fi
done
if [ $TEST_FAILED -eq 0 ]; then
echo
echo -e "${GREEN}✅ Battery sudo configuration completed successfully${NC}"
echo -e "${GREEN}✅ All test commands executed without password prompts${NC}"
echo
log "You can now use the battery app without password prompts"
log "If you need to undo these changes, run: sudo rm /etc/sudoers.d/battery-app"
else
echo
error "Some tests failed. Configuration may not be complete."
error "Check the logs above for details"
echo
exit 1
fi
# Print final status check
echo
log "Final Configuration Status:"
echo "-------------------------"
echo "User configured: $CURRENT_USER"
echo "Sudoers file: /etc/sudoers.d/battery-app"
echo "Backup file: /etc/sudoers.backup"
echo "Syntax validation: Passed"
echo "Command tests: Passed"
echo "-------------------------" How to Undo ChangesIf you need to remove these permissions, simply run: sudo rm /etc/sudoers.d/battery-app Safety NoteThis script modifies system permissions to allow the Battery app to run specific commands without a password. While this is safe for the Battery app's specific commands, you should always be careful when modifying sudo permissions on your system. The script includes several safety features:
|
Hi, same problem here : MacBook Pro 16 M1 Max with Sequioa 15.2. |
Looking forward to the fix. I am experiencing the same issue with an M4 and Sequoia 15.2. Thanks for the hard work! |
Same issue for me, sadly. |
Also seeing this with every reboot after adding this app to my login items so that it starts on startup. MacOS Sequoia 15.2 on M1 Max. |
Issue hasn’t been fixed, switched to Al Dente; will return once the issue is fixed |
Still not fixed with Sequoia 15.3 on M2 Air. |
I'm also having the same issue on v1.2.2 with Sequoia 15.3 on M4 Max |
same here, fix doesn't work MacBookmPro M3pro Sequoia 15.2 |
What is the issue? (required)
Battery requests to install a backwards incompatible update every time the app is started on MacOS Sequoia.
What exactly did you do to produce the issue? (required)
Steps to reproduce the behavior:
Expected behavior (required)
I expect battery to install that required item once and not again.
Screenshots (optional)
![image](https://private-user-images.githubusercontent.com/74679016/380243909-c0feb8e1-35d6-4857-a808-68798d8243d3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMjg2MDIsIm5iZiI6MTczOTMyODMwMiwicGF0aCI6Ii83NDY3OTAxNi8zODAyNDM5MDktYzBmZWI4ZTEtMzVkNi00ODU3LWE4MDgtNjg3OThkODI0M2QzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDAyNDUwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYwOTc3OGJlMTZiMjVkMTljN2I0M2VlOGJlMGZlYjkxN2Y5NTQwNTBiMzVmMjY5ODg4NjNmM2U1OGFiNzIzOGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.b28wENp3cfaW0QnMc0lYT_lQ0oMXU9GcqN2pzgwXbJM)
The text was updated successfully, but these errors were encountered: