add tinted bibata cursors
This commit is contained in:
parent
60cc37b97a
commit
7f8a4c443f
4 changed files with 133 additions and 42 deletions
|
|
@ -41,7 +41,6 @@
|
||||||
# kde and kde theming
|
# kde and kde theming
|
||||||
kde-rounded-corners
|
kde-rounded-corners
|
||||||
kdePackages.partitionmanager
|
kdePackages.partitionmanager
|
||||||
pkgs.catppuccin-cursors.mochaPeach
|
|
||||||
adwaita-icon-theme
|
adwaita-icon-theme
|
||||||
morewaita-icon-theme
|
morewaita-icon-theme
|
||||||
|
|
||||||
|
|
|
||||||
70
options.nix
70
options.nix
|
|
@ -16,22 +16,6 @@
|
||||||
default = "base09";
|
default = "base09";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# catppuccinUpper = {
|
|
||||||
# accent = lib.mkOption {
|
|
||||||
# type = lib.types.str;
|
|
||||||
# readOnly = true;
|
|
||||||
# default =
|
|
||||||
# builtins.substring 0 1 (lib.toUpper config.catppuccin.accent)
|
|
||||||
# + builtins.substring 1 (-1) config.catppuccin.accent;
|
|
||||||
# };
|
|
||||||
# flavor = lib.mkOption {
|
|
||||||
# type = lib.types.str;
|
|
||||||
# readOnly = true;
|
|
||||||
# default =
|
|
||||||
# builtins.substring 0 1 (lib.toUpper config.catppuccin.flavor)
|
|
||||||
# + builtins.substring 1 (-1) config.catppuccin.flavor;
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
userOptions = {
|
userOptions = {
|
||||||
name = lib.mkOption {
|
name = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
|
|
@ -116,32 +100,36 @@
|
||||||
default = pkgs.noto-fonts-color-emoji;
|
default = pkgs.noto-fonts-color-emoji;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
cursor =
|
cursor = {
|
||||||
let
|
name = lib.mkOption {
|
||||||
attrName = "mocha" + "Peach";
|
type = lib.types.str;
|
||||||
in
|
readOnly = true;
|
||||||
{
|
default = config.colors.scheme;
|
||||||
name = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
readOnly = true;
|
|
||||||
default = "catppuccin-mocha-peach-cursors";
|
|
||||||
};
|
|
||||||
package = lib.mkOption {
|
|
||||||
type = lib.types.package;
|
|
||||||
readOnly = true;
|
|
||||||
default = pkgs.catppuccin-cursors.${attrName};
|
|
||||||
};
|
|
||||||
size = lib.mkOption {
|
|
||||||
type = lib.types.int;
|
|
||||||
readOnly = true;
|
|
||||||
default = 24;
|
|
||||||
};
|
|
||||||
path = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
readOnly = true;
|
|
||||||
default = "${pkgs.catppuccin-cursors.${attrName}}/share/icons";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
package = lib.mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
|
readOnly = true;
|
||||||
|
default =
|
||||||
|
with config.scheme;
|
||||||
|
(pkgs.bibata-cursor.override {
|
||||||
|
themeName = config.colors.scheme;
|
||||||
|
baseColor = withHashtag.${config.colors.accent};
|
||||||
|
outlineColor = withHashtag.base00;
|
||||||
|
watchBackgroundColor = withHashtag.base11;
|
||||||
|
cursorSizes = "16 20 22 24 28 32 40 48 56 64 72 80 88 96";
|
||||||
|
});
|
||||||
|
};
|
||||||
|
size = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
readOnly = true;
|
||||||
|
default = 24;
|
||||||
|
};
|
||||||
|
path = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
readOnly = true;
|
||||||
|
default = "${config.userOptions.cursor.package}/share/icons/${config.colors.scheme}";
|
||||||
|
};
|
||||||
|
};
|
||||||
# isDark = lib.mkOption {
|
# isDark = lib.mkOption {
|
||||||
# type = lib.types.bool;
|
# type = lib.types.bool;
|
||||||
# readOnly = true;
|
# readOnly = true;
|
||||||
|
|
|
||||||
103
packages/bibata-cursor/default.nix
Normal file
103
packages/bibata-cursor/default.nix
Normal file
|
|
@ -0,0 +1,103 @@
|
||||||
|
{
|
||||||
|
pkgs ? import <nixpkgs> { },
|
||||||
|
themeName ? "bibata",
|
||||||
|
baseColor ? "#000000",
|
||||||
|
outlineColor ? "#FFFFFF",
|
||||||
|
watchBackgroundColor ? "",
|
||||||
|
cursorSizes ? "24",
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
version = "2.0.7";
|
||||||
|
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "ful1e5";
|
||||||
|
repo = "Bibata_Cursor";
|
||||||
|
rev = "v${version}";
|
||||||
|
hash = "sha256-kIKidw1vditpuxO1gVuZeUPdWBzkiksO/q2R/+DUdEc=";
|
||||||
|
};
|
||||||
|
|
||||||
|
yarnOfflineCache = pkgs.fetchYarnDeps {
|
||||||
|
yarnLock = "${src}/yarn.lock";
|
||||||
|
hash = "sha256-EpWIGoFFokmzRML2r/dCM+TImOCtii8mifLgnLKdUMY=";
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
pkgs.stdenv.mkDerivation {
|
||||||
|
pname = "bibata-${themeName}-cursor";
|
||||||
|
inherit version src;
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
yarn
|
||||||
|
nodejs
|
||||||
|
fixup-yarn-lock
|
||||||
|
python3Packages.clickgen
|
||||||
|
autoPatchelfHook
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
# Required to satisfy dynamic linking for prebuilt JS native modules (like resvg-js)
|
||||||
|
stdenv.cc.cc.lib
|
||||||
|
];
|
||||||
|
|
||||||
|
configurePhase = ''
|
||||||
|
runHook preConfigure
|
||||||
|
|
||||||
|
export HOME=$(mktemp -d)
|
||||||
|
|
||||||
|
echo "1. Setup offline yarn cache"
|
||||||
|
yarn config --offline set yarn-offline-mirror ${yarnOfflineCache}
|
||||||
|
fixup-yarn-lock yarn.lock
|
||||||
|
|
||||||
|
echo "2. Install node_modules offline"
|
||||||
|
yarn install --offline --frozen-lockfile --ignore-scripts --no-progress --non-interactive
|
||||||
|
patchShebangs node_modules/
|
||||||
|
|
||||||
|
rm -rf node_modules/@resvg/resvg-js-linux-*-musl
|
||||||
|
|
||||||
|
echo "3. Patch prebuilt node binaries (like resvg) so they can run in the Nix sandbox"
|
||||||
|
autoPatchelf node_modules/
|
||||||
|
|
||||||
|
# https://github.com/ful1e5/cbmp/issues/4
|
||||||
|
echo "4. Patch 'ora' library to prevent Nix sandbox hangs"
|
||||||
|
sed -i 's/this.#isEnabled = .*/this.#isEnabled = false;/g' node_modules/ora/index.js
|
||||||
|
|
||||||
|
runHook postConfigure
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
echo "Splitting SVGs to render across $NIX_BUILD_CORES cores..."
|
||||||
|
|
||||||
|
echo "1. Distribute SVGs evenly into chunk directories"
|
||||||
|
if [ -n "${watchBackgroundColor}" ]; then
|
||||||
|
./node_modules/.bin/cbmp -d "svg" -o "bitmaps/${themeName}" -bc "${baseColor}" -oc "${outlineColor}" -wc "${watchBackgroundColor}"
|
||||||
|
else
|
||||||
|
./node_modules/.bin/cbmp -d "svg" -o "bitmaps/${themeName}" -bc "${baseColor}" -oc "${outlineColor}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Rendering complete. Building XCursor theme..."
|
||||||
|
|
||||||
|
echo "4. Build the final cursors"
|
||||||
|
ctgen configs/right/x.build.toml -s ${cursorSizes} -p x11 -d "bitmaps/${themeName}" -n "${themeName}" -c "${themeName} cursors"
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/share/icons
|
||||||
|
cp -r themes/${themeName} $out/share/icons/
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with pkgs.lib; {
|
||||||
|
description = "Custom colored Bibata Cursor theme built from source";
|
||||||
|
homepage = "https://github.com/ful1e5/Bibata_Cursor";
|
||||||
|
license = licenses.gpl3;
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
final: prev: {
|
final: prev: {
|
||||||
spotify-webapp = final.callPackage ./spotify-webapp { };
|
spotify-webapp = final.callPackage ./spotify-webapp { };
|
||||||
|
bibata-cursor = final.callPackage ./bibata-cursor { };
|
||||||
|
|
||||||
openmw-unstable = prev.openmw.overrideAttrs (oldAttrs: {
|
openmw-unstable = prev.openmw.overrideAttrs (oldAttrs: {
|
||||||
pname = "openmw";
|
pname = "openmw";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue