feat: add desktop entry and logo

This commit is contained in:
Mihai Fufezan 2024-01-17 18:24:41 +02:00
parent 6145bc38dc
commit 5dece2e366
No known key found for this signature in database
3 changed files with 21 additions and 1 deletions

BIN
data/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

10
data/yazi.desktop Normal file
View file

@ -0,0 +1,10 @@
[Desktop Entry]
Name=Yazi
Icon=yazi
Comment=Blazing fast terminal file manager written in Rust, based on async I/O
Terminal=true
TryExec=yazi
Exec=yazi %u
Type=Application
Categories=Utility;Core;FileManager
MimeType=inode/directory

View file

@ -26,6 +26,7 @@
, fzf
, withZoxide ? true
, zoxide
, imagemagick
}:
(makeRustPlatform { cargo = rustToolchain; rustc = rustToolchain; }).buildRustPackage {
@ -37,7 +38,7 @@
cargoLock.lockFile = ../Cargo.lock;
nativeBuildInputs = [ makeWrapper installShellFiles ];
nativeBuildInputs = [ makeWrapper installShellFiles imagemagick ];
buildInputs = lib.optionals stdenv.isDarwin (
with darwin.apple_sdk.frameworks; [ Foundation ]
);
@ -62,6 +63,15 @@
--bash ./yazi-config/completions/yazi.bash \
--fish ./yazi-config/completions/yazi.fish \
--zsh ./yazi-config/completions/_yazi
# resize logo
for RES in 16 24 32 48 64 128 256; do
mkdir -p $out/share/icons/hicolor/"$RES"x"$RES"/apps
convert data/logo.png -resize "$RES"x"$RES" $out/share/icons/hicolor/"$RES"x"$RES"/apps/yazi.png
done
mkdir -p $out/share/applications
install -m644 data/yazi.desktop $out/share/applications/
'';
meta = with lib; {