Skip to content

Commit 2f0cc0d

Browse files
erikrybjoachifm
authored andcommittedNov 29, 2016
unclutter-xfixes service: init
Closes #18398
1 parent 28fa4cf commit 2f0cc0d

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
 

Diff for: ‎nixos/modules/module-list.nix

+1
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@
524524
./services/x11/colord.nix
525525
./services/x11/compton.nix
526526
./services/x11/unclutter.nix
527+
./services/x11/unclutter-xfixes.nix
527528
./services/x11/desktop-managers/default.nix
528529
./services/x11/display-managers/auto.nix
529530
./services/x11/display-managers/default.nix

Diff for: ‎nixos/modules/services/x11/unclutter-xfixes.nix

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{ config, lib, pkgs, ... }:
2+
3+
with lib;
4+
5+
let cfg = config.services.unclutter-xfixes;
6+
7+
in {
8+
options.services.unclutter-xfixes = {
9+
10+
enable = mkOption {
11+
description = "Enable unclutter-xfixes to hide your mouse cursor when inactive.";
12+
type = types.bool;
13+
default = false;
14+
example = true;
15+
};
16+
17+
package = mkOption {
18+
description = "unclutter-xfixes derivation to use.";
19+
type = types.package;
20+
default = pkgs.unclutter-xfixes;
21+
defaultText = "pkgs.unclutter-xfixes";
22+
};
23+
24+
timeout = mkOption {
25+
description = "Number of seconds before the cursor is marked inactive.";
26+
type = types.int;
27+
default = 1;
28+
};
29+
30+
threshold = mkOption {
31+
description = "Minimum number of pixels considered cursor movement.";
32+
type = types.int;
33+
default = 1;
34+
};
35+
36+
extraOptions = mkOption {
37+
description = "More arguments to pass to the unclutter-xfixes command.";
38+
type = types.listOf types.str;
39+
default = [];
40+
example = [ "exclude-root" "ignore-scrolling" "fork" ];
41+
};
42+
};
43+
44+
config = mkIf cfg.enable {
45+
systemd.user.services.unclutter-xfixes = {
46+
description = "unclutter-xfixes";
47+
wantedBy = [ "graphical.target" ];
48+
serviceConfig.ExecStart = ''
49+
${cfg.package}/bin/unclutter \
50+
--timeout ${toString cfg.timeout} \
51+
--jitter ${toString (cfg.threshold - 1)} \
52+
${concatMapStrings (x: " --"+x) cfg.extraOptions} \
53+
'';
54+
serviceConfig.RestartSec = 3;
55+
serviceConfig.Restart = "always";
56+
};
57+
};
58+
}

0 commit comments

Comments
 (0)
Please sign in to comment.