Skip to content

Morxemplum/posys-cursor-scalable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Posy's Cursor (Scalable)

loading

This is a cursor theme based on Posy's cursor by Michiel de Boer. Ever since he released a few SVGs of his cursor set, I used his SVGs to remake his theme entirely out of SVG, so it'll look great on a variety of HiDPI monitors. I also decided to make my own cursors on top of his, cursors for the Linux user.

Why did I do this?

Originally, I did this to create a hyprcursor theme, Hyprland's implementation of drawing the mouse cursor that abandons the XCursor used throughout the X Window System, switching from raster pixel maps to vector graphics. With the increasing adoption of higher resolutions, continuing to use XCursor introduces some big problems:

  • To account for various monitor sizes and increasing cursor sizes, multiple raster pixel maps of the same cursor have to be made and stored in a single XCursor.
  • These rasters are uncompressed. Even PNG offers lossless compression to save file space. Each pixel map is essentially storing a bitmap image.
  • This gets worse when the cursor is animated. For example, Posy's infamous rainbow hourglass consists of 75 unique frames. Each frame must be a separate pixel map, and that includes all the various sizes.

This snowballs into XCursor themes having huge file sizes that become noticable when entering the megabyte territory. Nobody likes wasted storage, especially for underlying system files like mouse cursors. By replacing the outdated XCursor format with a cursor implementation that uses vector graphics, only one vector map has to be made per cursor (or frame of an animation). Since vector graphics are infinitely scalable, not only can we cover all of the sizes previously possible, but newer sizes that would be difficult to accommodate with rasters.

However, this repository does more than Hyprcursor themes, now offering themes for KDE Plasma. I based the themes around how Posy distributes them on his website (minus some inconsistencies). When adoption of vector cursors continues, I will be glad to make additional themes for more desktop environments.

Editing the Source SVGs

The source SVGs behind the cursors are made using Inkscape, so it is recommended you use this program if you want to edit them.

Procedures for KDE Plasma

Note

You need KDE Plasma 6.2 or later to use this theme.

The themes in the repository are already pre-configured if you want an "SVG only" theme. All you have to do is copy and paste the folder into .icons or ~/.local/share/icons folder. However, KDE Plasma will fall back to legacy XCursors if it comes across an application that doesn't support vector cursors, mainly GTK/adwaita applications or anything running under XWayland. In addition, aliases exist for alternative naming schemes or to fill in for unavailable designs, and these aren't included.

To add legacy XCursors and aliases to the theme, head into plasma_themes/src/build_tools and run build.sh. You are more than welcome to add additional size options by adding to the SCALES string, but the defaults should cover a variety of sizes.

Procedures for Hyprland

You can run install_hyprcursor.sh after cloning the repository and follow the instructions. It will build and install the hyprcursor theme for you.

From a tarball

Alternatively, you can download a prebuilt theme as a tarball from the releases page. For KDE Plasma, the tarballs will include XCursor fallbacks and aliases for a better user experience.

  1. Extract the top level folder from the tarball.
  2. Move the folder into .icons or ~/.local/share/icons.

For Hyprland

  1. Update your hyprland.conf file with the following lines to apply the theme (changing the theme and size to your liking)
env = HYPRCURSOR_THEME,Posys-Cursor-Scalable
env = HYPRCURSOR_SIZE,24

Alternatively, you can also type the following in your terminal to instantly apply the cursor theme (may not be permanent)

hyprctl setcursor Posys-Cursor-Scalable 24

For KDE Plasma

  1. Close any instances of KDE System Settings and open it. Navigate to Colors & Themes > Cursors.
  2. Select your installed variant of Posy's Cursor (Scalable), and confirm by clicking "Apply"

"Extra" cursors

Similar to the original Posy's cursors, this repository has the "extra" cursors that you can swap out some of the regular cursors with. These are completely optional cursors and only exist to offer a degree of customization. Some cursors will require a bit of hyprcursor knowledge in order to swap correctly, but these steps should be able to cover most of them. 0. If needed, modify and copy over the metadata file for the corresponding custom cursor (otherwise it should be taken care of for you)

  1. Open up the extra cursor that you want to swap out in Inkscape or a sufficient alternative.

  2. If it doesn't exist, create a new folder in the theme you want to modify and name it after the cursor you'll be exporting

  3. Export the cursor as a "Plain SVG" (Inkscape SVGs have additional metadata and information that need to be stripped out for file size)

  4. We want to further optimize the file size by using scour, an application that is available on most distros. On a terminal, navigate to the directory your plain SVG is in, and type in scour [plain svg name].svg [a slightly different name].svg. This is to get the file size as small as possible.

    a. If you want to avoid using the terminal / command line, you can access a GUI version of it in Inkscape through File > Save a Copy, and selecting "Optimized SVG" from the file type dropdown menu. Be careful as this method may not always work.

    b. For the most optimal results, you can use the following flags below

    --set-precision=4 --strip-xml-prolog --remove-titles --remove-description --remove-metadata --remove-descriptive-elements --enable-comment-stripping --indent=tab --no-line-breaks --strip-xml-space --enable-id-stripping --shorten-ids
    
  5. (KDE Plasma Users Only) Inkscape exports SVGs in SVG 1.1. However, Qt SVGs use 1.2 Tiny, a slight update of SVG that strips out more advanced features (e.g. clipping, masking). BIMI P/S is a profile that further strips away features (like JavaScript execution) for security purposes, but is valid Tiny 1.2. svgtinyps-cli is a program that allows us to convert our SVG to BIMI P/S.

    a. Install a binary and rename it to svgtinyps, and move it to the same directory as our SVG to simplify the process.

    b. With the terminal, type in ./svgtinyps convert [optimized svg name].svg [either a different name, or the initial svg name].svg --title="Posy's Cursor". This will give us our final SVG.

    c. If you chose a different name, make sure to swap names with the original SVG so our converted SVG will take place.

    d. Delete other SVGs so only the converted SVG remains

Preview

Here's a quick preview of the preconfigured themes and what each theme should look like. Animated cursors are presented as still images rather than their fully animated counterparts

White (Default)

default pointer text vertical-text all-scroll pen ew-resize nesw-resize ns-resize nwse-resize row-resize col-resize crosshair not-allowed wait progress alias copy no-drop context-menu help

Black

default pointer text vertical-text all-scroll pen ew-resize nesw-resize ns-resize nwse-resize row-resize col-resize crosshair not-allowed wait progress alias copy no-drop context-menu help

Mono

default pointer text vertical-text all-scroll pen ew-resize nesw-resize ns-resize nwse-resize row-resize col-resize crosshair not-allowed wait progress alias copy no-drop context-menu help

Mono Black

default pointer text vertical-text all-scroll pen ew-resize nesw-resize ns-resize nwse-resize row-resize col-resize crosshair not-allowed wait progress alias copy no-drop context-menu help

About

Michiel De Boer (Posy)'s infamous cursor theme, made scalable with SVGs

Resources

License

Stars

Watchers

Forks

Packages

No packages published