Giter Club home page Giter Club logo

hyprcursor's People

Contributors

earboxer avatar fred21o4 avatar fufexan avatar ikalco avatar jinliu avatar paideiadilemma avatar pebble-24 avatar regit avatar rudolchr avatar solopasha avatar sosedik avatar vaxerski avatar visual-dawg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hyprcursor's Issues

error: ‘Hyprlang::SConfigOptions’ has no non-static data member named ‘pathIsStream’ while building from source

OS: Archlinux
I have installed all the dependencies specified in the readme.
When I run the command

cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`

I am getting compilation error. Here is the log

cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is GNU 13.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.1.0")
-- Checking for modules 'hyprlang>=0.4.0;libzip;cairo;librsvg-2.0'
--   Found hyprlang, version 0.4.1
--   Found libzip, version 1.10.1
--   Found cairo, version 1.18.0
--   Found librsvg-2.0, version 2.57.2
-- Configuring hyprcursor in Release
-- Checking for modules 'hyprlang>=0.4.0;libzip'
--   Found hyprlang, version 0.4.1
--   Found libzip, version 1.10.1
-- Configuring done (1.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/gireesh/gits/hyprcursor/build
[ 22%] Building CXX object hyprcursor-util/CMakeFiles/hyprcursor-util.dir/src/main.cpp.o
[ 22%] Building CXX object CMakeFiles/hyprcursor.dir/libhyprcursor/hyprcursor_c.cpp.o
[ 33%] Building CXX object CMakeFiles/hyprcursor.dir/libhyprcursor/hyprcursor.cpp.o
/home/gireesh/gits/hyprcursor/hyprcursor-util/src/main.cpp: In function ‘std::string spawnSync(const std::string&)’:
/home/gireesh/gits/hyprcursor/hyprcursor-util/src/main.cpp:286:50: warning: ignoring attributes on template argument ‘int (*)(FILE*)’ [-Wignored-attributes]
  286 |     const std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd.c_str(), "r"), pclose);
      |                                                  ^
/home/gireesh/gits/hyprcursor/libhyprcursor/hyprcursor.cpp: In function ‘cairo_status_t readPNG(void*, unsigned char*, unsigned int)’:
/home/gireesh/gits/hyprcursor/libhyprcursor/hyprcursor.cpp:511:36: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
  511 |     std::memcpy(output, DATA->data + DATA->readNeedle, toRead);
      |                         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/home/gireesh/gits/hyprcursor/libhyprcursor/hyprcursor.cpp: In member function ‘std::optional<std::__cxx11::basic_string<char> > CHyprcursorImplementation::loadTheme()’:
/home/gireesh/gits/hyprcursor/libhyprcursor/hyprcursor.cpp:586:109: error: ‘Hyprlang::SConfigOptions’ has no non-static data member named ‘pathIsStream’
  586 |             meta = std::make_unique<Hyprlang::CConfig>(buffer, Hyprlang::SConfigOptions{.pathIsStream = true});
      |                                                                                                             ^
make[2]: *** [CMakeFiles/hyprcursor.dir/build.make:76: CMakeFiles/hyprcursor.dir/libhyprcursor/hyprcursor.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:861: CMakeFiles/hyprcursor.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 44%] Linking CXX executable hyprcursor-util
[ 44%] Built target hyprcursor-util
make: *** [Makefile:146: all] Error 2

Fails to build from git

Traced back to 92af141a01e2882df68d32ed66def2918dc0c40f (PR)

ninja: job failed: /usr/bin/x86_64-pc-linux-gnu-g++ -DHYPRCURSOR_VERSION=\"0.1.7\" -I/var/tmp/portage/gui-libs/hyprcursor-9999/work/hyprcursor-9999/./include -I/var/tmp/portage/gui-libs/hyprcursor-9999/work/hyprcursor-9999/./libhyprcursor -I/var/tmp/portage/gui-libs/hyprcursor-9999/work/hyprcursor-9999/./hyprcursor-util/src -isystem /usr/include/librsvg-2.0 -isystem /usr/include/gdk-pixbuf-2.0 -isystem /usr/include/webp -isystem /usr/lib64/libffi/include -isystem /usr/include/libmount -isystem /usr/include/blkid -isystem /usr/include/cairo -isystem /usr/include/libpng16 -isystem /usr/include/freetype2 -isystem /usr/include/harfbuzz -isystem /usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include -isystem /usr/include/pixman-1  -march=znver1 -mtune=znver1 -O2 -pipe -std=gnu++23 -O3 -pthread -DTOML_HEADER_ONLY=0 -DTOML_SHARED_LIB=1 -MD -MT CMakeFiles/hyprcursor-util.dir/hyprcursor-util/src/main.cpp.o -MF CMakeFiles/hyprcursor-util.dir/hyprcursor-util/src/main.cpp.o.d -o CMakeFiles/hyprcursor-util.dir/hyprcursor-util/src/main.cpp.o -c /var/tmp/portage/gui-libs/hyprcursor-9999/work/hyprcursor-9999/hyprcursor-util/src/main.cpp
/var/tmp/portage/gui-libs/hyprcursor-9999/work/hyprcursor-9999/hyprcursor-util/src/main.cpp: In function ‘std::optional<std::__cxx11::basic_string<char> > createCursorThemeFromPath(const std::string&, const std::string&)’:
/var/tmp/portage/gui-libs/hyprcursor-9999/work/hyprcursor-9999/hyprcursor-util/src/main.cpp:185:74: error: ‘ZIP_LENGTH_TO_END’ was not declared in this scope
  185 |         zip_source_t* meta    = zip_source_file(zip, METADIR.c_str(), 0, ZIP_LENGTH_TO_END);
      |                                                                          ^~~~~~~~~~~~~~~~~
/var/tmp/portage/gui-libs/hyprcursor-9999/work/hyprcursor-9999/hyprcursor-util/src/main.cpp: In function ‘std::string spawnSync(const std::string&)’:
/var/tmp/portage/gui-libs/hyprcursor-9999/work/hyprcursor-9999/hyprcursor-util/src/main.cpp:222:50: warning: ignoring attributes on template argument ‘int (*)(FILE*)’ [-Wignored-attributes]
  222 |     const std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd.c_str(), "r"), pclose);
      |  

Cursor goes to largest size when using fractional scaling and png cursors

I tried to extract a cursor png theme however when I set my cursor size to 24 the cursor was massive. I noticed that when I switched from my normal scale of 1.6 to 1 the cursor size went back to normal. It seems like it's just defaulting to the largest cursor size when using fractional scaling.

Cursor Size ignored on most apps/layer

Main Problem

I've extracted a png cursor theme and replaced all the png files with one svg-file for the whole set. It seems that this also worked, sinde the correct cursor-theme is displayed using this part in the hyprland.conf

# Environment Variables
env = HYPRCURSOR_THEME,"Future Cyan"
env = HYPRCURSOR_SIZE,30

However the icons are correct but the size is ignored by most layers or applications. For example the main desktop (without anything open, so only wallpaper visible) shows the smalles possible option (size 24). Brave browser behaves the same.
In some layers, for example VSCodium (Wayland mode) or even on waybar the actual setting is performed and the cursor switches to the size I've defined.

Additional Information

In all of the meta.hl-files I did define the size 24 for the svg. This is supposed too be no problem, if i understood the doc correctly. Here is an example-file:

resize_algorithm = bilinear
hotspot_x = 0.17
hotspot_y = 0.17

define_override = default
define_override = left_ptr

define_size = 24, arrow.svg

I've also tried to use size 0 in the define_size block, based on this comment:

"svg should always have the size 0, as they do not have a size. Multiple svg will be treated as an animation."
Originally posted by @vaxerski in #16 (comment)

However that did not change the behaviour of the corresponding cursor.

hyprcursor-util extraction fails with parentheses in directory name

When running hyprcursor-util --extract on a directory with a paren in the name extraction fails with the following error

Found xcursor lr_angle
sh: -c: line 1: syntax error near unexpected token `('
sh: -c: line 1: `rm -f /tmp/hyprcursor-util/* && cd /tmp/hyprcursor-util && xcur2png /home/radical/HyprcursorTest/Capitaine Cursors (Gruvbox)/cursors/lr_angle -d /tmp/hyprcursor-util 2>&1'
Failed: Failed reading xconfig for /home/radical/HyprcursorTest/Capitaine Cursors (Gruvbox)/cursors/lr_angle

In my case the folder name was Capitaine Cursors (Gruvbox) , I tested that it was in fact just the paren causing the issue by renaming the directory test and the extraction completed successfully. Running it again after renaming the directory test( caused it to fail again.

Hyprland crashes if user doesnt have access to a folder in /usr/share/icons

(this is my first issue, like ever, so let me know if i've done something wrong)

Bug description

This bug causes Hyprland to crash when trying to load all of the cursors from /usr/share/icons (I presume) when Hyprland starts. (on v0.36.0 & v0.35.0 from my testing)

How to reproduce

Make a new folder in /usr/share/icons, run sudo chmod 0 /usr/share/icons/$foldername (to remove permissions), and restart Hyprland. You will find that Hyprland crashes. (Might also be an issue with ~/.local/share/icons, haven't tested it yet)

I am not very experienced in C nor C++ (i'm trying to learn them), so I'm not quite sure where to start to try to fix this bug, but if i had to guess, it'd start at line 61 in libhyprcursor/hyprcursor.cpp ?? (maybe, again not sure)

Logs:

these logs won't really help because it's likely an issue with this library, but im providing them just in case my steps on reproducing them doesn't work or it's helpful to have:
obraz
hyprlandCrashReport5570.txt
hyprlandCrashReport3883.txt

Hyprcursor won't set

I've been trying to set a cursor theme, it's downloaded, extracted, at the right place.
The env vars are in in a config file.
But the cursor won't show up, i tried with multiple themes

icons
├── hicolor
│   ├── 128x128
│   ├── 16x16
│   ├── 20x20
│   ├── 24x24
│   ├── 256x256
│   ├── 32x32
│   ├── 48x48
│   ├── 64x64
│   ├── 96x96
│   └── icon-theme.cache
├── HyprBibataModernClassicSVG
│   ├── hyprcursors
│   ├── LICENSE
│   └── manifest.hl
└── rose-pine-hyprcursor
    ├── default.nix
    ├── hyprcursors
    ├── LICENSE
    ├── manifest.hl
    └── README.md

i tried

env = HYPRCURSOR_THEME,HyprBibataModernClassicSVG/rose-pine-hyprcursor
env = HYPRCURSOR_SIZE,32

Also hyprcursor is installed, i have the command hyprcursor-utils in path
hyprctl setcursor HyprBibataModernClassicSVG/rose-pine-hyprcursor [any integer] doesn't change anything

Note: the / is just to say i tried with both indidual args

bug: tag 0.1.8

Arch Linux, hyprland, kitty.

I update hyprcursor from hyprcursor-0.1.7-1-x86_64.pkg.tar.zst to hyprcursor-0.1.8-1-x86_64.pkg.tar.zst. bug appear.

  1. open two application on windows, one of that is kitty.
  2. cursor move out of kitty
  3. kitty do not work, It is freeze.

then, I paru -U /var/cache/pacman/pkg/hyprcursor-0.1.7-1-x86_64.pkg.tar.zst, back to 0.1.7-1, bug disappears.

`HYPRCURSOR_THEME,MyCursor` env Ignored in v0.1.6

Setting HYPRCURSOR_THEME,MyCursor in hyprland.conf don't have effect, when changing between hyprcursors, git bisect points to commit f4ea029 as the culprit.
I have two Hyprcursor themes HyprBibataModernClassicSVG, and rose-pine-hyprcursor both located in ~/.local/share/icons to avoid issues, I hope this be useful.

Cursor disappears on youtube

So I recently updated hyprland and installed hyprcursor with it. I created a theme with hyprcursor-utils from an xcursor theme (Qogir-dark) and added the following lines to my conf:

env = XCURSOR_SIZE,24
env = XCURSOR_THEME,Qogir-dark
env = HYPRCURSOR_THEME,extracted_Qogir-dark
env = HYPRCURSOR_SIZE,24

Works well so far. The only problem I face is that my cursor disappears on youtube. Specifically when hovering over the video while the progress bar hides due to cursor inactivity. The cursor disappears with the ui but does not reappear when moved. It only comes back when moving to another screen. This Problem also seems to occur when hovering over embedded videos on other websites.

Tested on both chromium and brave with ozone-platform wayland enabled

Nominal size vs. actual image size

XCursor has the distinction between nominal size and image size. (See XcursorImage in https://www.x.org/releases/X11R7.5/doc/man/man3/Xcursor.3.html)

IIUC, in hyprcursor metadata, e.g. "define_size = 64, image64.png", the "64" is the nominal size. The actual size of "image64.png" is not necessarily 64x64.

For example, KDE's Breeze cursor theme has a nominal size of 24, but pixmaps are all 32x32 (so is the canvas size of source SVGs). I don't know why it was done this way, but it's the status quo.

Then there are two problems:

  1. For PNGs, libhyprcursor renders the top-left nominal_size x nominal_size part of the image. So if I use hyprcursor-util to convert the current Breeze cursor XCursor file to hyprcursor format, many cursors would be truncated.

  2. For SVGs, libhyprcursor renders the SVG at the nominal size. That would render current Breeze SVG files smaller (at 24x24) than they are designed (32x32) in the 100% scale.

There are two ways to fix this:

  1. Require all PNGs and SVGs to be exactly at the nominal size, with no margins as XCursor allows. I can manually remove margins from Breeze SVG files and make them 24x24. But this would mean that converting from XCursor might not work for some cursor themes.

  2. Adopt the nominal size vs. actual size idea from XCursor:
    a) Render PNG at its embedded size instead of the nominal size.
    b) Define hotspot as "hotspot_coord / actual_image_size", since it can be greater than the nominal size.
    c) Also define a nominal size of SVGs. E.g. with "define_size = 24, image.svg", and if "image.svg" has a canvas size of 32x32, then libhyprcursor would render a cursor at nominal size 48, by rendering the SVG at size 32x(48/24)=64.

2.c also has the extra benefit that we can have different SVGs for different sizes, like how SVG icons are handled.

Hyprcusor util creation fails with error "Failed: (2) failed to add image *.svg to hlc"

Error

Failed: (2) failed to add image hand1.svg to hlc

Steps to reproduce:

I followed Vaxry's blog https://blog.vaxry.net/articles/2024-cursors

  1. Fetch latest version of Bibata Modern
  2. hyprcusor-util --extract
  3. Replace .pngs with svgs
  4. Update corresponding meta.hl
  5. Update Manifest.hl
  6. hyprcusor-util --create

Hyprcursor versions:

  1. master
  2. v0.1.4

Logs

Contents of hand1

LS

hand1.svg
meta.hl

meta.hl

resize_algorithm = bilinear
hotspot_x = 0.56
hotspot_y = 0.25

define_size = 16, hand1.svg
define_size = 20, hand1.svg
define_size = 22, hand1.svg
define_size = 24, hand1.svg
define_size = 28, hand1.svg
define_size = 32, hand1.svg
define_size = 40, hand1.svg
define_size = 48, hand1.svg
define_size = 56, hand1.svg
define_size = 64, hand1.svg
define_size = 72, hand1.svg
define_size = 80, hand1.svg
define_size = 88, hand1.svg
define_size = 96, hand1.svg

define_override = grab
define_override = openhand
hyprcursor Log
hyprcursor-util --create ~/.local/src/xcursors/extracted_Bibata-Modern-Ice_01
Shape hand1:
	overrides: 2
	sizes: 14
Shape copy:
	overrides: 3
	sizes: 14
Shape tcross:
	overrides: 1
	sizes: 14
Shape top_left_corner:
	overrides: 1
	sizes: 14
Shape move:
	overrides: 5
	sizes: 14
Shape dotbox:
	overrides: 4
	sizes: 14
Shape plus:
	overrides: 1
	sizes: 14
Shape grabbing:
	overrides: 4
	sizes: 14
Shape question_arrow:
	overrides: 5
	sizes: 14
Shape fd_double_arrow:
	overrides: 3
	sizes: 14
Shape zoom-in:
	overrides: 0
	sizes: 14
Shape bottom_side:
	overrides: 1
	sizes: 14
Shape crosshair:
	overrides: 0
	sizes: 14
Shape right_side:
	overrides: 1
	sizes: 14
Shape sb_h_double_arrow:
	overrides: 8
	sizes: 14
Shape bd_double_arrow:
	overrides: 3
	sizes: 14
Shape top_right_corner:
	overrides: 1
	sizes: 14
Shape sb_left_arrow:
	overrides: 1
	sizes: 14
Shape crossed_circle:
	overrides: 2
	sizes: 14
Shape ur_angle:
	overrides: 0
	sizes: 14
Shape top_tee:
	overrides: 0
	sizes: 14
Shape bottom_tee:
	overrides: 0
	sizes: 14
Shape left_ptr_watch:
	overrides: 4
	sizes: 742
Shape right_tee:
	overrides: 0
	sizes: 14
Shape hand2:
	overrides: 4
	sizes: 14
Shape pencil:
	overrides: 1
	sizes: 14
Shape cross:
	overrides: 2
	sizes: 14
Shape bottom_left_corner:
	overrides: 1
	sizes: 14
Shape sb_right_arrow:
	overrides: 1
	sizes: 14
Shape right_ptr:
	overrides: 2
	sizes: 14
Shape circle:
	overrides: 1
	sizes: 14
Shape zoom-out:
	overrides: 0
	sizes: 14
Shape pointer-move:
	overrides: 0
	sizes: 14
Shape sb_v_double_arrow:
	overrides: 9
	sizes: 14
Shape dnd-link:
	overrides: 1
	sizes: 14
Shape context-menu:
	overrides: 0
	sizes: 14
Shape wayland-cursor:
	overrides: 0
	sizes: 14
Shape top_side:
	overrides: 1
	sizes: 14
Shape X_cursor:
	overrides: 2
	sizes: 14
Shape wait:
	overrides: 1
	sizes: 742
Shape vertical-text:
	overrides: 0
	sizes: 14
Shape left_tee:
	overrides: 0
	sizes: 14
Shape left_ptr:
	overrides: 3
	sizes: 14
Shape left_side:
	overrides: 1
	sizes: 14
Shape xterm:
	overrides: 2
	sizes: 14
Shape link:
	overrides: 3
	sizes: 14
Shape dnd-ask:
	overrides: 0
	sizes: 14
Shape sb_down_arrow:
	overrides: 1
	sizes: 14
Shape lr_angle:
	overrides: 0
	sizes: 14
Shape bottom_right_corner:
	overrides: 1
	sizes: 14
Shape sb_up_arrow:
	overrides: 1
	sizes: 14
Shape center_ptr:
	overrides: 0
	sizes: 14
Shape ul_angle:
	overrides: 0
	sizes: 14
Shape dnd_no_drop:
	overrides: 1
	sizes: 14
Shape ll_angle:
	overrides: 0
	sizes: 14
Shape dnd-copy:
	overrides: 0
	sizes: 14
About to delete (recursively) /home/arvind/.local/src/xcursors//theme_BibataIce Hyprcursor/, are you sure? [Y/n]
y
Added image hand1.svg to shape hand1
Failed: (2) failed to add image hand1.svg to hlc

Can't compile with Clang 18

When trying to compile hypercursor 0.1.4 with Clang 18.1.1 but compilation failed with this error:

/builddir/build/BUILD/hyprcursor-0.1.4/libhyprcursor/hyprcursor.cpp:511:36: error: arithmetic on a pointer to void
DEBUG util.py:446:    511 |     std::memcpy(output, DATA->data + DATA->readNeedle, toRead);
DEBUG util.py:446:        |                         ~~~~~~~~~~ ^
DEBUG util.py:446:  1 warning and 1 error generated.
DEBUG util.py:446:  make[2]: *** [CMakeFiles/hyprcursor.dir/build.make:79: CMakeFiles/hyprcursor.dir/libhyprcursor/hyprcursor.cpp.o] Error 1
DEBUG util.py:446:  make[1]: *** [CMakeFiles/Makefile2:864: CMakeFiles/hyprcursor.dir/all] Error 2
DEBUG util.py:446:  make[1]: *** Waiting for unfinished jobs....

Full build log: https://file-store.openmandriva.org/api/v1/file_stores/a426314c66e81d4392317f89a6cb119306d83835.log?show=true

I will add that it compiles correctly when using the GCC compiler, but my distribution tries to compile all (almost) packages with LLVM/Clang.

Cropped cursors from hyprcursor-util

Hey there, I've been playing around with hyrpcursor-util, converting breeze cursors, and eventually some other major cursor themes, but I've found some of the cursors have cropping. Or there's some other rendering issue that unrelated to the creation.

Fix build under Debian sid

Libzip 1.10.1 that is mandatory since 1f4c960 is not available on distribution like Debian sid so the build is not possible on these distros.

hyprcursor-util ignores overrides

Hi,

When trying to build a cursor using hyprctl-util, all my define_override settings get ignored.
The log messages show overrides: 0 for every cursor.

This happens with v0.1.6 and v0.1.7.
The unzipped .hlc files contain a meta.hl where overrides are missing too.

Using hyprcursor in KDE

Hi. I'm working on adding SVG cursors to the KDE compositor kwin:
https://invent.kde.org/plasma/breeze/-/merge_requests/433

and just saw your work. I'd prefer to use your format, and eventually make it a freedesktop.org standard.

There are a few concerns using it in KDE though:

  1. The metadata file is in Hyprlang format, which is unfamiliar to KDE devs/users.

From https://github.com/hyprwm/hyprcursor/blob/main/docs/MAKING_THEMES.md it seems the actual format used is similar enough to a INI/desktop file, so can we use that instead?

Changes needed:
a) Add section headers, e.g. "[General]"
b) Same-named entries like

define_size = 64, image64.png
define_size = 32, image32.png

need to be merged:

define_size = 64, image64.png; 32, image32.png
  1. I'd like to deploy the hyprcursor format of a cursor theme side-by-side with the xcursor format. So it would be good if manifest.hl is merged into xcursor's index.theme (which already has fields for name and description), so a cursor theme can have one index.theme file and both cursors and hyprcursors dir for traditional and cursor-shape-v1-enabled apps.

  2. Instead of librsvg, in KDE we might want to use QtSVG to render SVG files. So can we have:
    a) An interface to only get the metadata part, i.e. the SVG/PNG filename, hotspot, etc., but not doing the actual rendering.
    b) A build option to only build that interface, not introducing librsvg and cairo dependencies.

Build error #include <toml++/toml.hpp>

Hi, I cloned the actual version 0.16 and ran cmake:

~/Downloads/hyprcursor/libhyprcursor/manifest.cpp:3:10: fatal error: toml++/toml.hpp: No such file or directory
    3 | #include <toml++/toml.hpp>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/hyprcursor.dir/build.make:118: CMakeFiles/hyprcursor.dir/libhyprcursor/manifest.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
~/Downloads/hyprcursor/libhyprcursor/meta.cpp:4:10: fatal error: toml++/toml.hpp: No such file or directory
    4 | #include <toml++/toml.hpp>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/hyprcursor.dir/build.make:132: CMakeFiles/hyprcursor.dir/libhyprcursor/meta.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:848: CMakeFiles/hyprcursor.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

A little reading of the toml++ documentation (https://marzer.github.io/tomlplusplus/#mainpage-adding-lib-old-school)
did the "regular flavor" items

Caused a warning, but it worked:

~/Downloads/hyprcursor/tests/c_test.c: In function ‘main’:
~/Downloads/hyprcursor/tests/c_test.c:35:31: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
   35 |     printf("left_ptr images: %d\n", shapeData->len);
      |                              ~^     ~~~~~~~~~~~~~~
      |                               |              |
      |                               int            long unsigned int
      |                              %ld
~/Downloads/hyprcursor/tests/c_test.c:38:39: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
   38 |         printf("left_ptr image size: %d\n", shapeData->images[i].len);
      |                                      ~^     ~~~~~~~~~~~~~~~~~~~~~~~~
      |                                       |                         |
      |                                       int                       long unsigned int
      |                                      %ld
[ 78%] Linking C executable hyprcursor_test_c
[ 78%] Built target hyprcursor_test_c
[ 85%] Linking CXX executable hyprcursor_test1
[ 92%] Linking CXX executable hyprcursor_test2
[ 92%] Built target hyprcursor_test1
[ 92%] Built target hyprcursor_test2
[100%] Linking CXX executable hyprcursor-util
[100%] Built target hyprcursor-util

Afterwards when trying to build hyprland I got the same toml++ error.

I'm not sure if it's a problem of missing files in the repo or in my system.

Improve docs

The current state is like this (my yesterday's experience of trying to convert KDEs Breeze Light to hyprcursor):

  1. Open Hyprland wiki, Hyprcursor. It says go to github

  2. Open this repo. It says go read ./docs

  3. There are 3 files there. Okay, checking all of them

  4. One says go read stuff of hyprcursor-util (why isn't the binary just hyprcursor btw?). Mkay, I guess, somewhat helpful.

  5. Time to play with the binary. No -h/--help there. Okay, it's C++ after all, there are no CLI parsing libs and adding/mananaging dependencies is kinda pain in the arse (hi, cargo add clap --features derive).

In the end something like this works, but it's not user-freindly and is somewhat time consuming to get there:

hyprcursor-util --extract /usr/share/icons/breeze/<forgot-im-on-mobile-but-thatpath-is-important> -o /tmp/extracted-breeze-cursors

# edit theme meta
nvim /tmp/extracted.../manifest.hl

# optimize png, cause why not
oxipng -o max /tmp/extracted.../**.png

# actually create a hyprcursor theme
hyprcursor-util --create /tmp/extracted... -o my-supa-dupa-theme

mv my-supa-dupa-theme ~/.local/share/icons

hyprctl setcursor 'Theme name from manifest.hl' <cursor-size>

It's hard to expect any adoption if such basic scenario isn't trivial to find.

Can we add something like this to main README.md. I would carefully assume that this what an average Joe wants when he tries to switch to new cool hyprcursor. Converting an existing XCursor theme should be trivial, if no edits are needed (let's not talk about animations here). I didn't edit anything but name/description in the manifest file, as you can see.

compile error "round not a member of std"

i've got CLANG 17 installed do i need 18? Arch hasn't updated it yet but I can manually compile it if need be.

[ 7%] Building CXX object CMakeFiles/hyprcursor.dir/libhyprcursor/hyprcursor.cpp.o
/home/da5id/tmp/hyprcursor/libhyprcursor/hyprcursor.cpp: In member function ‘SCursorImageData** Hyprcursor::CHyprcursorManager::getShapesC(int&, const char*, const Hyprcursor::SCursorStyleInfo&)’:
/home/da5id/tmp/hyprcursor/libhyprcursor/hyprcursor.cpp:338:34: error: ‘round’ is not a member of ‘std’; did you mean ‘std::chrono::round’?
338 | data[i]->hotspotX = std::round(hotX * (float)data[i]->size);
| ^~~~~
In file included from /usr/include/c++/13.2.1/bits/fs_fwd.h:37,
from /usr/include/c++/13.2.1/filesystem:48,
from /home/da5id/tmp/hyprcursor/libhyprcursor/hyprcursor.cpp:5:
/usr/include/c++/13.2.1/bits/chrono.h:1084:7: note: ‘std::chrono::round’ declared here
1084 | round(const time_point<_Clock, _Dur>& __tp)
| ^~~~~
/home/da5id/tmp/hyprcursor/libhyprcursor/hyprcursor.cpp:339:34: error: ‘round’ is not a member of ‘std’; did you mean ‘std::chrono::round’?
339 | data[i]->hotspotY = std::round(hotY * (float)data[i]->size);
| ^~~~~
/usr/include/c++/13.2.1/bits/chrono.h:1084:7: note: ‘std::chrono::round’ declared here
1084 | round(const time_point<_Clock, _Dur>& __tp)
| ^~~~~
make[2]: *** [CMakeFiles/hyprcursor.dir/build.make:90: CMakeFiles/hyprcursor.dir/libhyprcursor/hyprcursor.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:848: CMakeFiles/hyprcursor.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

Hyprland crashes with svg-cursor for left pointer

I tried to convert my customized Bibata-Modern cursor, extraced via hyprcursor-util, replaced pngs with svgs from Bibata_Cursor repo (unmodified blue/green "original" files to see changes), compiled it and moved it to ~/.local/share/icons. No env variable set or anything.
The theme seems to be used automatically. This causes Hyprland to crash immediately on launch (log is attached). If I use the extraced png-version of the left pointer, everthing works fine. I can also just delete left_ptr.hlc from the compiled cursor and it will work as well, though without a default pointer. I also tried replacing the svg with one of the working cursors, it made no difference. I also attached the meta.hl for the cursor file.
Considering the exact cursor that causing me problems is the example from your blog post, I may be doing something wrong here.

System: Fedora 39
Hyprland 0.37.1
hyprcursor 0.1.4
both installed from https://copr.fedorainfracloud.org/coprs/solopasha/hyprland/
This is a laptop with an external screen, internal and external use different scaling (probably not relevant in this case).

meta.hl.txt

hyprlandCrashReport80840.txt

Cant install with AUR on arch linux

hi, the problem is that i cant install hyprcursor from the aur, it needs a bigger hyprlang version.
image
but, if i install the git version, then hyprlock and hypridle, sais that they cant find hyprland 0.4.2, or some shit. maybe the hypridle and hyprlock need to be ubdated to hyprlang > 0.4.4 or smth, plase help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.