milgner / k290-fnkeyctl

Configures the behaviour of the F-keys on the Logitech K290
MIT License
222 stars 30 forks source link

Multimedia keys behaviour reverted after resume (the 20-k290.sh script does not run on Ubuntu as pm-utils are not used anymore) #16

Open madadam opened 8 years ago

madadam commented 8 years ago

Hello,

After my machine resumes from suspend, the F-keys are reverted back to their default multimedia behaviour. This is because the /etc/pm/sleep.d/20-k290.sh script is not executed anymore. This is because Ubuntu switched to systemd and no longer uses pm-utils (not sure in which version of Ubuntu this happened). I fixed it by putting a script with the following content:

#!/bin/bash

case "$1" in
    post)
        /usr/local/sbin/k290_fnkeyctl > /dev/null
        ;;
esac
exit 0

in /lib/systemd/system-sleep and making it executable. I suspect there is probably more proper way to do it, but this worked for me.

milgner commented 8 years ago

Thank you for the report! I personally don't use Ubuntu so didn't know that they had changed to systemd as well. I'll adapt the packaging script accordingly!

On 28 December 2015 14:28:46 CET, "Adam Cigánek" notifications@github.com wrote:

Hello,

After my machine resumes from suspend, the F-keys are reverted back to their default multimedia behaviour. This is because the /etc/pm/sleep.d/20-k290.sh script is not executed anymore. This is because Ubuntu switched to systemd and no longer uses pm-utils (not sure in which version of Ubuntu this happened). I fixed it by putting a script with the following content:

#!/bin/bash

case "$1" in
   post)
       /usr/local/sbin/k290_fnkeyctl > /dev/null
       ;;
esac
exit 0

in /lib/systemd/system-sleep and making it executable. I suspect there is probably more proper way to do it, but this worked for me.


Reply to this email directly or view it on GitHub: https://github.com/milgner/k290-fnkeyctl/issues/16

madadam commented 8 years ago

Cool! Let me know if you need someone to test it.

milgner commented 8 years ago

I just realized that I didn't add any packaging for Ubuntu yet. The install.sh script just checks for the existence of /etc/pm/sleep.d and /usr/lib/systemd/system-sleep/ respectively. So if you installed from a repository clone, you may just need to run it again and it should install the systemd-script. You can remove the script in /etc/pm/sleep.d then, too.

arichardson commented 7 years ago

I just ran into this too: The systemd files do not work on Ubuntu because it patches systemd to look for scripts only in /lib/systemd/system-sleep/ instead of /usr/lib/systemd/system-sleep/

arichardson commented 7 years ago

Fix is in #13

Deleetdk commented 7 years ago

Worked fine for me (Mint 18.1, based on Xenial).

nuqz commented 5 years ago

I've used Spone's fork which have @arichardson's commits already merged and it worked fine for me. By the way I'm using Debian but the problem still affected me.