#!/usr/bin/env bash FILE_TO_WATCH="/sys/class/backlight/intel_backlight/brightness" # Replace with the actual file path cat "$FILE_TO_WATCH" while true; do inotifywait -e modify "$FILE_TO_WATCH" cat "$FILE_TO_WATCH" done