From 728e65ca55b4d952bb7b6ea503b210d87f18bb97 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 14 Aug 2024 00:45:04 +0200 Subject: ... --- accounts/gkleen@sif/default.nix | 52 ++++++++++++++++++++++++++++++++++++++++ accounts/gkleen@sif/hyprland.nix | 9 ++++++- 2 files changed, 60 insertions(+), 1 deletion(-) (limited to 'accounts') 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" -- cgit v1.2.3