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

Use of hyprcursor for hyprland #478

Open
Eddio0141 opened this issue Jul 21, 2024 · 10 comments
Open

Use of hyprcursor for hyprland #478

Eddio0141 opened this issue Jul 21, 2024 · 10 comments
Labels
feature A new feature or a feature request

Comments

@Eddio0141
Copy link

https://wiki.hyprland.org/Hypr-Ecosystem/hyprcursor/

I don't see anything related to hyprcursor here, so I'm opening this
Is there a reason it's not used? Or was this just not added yet

@trueNAHO
Copy link
Collaborator

I don't see anything related to hyprcursor here, so I'm opening this

Thanks for pointing this out!

Is there a reason it's not used? Or was this just not added yet

It was just not added yet.

@trueNAHO trueNAHO added the feature A new feature or a feature request label Jul 21, 2024
@danth
Copy link
Owner

danth commented Jul 21, 2024

From the page you linked, I get the impression that Hyprcursor is simply an alternative file format for cursor themes. Are there any benefits to supporting this compared to using the traditional Xcursor format? According to the page, Hyprland supports both and will fall back to the traditional format if Hyprcursor is not configured.

@Eddio0141
Copy link
Author

You can read https://github.com/hyprwm/hyprcursor for more information, but as far as I know, its overall better than xcursor
Hyprland itself has it built in already and only needs 2 env vars to enable it, so I don't see any downsides to adding this

@danth
Copy link
Owner

danth commented Jul 22, 2024

The main downside is that Xcursor will still be required for other compositors / apps which don't support Hyprcursor, so we have to support both formats as well as converting between them if possible

@trueNAHO
Copy link
Collaborator

IMHO, Vaxry's high-quality projects might eventually become the standard.

The main downside is that Xcursor will still be required for other compositors / apps which don't support Hyprcursor

Users not switching fully to Vaxry's ecosystem would face system bloat from duplicating functionalities.

Would it be a good idea to integrate Hyprcursor into the Stylix Hyprland module?

@jaredmontoya
Copy link

I support adding support for hyprcursors, but I am not sure if there are any hyprcursor themes in nixpkgs at the moment to test stylix support with.

I use bibata-cursors nixpkg, and it does not have a hyprcursor variant generated in it's output.

Someone could implement an overridable parameter for the bibata-cursors package that will allow to switch between cursor formats that are being generated.

Maybe somerthing like this will be approved by package maintainers:

cursor.package = pkgs.bibata-cursors; # cursorFormat is set to xcursor by default for backwards compatibility
cursor.package = pkgs.bibata-cursors.override { cursorFormat = "xcursor"; };
cursor.package = pkgs.bibata-cursors.override { cursorFormat = "hyprcursor"; };

To do that one will have to wait until clickgen supports hyprcursors and I think that it will because the issue for this is opened by the maintainer.

@colexbruhn
Copy link

I think we could get away with something a lot simpler. Hyprcursor provides hyprcursor-util which enables us to convert any xcursor packages to a hyprcursor compatible version.

So let's say the user specifies something like:

cursor.package = pkgs.bibata-cursors;

And then the cursors get installed somewhere like ~/.icons/bibata-cursors.

Then we could run:

# extract intermediate "working state"
hyprcursor-util -x ~/.icons/bibata-cursors -o ~/.icons/bibata-cursors-temp
# generate the hyprcursor compatible version
hyprcursor-util -c ~/.icons/bibata-cursors-temp -o ~/.icons/bibata-cursors-hypr
# remove leftover intermediate state
rm -rf ~/.icons/bibata-cursor-temp

Then we can just tell hyprland to use ~/.icons/bibata-cursors-hypr. This way, the user only needs to specify an xcursor theme, and the rest happens auto-magically.

@jaredmontoya
Copy link

I am not an expert in cursors so correct me if I am wrong.

As far as I know:

  1. xcursor format is a collection of raster images.
  2. hyprcursor allows to render the cursor from SVGs.
  3. if 1 is true and we convert xcursor to hyprcursor the resulting hyprcursor will not be infinitely crisp as a hyprcursor built from "source SVGs" defeating the purpose of using hyprcursor in the first place.

@danth
Copy link
Owner

danth commented Aug 5, 2024

Yes, converting Xcursor to Hyprcursor has no benefits as far as I can see, since Hyprland can load Xcursor directly anyway. Conversion in the other direction could be useful however.

See here (taken from #102) for an attempt at supporting different file formats under the same option, with automatic conversion between them - we may want to use something similar here.

@trueNAHO
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature or a feature request
Projects
None yet
Development

No branches or pull requests

5 participants