From 19d49aa4ade5851d054ece268cbb40fe2670c811 Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Wed, 6 Nov 2024 19:14:42 -0800 Subject: [PATCH] dwm: unclutter-xfixes option --- modules/home/dwm.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/modules/home/dwm.nix b/modules/home/dwm.nix index 291c56f..068bc65 100644 --- a/modules/home/dwm.nix +++ b/modules/home/dwm.nix @@ -7,13 +7,27 @@ in { options.snowhawk.dwm = { enable = mkEnableOption "niri home-manager module"; + + useXFixes = mkEnableOption "using unclutter-xfixes instead of unclutter"; }; config = mkIf cfg.enable { # WM Stuff xsession.numlock.enable = true; - services.unclutter.enable = true; - services.unclutter.package = pkgs.unclutter-xfixes; + + services.unclutter = { + enable = true; + package = if cfg.useXFixes then pkgs.unclutter-xfixes else pkgs.unclutter; + }; + + systemd.user.services.unclutter.Service.ExecStart = + let cfg = config.services.unclutter; + in lib.mkForce '' + ${cfg.package}/bin/unclutter \ + --timeout ${toString cfg.timeout} \ + --jitter ${toString (cfg.threshold - 1)} \ + ${lib.concatStrings cfg.extraOptions} + ''; }; }