Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bibata-hyprcursor not working for me #40

Open
ppenguin opened this issue Jul 2, 2024 · 3 comments
Open

bibata-hyprcursor not working for me #40

ppenguin opened this issue Jul 2, 2024 · 3 comments

Comments

@ppenguin
Copy link

ppenguin commented Jul 2, 2024

Inspired by your dotfiles (BTW the download link here

url = "https://cdn.discordapp.com/attachments/1216066899729977435/1216076659149504643/HyprBibataModernClassicSVG.tar.gz?ex=666c7f25&is=666b2da5&hm=713c14532d55604a3c2054e65f552578b599d21ccc93b3429dec5404f982313a&";
seems to be broken), I made a modified one (see below)

However, when setting the cursor, e.g. with

> hyprctl setcursor BibataHypr-Modern-Classic 26
ok

I see in the Hyprland log:

[hc] getFullPathForThemeName: found /home/jeroen/.local/share/icons/BibataHypr-Modern-Classic
[hc] Found theme BibataHypr-Modern-Classic at /nix/store/hk18adfbwfby1b4lwlmcgwb7zsymakgg-bibata-hyprcursor-1.0/share/icons/BibataHypr-Modern-Classic

[hc] loadThemeStyle: loading for size 39
[hc] Failed reading svg: XML parse error: Error domain 1 code 73 on line 3 column 51 of data: Couldn't find end of Start Tag circle line 3

[hc] getShapesC: found 0 images for left_ptr
[hc] getShapesC: found 0 images for left_ptr
[hc] getShapesC: found 0 images for default
[hc] getShapesC: found 0 images for left_ptr
[hc] getShapesC: found 0 images for left-ptr

and the cursor does not change, though hyprctl thinks there is no problem.

In other words, it is found but the svg data (compressed in the .hcl files as I understand) cannot be loaded.
BTW, I noticed that the name in the manifest is the original Bibata name, i.e. not the name of the directory, don't know if this plays a role?

The cursor package for nix (shas not yet finished):

{
  lib,
  stdenvNoCC,
  fetchurl,
  # bibata-cursors,
  variant ? "Modern-Classic",
}: let
  hcversion = "1.0";

  variants = {
    Modern-Classic = {
      url = "https://github.com/LOSEARDES77/Bibata-Cursor-hyprcursor/releases/download/${hcversion}/hypr_Bibata-Modern-Classic.tar.gz";
      name = "hypr_Bibata-Modern-Classic.tar.gz";
      sha256 = "sha256-+ZXnbI3bBLcb0nv2YW3eM/tK4dsraNM4UAO9BpSqfXk=";
    };
    Modern-Amber = {
      url = "https://github.com/LOSEARDES77/Bibata-Cursor-hyprcursor/releases/download/${hcversion}/hypr_Bibata-Modern-Amber.tar.gz";
      name = "hypr_Bibata-Modern-Amber.tar.gz";
      sha256 = lib.fakeSha256;
    };
    Modern-Ice = {
      url = "https://github.com/LOSEARDES77/Bibata-Cursor-hyprcursor/releases/download/${hcversion}/hypr_Bibata-Modern-Ice.tar.gz";
      name = "hypr_Bibata-Modern-Ice.tar.gz";
      sha256 = lib.fakeSha256;
    };
    Original-Classic = {
      url = "https://github.com/LOSEARDES77/Bibata-Cursor-hyprcursor/releases/download/${hcversion}/hypr_Bibata-Original-Classic.tar.gz";
      name = "hypr_Bibata-Original-Classic.tar.gz";
      sha256 = lib.fakeSha256;
    };
    Original-Amber = {
      url = "https://github.com/LOSEARDES77/Bibata-Cursor-hyprcursor/releases/download/${hcversion}/hypr_Bibata-Original-Amber.tar.gz";
      name = "hypr_Bibata-Original-Amber.tar.gz";
      sha256 = "sha256-WTXiuRje6VJlVDayvI9GzvKYNjdgXYqKRi8t2QRanDk=";
    };
    Original-Ice = {
      url = "https://github.com/LOSEARDES77/Bibata-Cursor-hyprcursor/releases/download/${hcversion}/hypr_Bibata-Original-Ice.tar.gz";
      name = "hypr_Bibata-Original-Ice.tar.gz";
      sha256 = lib.fakeSha256;
    };
  };
