diff options
author | dakkar <dakkar@thenautilus.net> | 2025-01-15 17:02:38 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2025-01-15 17:03:07 +0000 |
commit | 19a9a85065b431cb02cea9c176811a7a5665f7a7 (patch) | |
tree | 4a58beb3ef5ba5839db525973d123ad83144404e | |
parent | fix dmount completion with spaces (diff) | |
download | misc-scripts-19a9a85065b431cb02cea9c176811a7a5665f7a7.tar.gz misc-scripts-19a9a85065b431cb02cea9c176811a7a5665f7a7.tar.bz2 misc-scripts-19a9a85065b431cb02cea9c176811a7a5665f7a7.zip |
icon/emoji packer
-rwxr-xr-x | bin/sharkey-icon-pack | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/bin/sharkey-icon-pack b/bin/sharkey-icon-pack new file mode 100755 index 0000000..8c2aec5 --- /dev/null +++ b/bin/sharkey-icon-pack @@ -0,0 +1,44 @@ +#!/usr/bin/env perl +use v5.40; +use Path::Tiny; +use JSON::MaybeXS; +use Getopt::Long::Descriptive; + +my ($opt,$usage) = describe_options( + "%c %o [ file ... ]\n", + [ 'category=s', 'icon category' ], + [ 'help|h', 'print usage message and exit', { shortcircuit => 1 } ], + { + getopt_conf => [qw( posix_default no_ignore_case )], + show_defaults => 1, + }, +); +if ($opt->help) { + print $usage->text; + exit 0; +} + +my @emojis; + +for my $file (@ARGV) { + push @emojis, { + downloaded => builtin::true, + fileName => $file, + emoji => { + name => $file =~ s/\..+$//r, + category => $opt->category, + localOnly => builtin::false, + isSensitive => builtin::false, + }, + }; +} + +path('meta.json')->spew_raw( + JSON::MaybeXS->new( + ascii => 1, + pretty => 0, + )->encode({ + metaVersion => 2, + emojis => \@emojis, + }), +); |