In order to adjust the screenpad backlight on my ASUS Zenbook, I am using a kernel module I found here. Per his instructions, to make keybind shortcuts using a simple screenpad x
command to adjust the brightness, I need to add sudo chmod a+w '/sys/class/leds/asus::screenpad/brightness'
to 'rc.local', as the command is required with each reboot, and needs a password every time. By running automatically I could immediately use the custom keyboard shortcuts as they'd function normally with the drivers on Windows, without needing to run the command and enter my password each boot.
I'm a new Linux user, on Parrot OS. From what I've gathered, it's not recommend to use rc.local, and I should instead use either systemd, cronjob, or run it as process using the GUI startup applications menu.
I'm completely lost as to go about doing this with systemd or cronjob. I tried making a file called 'screenpad-perms.sh' and put it in /usr/local/bin, with just these lines in it based on what I've read:
#! /bin/bash
sudo chmod a+w '/sys/class/leds/asus::screenpad/brightness'
I then made it executable using chmod +x screenpad-perms.sh
. Finally, I opened the GUI Autostart app and added it as a Login Script.
Restarted the PC but it doesn't work, typing screenpad x
gets a permissions denied error unless I manually type sudo chmod a+w '/sys/class/leds/asus::screenpad/brightness'
and enter my password; so it seems to not be executing.
Again apologies as I'm very new to Linux, just really hoping to get this screen working properly. What am I missing here?
rc.local
(which is in/etc
) is executed as root so you do not needsudo