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

I swear I will stop repeatedly force pushing to this single commit eventually
ok.
2024-09-24 01:22:11 -07: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}
'';
};
};
};
}