Can I make this keyboard light command that requires sudo run at startup?

Solution 1:

Is there a way I can get this command to run at startup?

Yes,

you can add this command in rc.local file in order to be executed in ever system boot/or reboot.

Edit the file, you will need root privileges for that.

gksudo gedit /etc/rc.local 

and add the command line before exit 0

The file should read

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
echo 0 > /sys/class/leds/asus::kbd_backlight/brightness
exit 0

save the file and reboot to check the results. No sudo is needed here, because the file is executed by the root user.

I don't remember what the execution bits are by default (in Ubuntu) at this file, but you can add the execution bit with the following command

sudo chmod +x /etc/rc.local