dotfiles/modules/home/graphical/wayland/gestures.nix
eriedaberrie 3446218455 Initial commit
Note: not the actual initial commit.

I swear I will stop repeatedly force pushing to this single commit eventually
ok.
2024-11-13 02:02:37 -08:00

30 lines
856 B
Nix

{ pkgs, config, lib, ... }:
let
cfg = config.my.graphical.wayland.gestures;
in {
options.my.graphical.wayland.gestures = {
enable = lib.mkEnableOption null;
};
config = lib.mkIf cfg.enable {
xdg.configFile = let
serviceName = "libinput-gestures.service";
service = "${pkgs.libinput-gestures}/share/systemd/user/${serviceName}";
in {
"systemd/user/${serviceName}".source = service;
"systemd/user/hyprland-session.target.wants/${serviceName}".source = service;
"libinput-gestures.conf" = {
text = let
hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl";
in ''
gesture pinch in 4 ${hyprctl} dispatch killactive
'';
onChange = ''
${pkgs.systemd}/bin/systemctl --user restart ${serviceName}
'';
};
};
};
}