mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-14 18:14:21 +00:00
remove uselses comments
This commit is contained in:
@@ -66,19 +66,16 @@ fi
|
||||
|
||||
print_info "Script installed at $BATTERY_MANAGER_PATH"
|
||||
|
||||
# 3. Create log file
|
||||
print_info "Creating log file..."
|
||||
touch /var/log/battery-manager.log
|
||||
chmod 644 /var/log/battery-manager.log
|
||||
print_info "Log file created at /var/log/battery-manager.log"
|
||||
|
||||
# 4. Create polkit policy
|
||||
print_info "Creating polkit policy..."
|
||||
|
||||
POLICY_FILE="/usr/share/polkit-1/actions/com.local.battery-manager.$ACTUAL_USER.policy"
|
||||
|
||||
if [ -f "$SCRIPT_DIR/battery-manager.policy" ]; then
|
||||
# Update the policy file with the correct installer path and user
|
||||
sed -e "s|/home/damian/Projects/noctalia/battery-charging-treshold/Bin/install-battery-manager.sh|$SCRIPT_DIR/install-battery-manager.sh|g" \
|
||||
-e "s/ACTUAL_USER_PLACEHOLDER/$ACTUAL_USER/g" \
|
||||
"$SCRIPT_DIR/battery-manager.policy" > "$POLICY_FILE"
|
||||
@@ -90,13 +87,11 @@ fi
|
||||
|
||||
print_info "Polkit policy created at $POLICY_FILE"
|
||||
|
||||
# 5. Create polkit rule
|
||||
print_info "Creating polkit rule..."
|
||||
|
||||
RULES_FILE="/etc/polkit-1/rules.d/50-battery-manager-$ACTUAL_USER.rules"
|
||||
|
||||
if [ -f "$SCRIPT_DIR/battery-manager.rules" ]; then
|
||||
# Replace the placeholder with the actual user
|
||||
sed "s/ACTUAL_USER_PLACEHOLDER/$ACTUAL_USER/g" \
|
||||
"$SCRIPT_DIR/battery-manager.rules" > "$RULES_FILE"
|
||||
print_info "Polkit rule copied from $SCRIPT_DIR/battery-manager.rules"
|
||||
@@ -107,7 +102,6 @@ fi
|
||||
|
||||
print_info "Polkit rule created for user: $ACTUAL_USER at $RULES_FILE"
|
||||
|
||||
# 6. Restart polkit
|
||||
print_info "Restarting polkit..."
|
||||
if systemctl restart polkit 2>/dev/null; then
|
||||
print_info "Polkit restarted"
|
||||
|
||||
Reference in New Issue
Block a user