61208e3dee
Note: not the actual initial commit. I swear I will stop repeatedly force pushing to this single commit eventually ok.
30 lines
856 B
Nix
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}
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|