diff options
| author | tv <tv@krebsco.de> | 2026-11-28 23:32:29 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-28 23:32:29 +0000 |
| commit | 8bdc6e6d367ea22130a864c3c1f681e45fac1dbf (patch) | |
| tree | 371328e122f28e842090adca1e14e5c7075a7b5f /systems/qi | |
| parent | 8fccb9b641f6c31a7928d2d3d84e786d3946d2a5 (diff) | |
qi: run lisgd with the sway session
As a user service of sway-session.target, which NixOS' sway starts from
/etc/sway/config.d, instead of a script for the user's sway config to
call.
Diffstat (limited to 'systems/qi')
| -rw-r--r-- | systems/qi/sway.nix | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/systems/qi/sway.nix b/systems/qi/sway.nix index 7dfe3bed..17ca2754 100644 --- a/systems/qi/sway.nix +++ b/systems/qi/sway.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{ config, pkgs, ... }: { nixpkgs.overlays = [(self: super: { sway-unwrapped = super.sway-unwrapped.overrideAttrs (old: { patches = old.patches or [] ++ [ @@ -18,6 +18,21 @@ ExecStart = "${pkgs.squeekboard}/bin/squeekboard"; }; }; + # Gestures with two fingers. + systemd.user.services.lisgd = { + partOf = [ "sway-session.target" ]; + wantedBy = [ "sway-session.target" ]; + path = [ config.programs.sway.package pkgs.systemd ]; + serviceConfig.ExecStart = pkgs.writers.writeDash "lisgd" '' + exec ${pkgs.lisgd}/bin/lisgd \ + -d /dev/input/by-path/platform-a90000.i2c-event \ + -m 500 \ + -g '2,DU,*,*,R,systemctl --user start wvkbd' \ + -g '2,UD,*,*,R,systemctl --user stop wvkbd' \ + -g '2,RL,*,*,R,swaymsg workspace next' \ + -g '2,LR,*,*,R,swaymsg workspace prev' + ''; + }; systemd.user.services.wvkbd = { environment = { WAYLAND_DISPLAY = "wayland-1"; @@ -43,19 +58,6 @@ systemctl --user start squeekboard fi '') - # integrate into sway config - (pkgs.writeDashBin "start-lisgd" '' - if ! ${pkgs.procps}/bin/pgrep lisgd >/dev/null; then - ${pkgs.lisgd}/bin/lisgd \ - -d /dev/input/by-path/platform-a90000.i2c-event \ - -m 500 \ - -g '2,DU,*,*,R,systemctl --user start wvkbd' \ - -g '2,UD,*,*,R,systemctl --user stop wvkbd' \ - -g '2,RL,*,*,R,swaymsg workspace next' \ - -g '2,LR,*,*,R,swaymsg workspace prev' \ - & - fi - '') ]; programs.sway.enable = true; xdg.portal = { |
