feat(hypr): use hyprcursor for cursor theme
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-07-23 16:04:18 -04:00
parent 3e1df66156
commit b307e7df13
3 changed files with 52 additions and 3 deletions

View file

@ -10,6 +10,11 @@ pkgs.lib.makeScope pkgs.newScope (drac: {
gtk = import ./gtk.nix {inherit (inputs) gtk-theme-src pkgs;}; gtk = import ./gtk.nix {inherit (inputs) gtk-theme-src pkgs;};
hyprcursor = drac.callPackage ./hyprcursor.nix {
inherit (inputs) gtk-theme-src mkVersion;
inherit pkgs;
};
plymouth = drac.callPackage ./plymouth.nix { plymouth = drac.callPackage ./plymouth.nix {
inherit (inputs) dracula-plymouth-src mkVersion; inherit (inputs) dracula-plymouth-src mkVersion;
}; };

View file

@ -0,0 +1,29 @@
{
gtk-theme-src,
mkVersion,
pkgs,
stdenv,
...
}:
stdenv.mkDerivation {
pname = "dracula-hyprcursor";
version = mkVersion gtk-theme-src;
src = "${gtk-theme-src}/kde/cursors";
buildInputs = with pkgs; [hyprcursor xcur2png];
installPhase = ''
hyprcursor-util --extract ./Dracula-cursors
hyprcursor-util --create ./extracted_Dracula-cursors
cat <<EOF > ./extracted_Dracula-cursors/manifest.hl
name = Dracula-cursors
description = Automatically extracted with hyprcursor-util
version = 0.1
cursors_directory = hyprcursors
EOF
mv 'theme_Extracted Theme' $out
'';
}

View file

@ -1,17 +1,32 @@
{config, ...}: let {
config,
pkgs,
self,
...
}: let
inherit (config.vars) configDir; inherit (config.vars) configDir;
cursorTheme = self.legacyPackages.${pkgs.system}.dracula.hyprcursor;
cursorThemeName = "Dracula-cursors";
hyprcursorThemeName = "Dracula-hyprcursor";
cursorSize = "24";
in { in {
imports = [ imports = [
../../home/theme ../../home/theme
../../home/hyprpaper.nix ../../home/hyprpaper.nix
]; ];
home.file.".local/share/icons/${hyprcursorThemeName}".source = cursorTheme;
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
settings = { settings = {
envd = ["XCURSOR_SIZE, 24"]; envd = [
"XCURSOR_THEME, ${cursorThemeName}"
"XCURSOR_SIZE, ${cursorSize}"
];
exec-once = [ exec-once = [
"hyprctl setcursor Dracula-cursors 24" "hyprctl setcursor ${hyprcursorThemeName} ${cursorSize}"
"hyprpaper" "hyprpaper"
]; ];