diff --git a/modules/applications/nwg-drawer/home.nix b/modules/applications/nwg-drawer/home.nix new file mode 100644 index 0000000..4622c39 --- /dev/null +++ b/modules/applications/nwg-drawer/home.nix @@ -0,0 +1,28 @@ +{ lib, pkgs, ... }: +let + nwgDrawer = lib.getExe pkgs.nwg-drawer; +in +{ + home.packages = [ pkgs.nwg-drawer ]; + + # Keep the application grid resident so touchpad gestures can show it + # immediately instead of rebuilding the desktop-entry cache each time. + systemd.user.services.nwg-drawer = { + Unit = { + Description = "Resident nwg-drawer application grid"; + Documentation = [ "https://github.com/nwg-piotr/nwg-drawer" ]; + PartOf = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + + Service = { + # Use niri's spawn action when available; nwg-drawer falls back to a + # direct launch under labwc. + ExecStart = "${nwgDrawer} -r -ovl -wm niri -closebtn right -fm nautilus -term ghostty"; + Restart = "on-failure"; + RestartSec = 2; + }; + + Install.WantedBy = [ "graphical-session.target" ]; + }; +} diff --git a/modules/applications/nwg-drawer/meta.nix b/modules/applications/nwg-drawer/meta.nix new file mode 100644 index 0000000..815dc17 --- /dev/null +++ b/modules/applications/nwg-drawer/meta.nix @@ -0,0 +1,3 @@ +{ + description = "Full-screen Wayland application drawer"; +} diff --git a/modules/profiles/interface/linux-desktop/meta.nix b/modules/profiles/interface/linux-desktop/meta.nix index 43bcc5a..96650a2 100644 --- a/modules/profiles/interface/linux-desktop/meta.nix +++ b/modules/profiles/interface/linux-desktop/meta.nix @@ -8,6 +8,7 @@ "applications.gtk" "applications.nautilus" "hardwares.graphics" + "services.fusuma" "systems.audio" "systems.fonts" ]; diff --git a/modules/services/fusuma/home.nix b/modules/services/fusuma/home.nix new file mode 100644 index 0000000..8d79c9d --- /dev/null +++ b/modules/services/fusuma/home.nix @@ -0,0 +1,44 @@ +{ lib, pkgs, ... }: +let + fusuma = lib.getExe pkgs.fusuma; + nwgDrawer = lib.getExe pkgs.nwg-drawer; +in +{ + home.packages = [ pkgs.fusuma ]; + + xdg.configFile."fusuma/config.yml".text = '' + pinch: + 4: + in: + command: "${nwgDrawer} -open" + out: + command: "${nwgDrawer} -close" + + threshold: + pinch: 0.5 + + interval: + pinch: 0.5 + ''; + + systemd.user.services.fusuma = { + Unit = { + Description = "Fusuma multitouch gesture recognizer"; + Documentation = [ "https://github.com/iberianpig/fusuma" ]; + Requires = [ "nwg-drawer.service" ]; + PartOf = [ "graphical-session.target" ]; + After = [ + "graphical-session.target" + "nwg-drawer.service" + ]; + }; + + Service = { + ExecStart = fusuma; + Restart = "on-failure"; + RestartSec = 3; + }; + + Install.WantedBy = [ "graphical-session.target" ]; + }; +} diff --git a/modules/services/fusuma/meta.nix b/modules/services/fusuma/meta.nix new file mode 100644 index 0000000..0f7368b --- /dev/null +++ b/modules/services/fusuma/meta.nix @@ -0,0 +1,5 @@ +{ + description = "Touchpad gesture recognition for Wayland sessions"; + + includes = [ "applications.nwg-drawer" ]; +} diff --git a/modules/services/fusuma/nixos.nix b/modules/services/fusuma/nixos.nix new file mode 100644 index 0000000..95f096f --- /dev/null +++ b/modules/services/fusuma/nixos.nix @@ -0,0 +1,5 @@ +{ primaryUser, ... }: +{ + # Fusuma reads raw touchpad events through libinput. + users.users.${primaryUser}.extraGroups = [ "input" ]; +}