Skip to content

Commit

Permalink
pkgs/bibata-hyprcursor: use pre-generated svg theme instead
Browse files Browse the repository at this point in the history
The one generated from the Xcursor theme looked horrible.
  • Loading branch information
fufexan committed Jun 13, 2024
1 parent b198c66 commit 79b0686
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 41 deletions.
3 changes: 1 addition & 2 deletions home/programs/wayland/hyprland/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
inputs,
pkgs,
config,
...
}: let
cursor = "${config.home.pointerCursor.name}-hyprcursor";
cursor = "HyprBibataModernClassicSVG";
cursorPackage = inputs.self.packages.${pkgs.system}.bibata-hyprcursor;
in {
imports = [
Expand Down
6 changes: 4 additions & 2 deletions home/programs/wayland/hyprland/settings.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
variant = "dark";
c = config.programs.matugen.theme.colors.colors.${variant};
pointer = config.home.pointerCursor;

cursorName = "HyprBibataModernClassicSVG";
in {
wayland.windowManager.hyprland.settings = {
"$mod" = "SUPER";
env = [
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"HYPRCURSOR_THEME,${pointer.name}-hyprcursor"
"HYPRCURSOR_THEME,${cursorName}"
"HYPRCURSOR_SIZE,${toString pointer.size}"
# "WLR_DRM_NO_ATOMIC,1"
];

exec-once = [
# set cursor for HL itself
"hyprctl setcursor ${pointer.name}-hyprcursor ${toString pointer.size}"
"hyprctl setcursor ${cursorName} ${toString pointer.size}"
"hyprlock"
];

Expand Down
45 changes: 8 additions & 37 deletions pkgs/bibata-hyprcursor/default.nix
Original file line number Diff line number Diff line change
@@ -1,54 +1,25 @@
{
lib,
stdenvNoCC,
fetchurl,
bibata-cursors,
hyprcursor,
util-linux,
xcur2png,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "bibata-hyprcursor";

inherit (bibata-cursors) src version;
inherit (bibata-cursors) version;

nativeBuildInputs = [
hyprcursor
util-linux
xcur2png
];

buildPhase = ''
runHook preBuild
cp -r ${bibata-cursors}/share/icons ./original
mkdir -p extracted themes icons
for theme in ./original/*; do
theme="$(basename $theme)"
cp -r "./original/$theme" "./icons/$theme-hyprcursor"
theme="$theme-hyprcursor"
hyprcursor-util --extract "icons/$theme" --output extracted
rename extracted_ "" extracted/*
echo -e "name = $theme\ndescription = $theme for Hyprcursor\nversion = ${finalAttrs.version}\ncursors_directory = hyprcursors" >"extracted/$theme/manifest.hl"
hyprcursor-util --create "extracted/$theme" --output themes
done
rename theme_ "" themes/*
runHook postBuild
'';
src = fetchurl {
url = "https://cdn.discordapp.com/attachments/1216066899729977435/1216076659149504643/HyprBibataModernClassicSVG.tar.gz?ex=666c7f25&is=666b2da5&hm=713c14532d55604a3c2054e65f552578b599d21ccc93b3429dec5404f982313a&";
name = "HyprBibataModernClassic.tar.gz";
hash = "sha256-KDYoULjJC0Nhdx9Pz5Ezq+1F0tWwkVQIc5buy07hO98=";
};

installPhase = ''
runHook preInstall
mkdir -p $out/share/icons
cp -r themes/* $out/share/icons
cp -r $PWD $out/share/icons
runHook postInstall
'';
Expand Down

0 comments on commit 79b0686

Please sign in to comment.