From a73de7289fc096312c9a7851ee0c67d0a8fc331a Mon Sep 17 00:00:00 2001 From: uku Date: Tue, 18 Mar 2025 17:04:09 +0100 Subject: [PATCH] feat(exprs): add cursors --- configs/desktop.nix | 3 + exprs/addmissing.sh | 207 +++++++++++++++++++++++++++++++++++ exprs/niigo-miku-cursors.nix | 48 ++++++++ exprs/overlay.nix | 3 + exprs/patchouli-cursors.nix | 20 ++++ 5 files changed, 281 insertions(+) create mode 100755 exprs/addmissing.sh create mode 100644 exprs/niigo-miku-cursors.nix create mode 100644 exprs/patchouli-cursors.nix diff --git a/configs/desktop.nix b/configs/desktop.nix index 0a6ddc3..f67328e 100644 --- a/configs/desktop.nix +++ b/configs/desktop.nix @@ -43,6 +43,9 @@ systemPackages = with pkgs; [ sbctl wl-clipboard + + niigo-miku-cursors + patchouli-cursors ]; sessionVariables = { diff --git a/exprs/addmissing.sh b/exprs/addmissing.sh new file mode 100755 index 0000000..6cf4db2 --- /dev/null +++ b/exprs/addmissing.sh @@ -0,0 +1,207 @@ +#!/bin/bash +# https://www.opendesktop.org/p/999853 + +COPY="cp" +#COPY="ln -s" + + +function copy +{ + missing="$1" + shift + for cursor2 in "$@"; do + if [ -e "$cursor2" ]; then + $COPY "$cursor2" "$missing" + return + fi + done +} + +function add +{ + echo "" + for array in "$@"; do + array=( $array ) + for cursor in "${array[@]}"; do + echo -n "Checking $cursor ... " + if [ -e "$cursor" ]; then + echo "OK" + continue + fi + if [ ! -e "$cursor" ]; then + copy "$cursor" ${array[@]} + fi + if [ ! -e "$cursor" ]; then + copy "$cursor" $@ + fi + if [ -e "$cursor" ]; then + echo "COPIED" + else + echo "MISSING!" + fi + done + echo "" + done +} + + +# cursors + + default=( "default" "left_ptr" "top_left_arrow" "left-arrow" ) + + arrow=( "arrow" "right_ptr" "top_right_arrow" "right-arrow" ) + + center_ptr=( "center_ptr" ) + + link=( "link" "alias" "0876e1c15ff2fc01f906f1c363074c0f" "3085a0e285430894940527032f8b26df" "640fb0e74195791501fd1ed57b41487f" "a2a266d0498c3104214a47bd64ab0fc8" ) + dnd_link=( "dnd-link" ) + + forbidden=( "forbidden" "not-allowed" ) +crossed_circle=( "crossed_circle" "03b6e0fcb3499374a867c041f52298f0" ) + circle=( "circle" ) + dnd_no_drop=( "dnd-no-drop" "no-drop" "03b6e0fcb3499374a867c041f52298f0" "03b6e0fcb3499374a867d041f52298f0" ) + + pirate=( "pirate" "kill" ) + + pencil=( "pencil" ) + + wait=( "wait" "watch" "clock" "0426c94ea35c87780ff01dc239897213" ) + + half_busy=( "half-busy" "progress" "left_ptr_watch" "00000000000000020006000e7e9ffc3f" "08e8e1c95fe2fc01f976f1e063a24ccd" "3ecb610c1bf2410f44200f48c40d3599" "9116a3ea924ed2162ecab71ba103b17f" ) + + help=( "help" "question_arrow" "whats_this" "gumby" "5c6cd98b3f3ebcb1f9c7f1c204630408" "d9ce0ab605698f320427677b458ad60b" ) + dnd_ask=( "dnd-ask" ) + + ns_resize=( "ns-resize" "size_ver" "v_double_arrow" "double_arrow" "00008160000006810000408080010102" ) + n_resize=( "n-resize" "top_side" ) + s_resize=( "s-resize" "bottom_side" ) + + ew_resize=( "ew-resize" "size_hor" "h_double_arrow" "028006030e0e7ebffc7f7070c0600140" ) + e_resize=( "e-resize" "right_side" ) + w_resize=( "w-resize" "left_side" ) + + nw_resize=( "nw-resize" "top_left_corner" ) + se_resize=( "se-resize" "bottom_right_corner" ) + size_fdiag=( "size_fdiag" "nwse-resize" "38c5dff7c7b8962045400281044508d2" "c7088f0f3e6c8088236ef8e1e3e70000" ) + + ne_resize=( "ne-resize" "top_right_corner" ) + sw_resize=( "sw-resize" "bottom_left_corner" ) + size_bdiag=( "size_bdiag" "nesw-resize" "50585d75b494802d0151028115016902" "fcf1c3c7cd4491d801f1e1c78f100000" ) + + size_all=( "size_all" ) + + move=( "move" "fleur" "4498f0e0c1937ffe01fd06f973665830" "9081237383d90e509aa00f00170e968f" "fcf21c00b30f7e3f83fe0dfd12e71cff" ) + dnd_move=( "dnd-move" ) + all_scroll=( "all-scroll" ) + + closedhand=( "closedhand" "grabbing" "208530c400c041818281048008011002" ) + dnd_none=( "dnd-none" ) + + openhand=( "openhand" "5aca4d189052212118709018842178c0" "9d800788f1b08800ae810202380a0822" ) + + up_arrow=( "up_arrow" ) + + color_picker=( "color-picker" ) + + text=( "text" "ibeam" "xterm" ) + + vertical_text=( "vertical-text" "048008013003cff3c00c801001200000" ) + + crosshair=( "crosshair" ) + + copy=( "copy" "08ffe1cb5fe6fc01f906f1c063814ccf" "1081e37283d90000800003c07f3ef6bf" "6407b0e94181790501fd1e167b474872" "b66166c04f8c3109214a4fbd64a50fc8" ) + dnd_copy=( "dnd-copy" ) + + pointer=( "pointer" "pointing_hand" "hand1" "e29285e634086352946a0e7090d73106" ) + hand2=( "hand2" ) + + cross=( "cross" "diamond_cross" "target" ) + cell=( "cell" ) + + col_resize=( "col-resize" "sb_h_double_arrow" "043a9f68147c53184671403ffa811cc5" "14fef782d02440884392942c11205230" ) + split_h=( "split_h" ) + + row_resize=( "row-resize" "sb_v_double_arrow" "2870a09082c103050810ffdffffe0204" "c07385c7190e701020ff7ffffd08103c" ) + split_v=( "split_v" ) + + plus=( "plus" ) + + X_cursor=( "X_cursor" "X-cursor" ) + + context_menu=( "context-menu" "08ffe1e65f80fcfdf9fff11263e74c48" ) + + zoom=( "zoom" ) + zoom_out=( "zoom-out" "zoom_out" "f41c0e382c97c0938e07017e42800402" ) + zoom_in=( "zoom-in" "zoom_in" "f41c0e382c94c0958e07017e42b00462" ) + + +# adding + +add "`echo ${default[@]}`" + +add "`echo ${arrow[@]}`" + +add "`echo ${center_ptr[@]}`" + +add "`echo ${link[@]}`" "`echo ${dnd_link[@]}`" + +add "`echo ${forbidden[@]}`" "`echo ${crossed_circle[@]}`" "`echo ${circle[@]}`" "`echo ${dnd_no_drop[@]}`" + +add "`echo ${pirate[@]}`" + +add "`echo ${pencil[@]}`" + +add "`echo ${wait[@]}`" + +add "`echo ${half_busy[@]}`" + +add "`echo ${help[@]}`" "`echo ${dnd_ask[@]}`" + +add "`echo ${ns_resize[@]}`" "`echo ${n_resize[@]}`" "`echo ${s_resize[@]}`" + +add "`echo ${ew_resize[@]}`" "`echo ${e_resize[@]}`" "`echo ${w_resize[@]}`" + +add "`echo ${nw_resize[@]}`" "`echo ${se_resize[@]}`" "`echo ${size_fdiag[@]}`" + +add "`echo ${ne_resize[@]}`" "`echo ${sw_resize[@]}`" "`echo ${size_bdiag[@]}`" + +add "`echo ${size_all[@]}`" + +add "`echo ${move[@]}`" "`echo ${dnd_move[@]}`" "`echo ${all_scroll[@]}`" + +add "`echo ${closedhand[@]}`" "`echo ${dnd_none[@]}`" + +add "`echo ${openhand[@]}`" + +add "`echo ${up_arrow[@]}`" + +add "`echo ${color_picker[@]}`" + +add "`echo ${text[@]}`" + +add "`echo ${vertical_text[@]}`" + +add "`echo ${crosshair[@]}`" + +add "`echo ${copy[@]}`" "`echo ${dnd_copy[@]}`" + +add "`echo ${pointer[@]}`" "`echo ${hand2[@]}`" + +add "`echo ${cross[@]}`" "`echo ${cell[@]}`" + +add "`echo ${col_resize[@]}`" "`echo ${split_h[@]}`" + +add "`echo ${row_resize[@]}`" "`echo ${split_v[@]}`" + +add "`echo ${plus[@]}`" + +add "`echo ${X_cursor[@]}`" + +add "`echo ${context_menu[@]}`" + +add "`echo ${zoom[@]}`" "`echo ${zoom_out[@]}`" "`echo ${zoom_in[@]}`" + + +# done + +exit 0 diff --git a/exprs/niigo-miku-cursors.nix b/exprs/niigo-miku-cursors.nix new file mode 100644 index 0000000..50d9eb5 --- /dev/null +++ b/exprs/niigo-miku-cursors.nix @@ -0,0 +1,48 @@ +{ + stdenvNoCC, + fetchzip, + win2xcur, +}: +stdenvNoCC.mkDerivation { + pname = "niigo-miku-cursors"; + version = "0"; + + src = fetchzip { + url = "https://www.colorfulstage.com/upload_images/media/Download/cur%20file-static-N25.zip"; + hash = "sha256-sx5sB1n5eQurZr+DsAFWKNblfGxHt5RBWluc2ChkYsM="; + stripRoot = false; + }; + + nativeBuildInputs = [ win2xcur ]; + + buildPhase = '' + mkdir output/ + win2xcur *.{ani,cur} -o output + + pushd output + mv Busy wait + mv Diagonal1 size_fdiag + mv Diagonal2 size_bdiag + mv Help help + mv Horizontal ew-resize + mv Link pointer + mv Move move + mv Normal default + mv Precision cross + mv Text text + mv Unavailable not-allowed + mv Vertical ns-resize + mv Working half-busy + + bash ${./addmissing.sh} + popd + ''; + + installPhase = '' + mkdir -p "$out/share/icons/N25 Miku/cursors" + cp output/{*,.*} "$out/share/icons/N25 Miku/cursors" + + echo -e "[Icon Theme]\nName=N25 Miku" > "$out/share/icons/N25 Miku/index.theme" + echo -e "[Icon Theme]\nInherits=N25 Miku" > "$out/share/icons/N25 Miku/cursor.theme" + ''; +} diff --git a/exprs/overlay.nix b/exprs/overlay.nix index cdc7cb3..2befade 100644 --- a/exprs/overlay.nix +++ b/exprs/overlay.nix @@ -3,6 +3,9 @@ inputs: final: prev: { pycharm-wrapped = prev.callPackage ./pycharm-wrapped.nix { }; google-sans = prev.callPackage ./google-sans.nix { }; + niigo-miku-cursors = prev.callPackage ./niigo-miku-cursors.nix { }; + patchouli-cursors = prev.callPackage ./patchouli-cursors.nix { }; + urbackup-client = prev.urbackup-client.overrideAttrs (old: { nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ prev.autoreconfHook ]; diff --git a/exprs/patchouli-cursors.nix b/exprs/patchouli-cursors.nix new file mode 100644 index 0000000..c06d06e --- /dev/null +++ b/exprs/patchouli-cursors.nix @@ -0,0 +1,20 @@ +{ + stdenvNoCC, + fetchFromGitHub, +}: +stdenvNoCC.mkDerivation { + pname = "patchouli-cursors"; + version = "0"; + + src = fetchFromGitHub { + owner = "mabequinho"; + repo = "touhou-cursors"; + rev = "92a5513c5d247fb1813e27ac2986e85def510204"; + hash = "sha256-XYmEpRkvZK7O9F7s3nKFA9rd7xO0ECEWlVyUb8/whq4="; + }; + + installPhase = '' + mkdir -p $out/share/icons + cp -r Patchouli $out/share/icons + ''; +}