From 728e65ca55b4d952bb7b6ea503b210d87f18bb97 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 14 Aug 2024 00:45:04 +0200 Subject: ... --- _sources/generated.json | 21 ++++++++++++++++ _sources/generated.nix | 11 +++++++++ accounts/gkleen@sif/default.nix | 52 ++++++++++++++++++++++++++++++++++++++++ accounts/gkleen@sif/hyprland.nix | 9 ++++++- nvfetcher.toml | 5 ++++ 5 files changed, 97 insertions(+), 1 deletion(-) diff --git a/_sources/generated.json b/_sources/generated.json index a7dba77c..2720c8d2 100644 --- a/_sources/generated.json +++ b/_sources/generated.json @@ -76,6 +76,27 @@ }, "version": "0077334cc299aa7885f804d88f52cdb1b35caf71" }, + "emoji-data": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "emoji-data", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": true, + "leaveDotGit": false, + "name": null, + "owner": "Mange", + "repo": "emoji-data", + "rev": "v2.6", + "sha256": "sha256-6nBiT9q139P1pXLqkV1JejE0s2rZn1gUbNsejXJR6RU=", + "sparseCheckout": [], + "type": "github" + }, + "version": "v2.6" + }, "lesspipe": { "cargoLocks": null, "date": null, diff --git a/_sources/generated.nix b/_sources/generated.nix index 7050dab8..8bbe4a22 100644 --- a/_sources/generated.nix +++ b/_sources/generated.nix @@ -48,6 +48,17 @@ }; date = "2015-09-10"; }; + emoji-data = { + pname = "emoji-data"; + version = "v2.6"; + src = fetchFromGitHub { + owner = "Mange"; + repo = "emoji-data"; + rev = "v2.6"; + fetchSubmodules = true; + sha256 = "sha256-6nBiT9q139P1pXLqkV1JejE0s2rZn1gUbNsejXJR6RU="; + }; + }; lesspipe = { pname = "lesspipe"; version = "2.13"; diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 2c6d747d..0fe68a55 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix @@ -971,6 +971,58 @@ in { }; "dbus-1/services/org.keepassxc.KeePassXC.service".source = "${wrappedKeepassxc}/share/dbus-1/services/org.keepassxc.KeePassXC.service"; "dbus-1/services/org.freedesktop.secrets.service.service".source = "${wrappedKeepassxc}/share/dbus-1/services/org.freedesktop.secrets.service.service"; + "emoji-data/list.txt".source = pkgs.stdenv.mkDerivation { + inherit (sources.emoji-data) pname src; + version = lib.removePrefix "v" sources.emoji-data.version; + buildInputs = with pkgs; [ jq (ruby.withPackages (ps: with ps; [ nokogiri rspec racc rubocop rubocop-performance rspec-core rspec-expectations rspec-mocks diff-lcs parallel parser rainbow regexp_parser rubocop-ast ruby-progressbar unicode-display_width rspec-support optimist ast ])) ]; + LC_ALL = "C.UTF-8"; + patches = [ + (pkgs.writeText "nix.patch" '' + diff --git a/Makefile b/Makefile + index 896cb50..c7b6db8 100644 + --- a/Makefile + +++ b/Makefile + @@ -21,10 +21,10 @@ data: + cldr: + @[ ! -d cldr/.git ] && git submodule update --init cldr + + -data/all.json: compile.rb $(wildcard lib/*.rb) $(INPUT_FILES) | cldr data check-ruby gems + +data/all.json: compile.rb $(wildcard lib/*.rb) $(INPUT_FILES) | data + @ruby compile.rb > "$@" + + -data/%.txt: views/%.txt.jq data/all.json | data check-jq + +data/%.txt: views/%.txt.jq data/all.json | data + @jq -r -f "$<" < data/all.json > "$@" + + data/%.json: views/%.json.jq data/all.json | data check-jq + '') + ]; + postPatch = '' + cp ${pkgs.writeText "list.txt.jq" '' + .categories[] | + + # Collect category + subcategory combos + .name as $cat | + reduce .subcategories[] as $sub ( + []; + # Build an array of all emojis in this subcategory + . + ( + $sub.emojis | map( + # emoji: name (keyword, keyword, keyword) + "\(.characters): \(.name // .tts_descriptions.en // "") (\(.keywords.en // [] | join(", ")))" + ) + ) + ) | + + # Merge into a single string + join("\n") + ''} views/list.txt.jq + ''; + buildFlagsArray = ["data/list.txt"]; + installPhase = '' + cp data/list.txt $out + ''; + }; }; xdg.mimeApps = { diff --git a/accounts/gkleen@sif/hyprland.nix b/accounts/gkleen@sif/hyprland.nix index d26b72a7..e2106369 100644 --- a/accounts/gkleen@sif/hyprland.nix +++ b/accounts/gkleen@sif/hyprland.nix @@ -219,7 +219,7 @@ in { makeWrapper ${lib.getExe pkgs.hyprpicker} $out \ --prefix PATH : ${lib.makeBinPath [pkgs.wl-clipboard-rs]} ''} -a" - "$mainMod, E, exec, ${pkgs.writeShellScript "qalc-fuzzel" '' + "$mainMod, T, exec, ${pkgs.writeShellScript "qalc-fuzzel" '' export PATH="${lib.makeBinPath (with pkgs; [ wl-clipboard-rs libqalculate cfg.programs.fuzzel.package coreutils findutils libnotify gnugrep ])}:$PATH" RESULTS_DIR="$HOME/.cache/qalc-fuzzel" @@ -252,6 +252,13 @@ in { [[ $QALC_RET -eq 0 ]] && wl-copy "$QALC_RES" notify-send "$QALC_RES" ''}" + "$mainMod, E, exec, ${pkgs.writeShellScript "emoji-fuzzel" '' + export PATH="${lib.makeBinPath (with pkgs; [ cfg.programs.fuzzel.package wtype wl-clipboard-rs ])}:$PATH" + + FUZZEL_RES=$(fuzzel --dmenu --prompt "emoji> " <$HOME/.local/share/emoji-data/list.txt) || exit $? + [[ -n "$FUZZEL_RES" ]] || exit 1 + wl-copy "$(cut -d ':' -f 1 <<<"$FUZZEL_RES" | tr -d '\n')" && wtype -k XF86Paste + ''}" "$mainMod CTRL, return, togglespecialworkspace, term" "$mainMod CTRL, e, togglespecialworkspace, edit" diff --git a/nvfetcher.toml b/nvfetcher.toml index d40a8d3a..c8b5efac 100644 --- a/nvfetcher.toml +++ b/nvfetcher.toml @@ -93,3 +93,8 @@ fetch.tarball = "https://github.com/bk2204/scutiger/archive/refs/tags/v$ver.tar. [tomorrow-night-paradise-theme] src.git = "https://github.com/jimeh/tomorrow-night-paradise-theme.el" fetch.git = "https://github.com/jimeh/tomorrow-night-paradise-theme.el" + +[emoji-data] +src.github_tag = "Mange/emoji-data" +fetch.github = "Mange/emoji-data" +git.fetchSubmodules = true \ No newline at end of file -- cgit v1.2.3