Skip to content

Commit 7d4c06e

Browse files
committed
jankyborders: init
1 parent e86de61 commit 7d4c06e

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

modules/jankyborders/darwin.nix

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{ config, lib, ... }:
2+
let
3+
inherit (config.lib.stylix) colors;
4+
5+
opacityHex =
6+
percentage:
7+
lib.throwIfNot (percentage >= 0 && percentage <= 1)
8+
"value must be between 0 and 1 (inclusive): ${toString percentage}"
9+
(lib.toHexString (builtins.floor (percentage * 255 + 0.5)));
10+
mkColor =
11+
color:
12+
"0x${
13+
lib.strings.replaceStrings [ "#" ] [ "" ] color
14+
} ${opacityHex config.opacity.desktop}";
15+
in
16+
{
17+
options.stylix.targets.jankyborders.enable =
18+
config.lib.stylix.mkEnableTarget "JankyBorders" true;
19+
20+
config =
21+
lib.mkIf (config.stylix.enable && config.stylix.targets.jankyborders.enable)
22+
{
23+
services.jankyborders = {
24+
active_color = mkColor colors.base0D;
25+
inactive_color = mkColor colors.base03;
26+
};
27+
};
28+
}

0 commit comments

Comments
 (0)