#!/bin/sh

# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2024-present ArchR (https://github.com/archr-linux/Arch-R)

# Minimal OS variable loading for performance
. /etc/profile.d/001-functions

# Get Internal LED State
LED_STATE=$(get_setting "led.color")
if [ ! -n "${LED_STATE}" ]; then
  LED_STATE="battery"
  set_setting "led.color" "battery"
fi

# Run LED control at boot
/usr/bin/ledcontrol ${LED_STATE}
