Does anyone know why none of the Starting & Stopping commands for libinput-gestures work in NixOS? These worked fine for me in Arch, and I made sure to check the package options in NixOS to see if there was any additional configuration needed but there were no options.
When I run libinput-gestures-setup status
, I get the following error:
libinput-gestures-setup: command not found
I tried reaching out to the NixOS libinput-gestures package maintainer, Natalie Röijezon, and she said she hasn’t been using laptops since COVID and wouldn’t be able to help.
It is my understanding that these commands run over dbus, so I’ve made sure to enable the following:
boot.initrd.systemd.dbus.enable = true;
boot.loader.systemd-boot.enable = true;
services.dbus.enable = true;
Is there something additional I need to add to my config for libinput-gestures Starting & Stopping commands to work, or is there something different about Nix or the libinput-gestures package in the NUR that prevents these commands from being included?
Does that mean it was removed on purpose?
Probably, because l-g-s
is just a big script that tries a bunch of commands that may or may not work in various environments. It’s not necessary; it’s just a cross-distro convenience, and it doesn’t fit with the Nix model of software packaging.
You should be able to use systemctl
directly, with systemctl start libinput-gestures
etc.
When I enter systemctl start libinput-gestures
I get the following error:
Failed to start libinput-gestures.service: Unit libinput-gestures.service not found.
So I tried adding services.libinput-gestures.enable = true;
to my config, but got the following error:
The option "services.libinput-gestures" does not exist.
Any suggestions?
Have you added libinput-gestures
to systemd.packages
?
Relevant manual section.
I haven’t added systemd
before, so I added it to my package list and, per the manual, added the following to my config:
systemd.packages = [ pkgs.packagekit ];
systemd.services.libinput-gestures.enable = true;
But I just keep getting the following error:
Failed to start libinput-gestures.service: Unit libinput-gestures.service has a bad unit file setting.
You don’t need to add systemd to your package list; it’s part of NixOS.
You do however need to add pkgs.libinput-gestures
to systemd.packages
if you want the libinput-gestures
units. Adding pkgs.packagekit
to systemd.packages
gets you the packagekit
units.
1 Like
Okay, I removed systemd from my package list and changed my config to:
systemd.packages = [ pkgs.libinput-gestures ];
systemd.services.libinput-gestures.enable = true;
But I’m still still getting the “bad unit file setting” error. Is there anything else I need to do?
Remove this:
No module defines systemd.services.libinput-gestures
, so that line is creating an empty service definition, which is the cause of the error about a misconfigured unit file.
Just adding the package to systemd.packages
will make it available to systemctl
. You should then be able to run systemctl --user <command> libinput-gestures
to control the service. If you want to enable the service permanently, follow the instructions in the linked manual section.
1 Like
Ok, I added systemctl --user start libinput-gestures &
to my Hyprland startup script, and the following to my hyprland.conf:
exec-once = swayidle -w after-resume 'systemctl --user start libinput-gestures' before-sleep 'systemctl --user stop libinput-gestures'
Everything appears to be working correctly. Gestures are coming back after resuming from hibernation. Any down-sides to doing it like this?