Use uni instead of custom emoji generation using gemoji

This commit is contained in:
Charlotte Van Petegem 2022-05-09 17:25:30 +02:00
parent 452255b5cf
commit f27f569187
No known key found for this signature in database
GPG key ID: 019E764B7184435A
4 changed files with 27 additions and 28 deletions

View file

@ -1,31 +1,5 @@
{ pkgs, stdenv }:
let
gemoji = pkgs.buildRubyGem {
pname = "gemoji";
gemName = "gemoji";
source.sha256 = "1xv38sxql1fmaxi5lzj6v98l2aqhi6bqkhi6kqd0k38vw40l3yqc";
type = "gem";
version = "4.0.0.rc2";
};
emojiList = stdenv.mkDerivation {
name = "emoji_list";
buildInputs = [ pkgs.ruby gemoji ];
unpackPhase = "true";
buildPhase = ''
cat > extract_emoji.rb <<HERE
require 'emoji'
File.open('emoji_list.txt', 'w') do |f|
Emoji.all.each do |e|
f.puts("#{e.raw} #{e.description} #{e.name}#{(" " + e.tags.join(" ")) if e.tags.any?} (#{e.category})")
end
end
HERE
ruby extract_emoji.rb
'';
installPhase = ''
cp emoji_list.txt $out
'';
};
script = pkgs.substituteAll {
src = ./launcher.zsh;
inherit (pkgs)
@ -37,9 +11,9 @@ let
pass
slurp
sway
uni
zsh
;
inherit emojiList;
wfRecorder = pkgs.wf-recorder;
wlClipboard = pkgs.wl-clipboard;
xdgUserDirs = pkgs.xdg-user-dirs;

View file

@ -19,7 +19,7 @@ calc() {
}
emoji_options() {
cat @emojiList@ | sed "s/^/emoji /"
@uni@/bin/uni emoji all | sed "s/^/emoji /"
}
emoji() {