From e84d333ea66b80611b49dcdf808140e480f57ad1 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 13 Aug 2025 21:38:28 -0600 Subject: [PATCH] [NixOS] Only use backlight class in brightness.sh --- dotfiles/lib/bin/brightness.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dotfiles/lib/bin/brightness.sh b/dotfiles/lib/bin/brightness.sh index 86865663..d16e63b1 100755 --- a/dotfiles/lib/bin/brightness.sh +++ b/dotfiles/lib/bin/brightness.sh @@ -5,8 +5,8 @@ ARG="${1:-}" # Function to get current brightness percentage get_brightness_percentage() { - # Get list of devices - local devices=$(brightnessctl --list 2>/dev/null | cut -d' ' -f2 | cut -d"'" -f2) + # Get list of display backlight devices only (filter by class 'backlight') + local devices=$(brightnessctl --list 2>/dev/null | grep 'class.*backlight' | cut -d' ' -f2 | cut -d"'" -f2) local device_count=$(echo "$devices" | wc -w) if [ "$device_count" -eq 0 ]; then @@ -59,8 +59,8 @@ if [ -n "$ARG" ]; then fi # Try to apply to all devices - # First, try to get list of devices - DEVICES=$(brightnessctl --list 2>/dev/null | cut -d' ' -f2 | cut -d"'" -f2) + # Get list of display backlight devices only (filter by class 'backlight') + DEVICES=$(brightnessctl --list 2>/dev/null | grep 'class.*backlight' | cut -d' ' -f2 | cut -d"'" -f2) if [ -n "$DEVICES" ]; then # Apply to each device