mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
unclutter: add module
This commit is contained in:
parent
06e7d087f2
commit
8fc8e158e2
3 changed files with 71 additions and 0 deletions
|
@ -573,6 +573,13 @@ in
|
||||||
A new module is available: 'programs.pidgin'
|
A new module is available: 'programs.pidgin'
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2018-03-04T06:54:26+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.unclutter'
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,7 @@ let
|
||||||
./services/taffybar.nix
|
./services/taffybar.nix
|
||||||
./services/tahoe-lafs.nix
|
./services/tahoe-lafs.nix
|
||||||
./services/udiskie.nix
|
./services/udiskie.nix
|
||||||
|
./services/unclutter.nix
|
||||||
./services/window-managers/i3.nix
|
./services/window-managers/i3.nix
|
||||||
./services/window-managers/xmonad.nix
|
./services/window-managers/xmonad.nix
|
||||||
./services/xscreensaver.nix
|
./services/xscreensaver.nix
|
||||||
|
|
63
modules/services/unclutter.nix
Normal file
63
modules/services/unclutter.nix
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let cfg = config.services.unclutter;
|
||||||
|
|
||||||
|
in {
|
||||||
|
options.services.unclutter = {
|
||||||
|
|
||||||
|
enable = mkEnableOption "unclutter";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
description = "unclutter derivation to use.";
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.unclutter-xfixes;
|
||||||
|
defaultText = "pkgs.unclutter-xfixes";
|
||||||
|
};
|
||||||
|
|
||||||
|
timeout = mkOption {
|
||||||
|
description = "Number of seconds before the cursor is marked inactive.";
|
||||||
|
type = types.int;
|
||||||
|
default = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
threshold = mkOption {
|
||||||
|
description = "Minimum number of pixels considered cursor movement.";
|
||||||
|
type = types.int;
|
||||||
|
default = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
extraOptions = mkOption {
|
||||||
|
description = "More arguments to pass to the unclutter command.";
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [ ];
|
||||||
|
example = [ "exclude-root" "ignore-scrolling" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
systemd.user.services.unclutter = {
|
||||||
|
Unit = {
|
||||||
|
Description = "unclutter";
|
||||||
|
After = [ "graphical-session-pre.target" ];
|
||||||
|
PartOf = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
Service = {
|
||||||
|
ExecStart = ''
|
||||||
|
${cfg.package}/bin/unclutter \
|
||||||
|
--timeout ${toString cfg.timeout} \
|
||||||
|
--jitter ${toString (cfg.threshold - 1)} \
|
||||||
|
${concatMapStrings (x: " --${x}") cfg.extraOptions}
|
||||||
|
'';
|
||||||
|
RestartSec = 3;
|
||||||
|
Restart = "always";
|
||||||
|
};
|
||||||
|
|
||||||
|
Install = {
|
||||||
|
WantedBy = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue