From 8c4162b8851a8c6c087cbfb0b6651c4e5b26b46d Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Tue, 20 May 2025 22:02:50 +0200 Subject: [PATCH] don't blink when charging Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com> Former-commit-id: 494de74831fa0834a26b9b6b4d0b34e37f479660 --- home/system/hyprland/keyboard-backlight.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/home/system/hyprland/keyboard-backlight.nix b/home/system/hyprland/keyboard-backlight.nix index 7555ff6..c48ca83 100644 --- a/home/system/hyprland/keyboard-backlight.nix +++ b/home/system/hyprland/keyboard-backlight.nix @@ -13,7 +13,8 @@ let set_keyboard_backlight ${config.lib.stylix.colors.base0D} while true; do BATTERY_LEVEL=$(cat /sys/class/power_supply/BAT*/capacity) - if [[ $BATTERY_LEVEL -le 10 ]]; then + IS_CHARGING=$(cat /sys/class/power_supply/BAT*/status) + if [[ $BATTERY_LEVEL -le 10 && $IS_CHARGING != "Charging" ]]; then if [[ $state == "red" ]];then state="white" set_keyboard_backlight "000000"