Compare commits

...

2 commits

Author SHA1 Message Date
c7c570afb2
use the hyprcursor module in del 2024-03-11 18:03:59 +01:00
32d6fb98cb
initial hyprcursor work 2024-03-11 17:21:34 +01:00
2 changed files with 27 additions and 12 deletions

View file

@ -224,8 +224,11 @@
themes = { themes = {
cursor = { cursor = {
enable = true; enable = true;
package = pkgs.bibata-cursors; src = pkgs.fetchurl {
name = "Bibata-Modern-Classic"; url = "https://cdn.discordapp.com/attachments/1216066899729977435/1216076659149504643/HyprBibataModernClassicSVG.tar.gz?ex=65ff12a5&is=65ec9da5&hm=a42375c7390aaae1dcb444ac45be60779e7ca14d437a5a927dffabc1b573cc07&";
hash = "sha256-KDYoULjJC0Nhdx9Pz5Ezq+1F0tWwkVQIc5buy07hO98=";
};
name = "HyprBibataModernClassicSVG";
size = 24; size = 24;
}; };
gtk = { gtk = {

View file

@ -1,6 +1,7 @@
{ {
config, config,
lib, lib,
pkgs,
... ...
}: with lib; let }: with lib; let
cfg = config.myOptions.themes.cursor; cfg = config.myOptions.themes.cursor;
@ -8,12 +9,12 @@
in { in {
options.myOptions.themes.cursor = { options.myOptions.themes.cursor = {
enable = mkEnableOption "enable cursor theming"; enable = mkEnableOption "enable cursor theming";
package = mkOption { src = mkOption {
description = "cursor theme package"; description = "hyprcursor theme tar url";
type = types.package; type = types.path;
}; };
name = mkOption { name = mkOption {
description = "cursor theme name"; description = "hyprcursor theme name";
type = types.str; type = types.str;
}; };
size = mkOption { size = mkOption {
@ -24,15 +25,26 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.sessionVariables = { environment.sessionVariables = {
XCURSOR_THEME = "${cfg.name}"; HYPRCURSOR_THEME = cfg.name;
XCURSOR_SIZE = "${toString cfg.size}"; HYPRCURSOR_SIZE = toString cfg.size;
}; };
home-manager.users.${username} = { home-manager.users.${username} = {
home.pointerCursor = { home.file.".local/share/icons" = {
inherit (cfg) package name size; source = with pkgs; stdenvNoCC.mkDerivation (finalAttrs: {
gtk.enable = true; pname = cfg.name;
x11.enable = true; version = "0.1.0";
inherit (cfg) src;
buildPhase = ''
runHook preBuild
mkdir -p $out
tar -C $out -x -f $src
runHook postBuild
'';
});
recursive = true;
}; };
}; };
}; };