in
  stdenvNoCC.mkDerivation (finalAttrs: {
    pname = "bibata-hyprcursor";

    # inherit (bibata-cursors) version;
    version = hcversion;

    src = fetchurl {
      inherit (variants.${variant}) url name sha256;
    };

    installPhase = ''
      runHook preInstall

      mkdir -p $out/share/icons/BibataHypr-${variant}
      cp -r /build/manifest.hl /build/hyprcursors $out/share/icons/BibataHypr-${variant}/

      runHook postInstall
    '';

    meta = {
      description = "Open source, compact, and material designed cursor set";
      homepage = "https://github.com/LOSEARDES77/Bibata-Cursor-hyprcursor";
      license = lib.licenses.gpl3Only;
      platforms = lib.platforms.linux;
      maintainers = with lib.maintainers; [fufexan];
    };
  })
@fufexan
Copy link
Owner

fufexan commented Jul 4, 2024

https://github.com/LOSEARDES77/Bibata-Cursor-hyprcursor is not reliable, that's why I haven't used it. The svgs don't load because they're broken. If you open one in a text editor you can see that a sed call failed miserably, leaving stray { in almost all files.

About the broken URL, I'll probably upload the original theme somewhere more permanent.

@fufexan
Copy link
Owner

fufexan commented Jul 4, 2024

Fixed the broken url.

@ppenguin
Copy link
Author

Ah, thanks, that explains it. Any tips how to get correct SVG's for the other variants?

I had customised the package like so to get complete such functionality, but obviously the actual cursor sources suffer from the issue you mentioned:

{
  lib,
  stdenvNoCC,
  fetchurl,
  # bibata-cursors,
  variant ? "Modern-Classic",
}: let
  hcversion = "1.0";

  variants = {
    Modern-Classic = {
      url = "https://github.com/LOSEARDES77/Bibata-Cursor-hyprcursor/releases/download/${hcversion}/hypr_Bibata-Modern-Classic.tar.gz";
      name = "hypr_Bibata-Modern-Classic.tar.gz";
      sha256 = "sha256-+ZXnbI3bBLcb0nv2YW3eM/tK4dsraNM4UAO9BpSqfXk=";
    };
    Modern-Amber = {
      url = "https://github.com/LOSEARDES77/Bibata-Cursor-hyprcursor/releases/download/${hcversion}/hypr_Bibata-Modern-Amber.tar.gz";
      name = "hypr_Bibata-Modern-Amber.tar.gz";
      sha256 = lib.fakeSha256;
    };
    Modern-Ice = {
      url = "https://github.com/LOSEARDES77/Bibata-Cursor-hyprcursor/releases/download/${hcversion}/hypr_Bibata-Modern-Ice.tar.gz";
      name = "hypr_Bibata-Modern-Ice.tar.gz";
      sha256 = lib.fakeSha256;
    };
    Original-Classic = {
      url = "https://github.com/LOSEARDES77/Bibata-Cursor-hyprcursor/releases/download/${hcversion}/hypr_Bibata-Original-Classic.tar.gz";
      name = "hypr_Bibata-Original-Classic.tar.gz";
      sha256 = lib.fakeSha256;
    };
    Original-Amber = {
      url = "https://github.com/LOSEARDES77/Bibata-Cursor-hyprcursor/releases/download/${hcversion}/hypr_Bibata-Original-Amber.tar.gz";
      name = "hypr_Bibata-Original-Amber.tar.gz";
      sha256 = "sha256-WTXiuRje6VJlVDayvI9GzvKYNjdgXYqKRi8t2QRanDk=";
    };
    Original-Ice = {
      url = "https://github.com/LOSEARDES77/Bibata-Cursor-hyprcursor/releases/download/${hcversion}/hypr_Bibata-Original-Ice.tar.gz";
      name = "hypr_Bibata-Original-Ice.tar.gz";
      sha256 = lib.fakeSha256;
    };
  };
in
  stdenvNoCC.mkDerivation (finalAttrs: {
    pname = "bibata-hyprcursor";

    # inherit (bibata-cursors) version;
    version = hcversion;

    src = fetchurl {
      inherit (variants.${variant}) url name sha256;
    };

    installPhase = ''
      runHook preInstall

      mkdir -p $out/share/icons/BibataHypr-${variant}
      cp -r /build/manifest.hl /build/hyprcursors $out/share/icons/BibataHypr-${variant}/

      runHook postInstall
    '';

    meta = {
      description = "Open source, compact, and material designed cursor set";
      homepage = "https://github.com/LOSEARDES77/Bibata-Cursor-hyprcursor";
      license = lib.licenses.gpl3Only;
      platforms = lib.platforms.linux;
      maintainers = with lib.maintainers; [fufexan];
    };
  })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants