mirror of
https://github.com/danth/stylix
synced 2024-11-10 06:34:15 +00:00
Add cursor support (#172)
Co-authored-by: Daniel Thwaites <danthwaites30@btinternet.com>
This commit is contained in:
parent
4380955949
commit
07795247c2
6 changed files with 64 additions and 0 deletions
|
@ -55,6 +55,10 @@ in {
|
|||
};
|
||||
|
||||
output."*".bg = "${config.stylix.image} fill";
|
||||
|
||||
seat."*" = {
|
||||
xcursor_theme = "${config.stylix.cursor.name} ${toString config.stylix.cursor.size}";
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
|
|
26
stylix/cursor.nix
Normal file
26
stylix/cursor.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ pkgs, config, lib, ... } @ args:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.stylix.cursor;
|
||||
fromOs = import ./fromos.nix { inherit lib args; };
|
||||
in {
|
||||
options.stylix.cursor = {
|
||||
name = mkOption {
|
||||
description = mdDoc "The cursor name within the package.";
|
||||
type = types.str;
|
||||
default = fromOs [ "cursor" "name" ] "Vanilla-DMZ";
|
||||
};
|
||||
package = mkOption {
|
||||
description = mdDoc "Package providing the cursor theme.";
|
||||
type = types.package;
|
||||
default = fromOs [ "cursor" "package" ] pkgs.vanilla-dmz;
|
||||
};
|
||||
size = mkOption {
|
||||
description = mdDoc "The cursor size.";
|
||||
type = types.int;
|
||||
default = fromOs [ "cursor" "size" ] 32;
|
||||
};
|
||||
};
|
||||
}
|
22
stylix/hm/cursor.nix
Normal file
22
stylix/hm/cursor.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.stylix.cursor;
|
||||
|
||||
in {
|
||||
imports = [ ../cursor.nix ];
|
||||
|
||||
config = mkIf pkgs.stdenv.hostPlatform.isLinux {
|
||||
home.pointerCursor = {
|
||||
name = cfg.name;
|
||||
package = cfg.package;
|
||||
size = cfg.size;
|
||||
x11 = {
|
||||
enable = true;
|
||||
defaultCursor = cfg.name;
|
||||
};
|
||||
gtk.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -9,6 +9,7 @@ in {
|
|||
../pixel.nix
|
||||
../target.nix
|
||||
../opacity.nix
|
||||
./cursor.nix
|
||||
./fonts.nix
|
||||
(import ./palette.nix { inherit palette-generator base16; })
|
||||
(import ../templates.nix inputs)
|
||||
|
|
10
stylix/nixos/cursor.nix
Normal file
10
stylix/nixos/cursor.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, ... }:
|
||||
|
||||
let
|
||||
cfg = config.stylix.cursor;
|
||||
in {
|
||||
imports = [ ../cursor.nix ];
|
||||
config = {
|
||||
environment.variables.XCURSOR_SIZE = toString cfg.size;
|
||||
};
|
||||
}
|
|
@ -10,6 +10,7 @@ in {
|
|||
../pixel.nix
|
||||
../target.nix
|
||||
../opacity.nix
|
||||
./cursor.nix
|
||||
./fonts.nix
|
||||
(import ./palette.nix { inherit palette-generator base16; })
|
||||
(import ../templates.nix inputs)
|
||||
|
|
Loading…
Reference in a new issue