for my F- and fn-keys to work I need to run this command echo 0 | tee /sys/module/hid_apple/parameters/fnmode
after every boot. So i wanted to start it with a crontab, but this somehow does not work and I don't know why.
So I opened the corntab file like this sudo crontab -e
and added the following:
@reboot /home/myuser/.config/autostart-scripts/startup.sh
But as I said, this doesn't work. The script is the following:
#!/bin/bash
echo 0 | sudo tee /sys/module/hid_apple/parameters/fnmode
I added this script to sudoers to be executable but still doesn't work.
myuser ALL=(ALL:ALL) NOPASSWD: /home/myuser/.config/autostart-scripts/startup.sh
So i tried writing a service.
The service starts the script which is nice, but since it needs sudo permissions I think it needs to be placed in /etc/systemd/system/my.service
. But when this service is started, I think /sys
isn't there just yet. So how can I either start this service as a user (keep in mind that there needs to be a sudo
done) or as a cronjob or as a service when /sys
is created?
fnmode=0
andhid_apple
instead ofapplespi
, also described in askubuntu.com/questions/7537/#7553? – Freddy Nov 09 '20 at 22:53