On Windows 10, my laptop's keyboard backlit automatically turned off after a minute or so of inactivity. As soon as any activity occurred, they turned back on.
On ubuntu, if I run the following
echo <0-3> | sudo tee /sys/class/leds/asus::kbd_backlight/brightness
That works for dimming / increasing the brightness (0 being turned off, 3 being brightest).
Is there a way to have the above automatically get executed whenever the system's been idle for 1 minute, as well as re-run it when it comes back from being idle?