You are not logged in.
I've been trying this for a while. I think I just don't get .service files.
I'm trying to change the fn-mode on my computer to use the default function keys instead of the XF86Media keys. To do that, just `echo 2 > /sys/module/hid_apple/parameters/fnmode` but I have to do it from root environment.
So far I have this
[Unit]
Description=change Fn-mode to normal function keys on boot
Wants=graphical.target
Before=graphical.target
[Service]
Type=oneshot
ExecStart=/usr/bin/echo 2 | tee /sys/module/hid_apple/parameters/fnmode
[Install]
WantedBy=multi-user.target
And it's not working. I have also had `/usr/bin/echo 2 > /sys/module/hid_apple/parameters/fnmode` instead of the `tee` command.
Here's its status
$ systemctl status fn-mode.service
fn-mode.service - change Fn-mode to normal function keys on boot
Loaded: loaded (/etc/systemd/system/fn-mode.service; enabled)
Active: inactive (dead) since Wed 2013-05-08 10:47:20 EDT; 4min 51s ago
Process: 381 ExecStart=/usr/bin/echo 2 | tee /sys/module/hid_apple/parameters/fnmode (code=exited, status=0/SUCCESS)
What am I missing?
Thank you.
Kopkins
Last edited by Kopkins (2013-05-10 04:21:13)
Offline
ExecStart is not a shell (which is also explicitly mentioned in the systemd.service man page).
nevertheless, a service isn't the best solution here. The module has a parameter for fnmode, so it makes more sense to just set it via modprobe.d : https://bbs.archlinux.org/viewtopic.php?id=161293
Last edited by 65kid (2013-05-08 14:58:52)
Offline
Gotcha thanks. I know I saw that on the manpage but saw examples of files that looked like they were just using the absolute path and that worked. But, I was mistaken. Thanks for the link. I guess I didn't search well enough for it.
Kopkins
Offline
So I changed the .conf file to change the parameter
$ cat /etc/modprobe.d/hid_apple.conf
options hid_apple fnmode=2
and it works when I modprobe the module. `rmmod hid_apple ; modprobe hid_apple`
Then the media keys work as function keys like I want them to, but after rebooting, the .conf file seems to be overlooked and it's back to normal. Then I end up doing `rmmod hid_apple ; modprobe hid_apple` each time. I thought it wasn't getting loaded because of the hid_generic module, so I blacklisted that, but nothing changed.
I just added it to the kernel line and that works. Just added hid_apple.fnmode=2
Thanks,
Kopkins
Last edited by Kopkins (2013-05-10 04:20:48)
Offline
hid_apple probably already gets loaded in the initramfs, that's why the parameter doesn't apply. You woud have to add the modconf hook to /etc/mkinitcpio.conf and rebuild the initramfs.
Offline