这是indexloc提供的服务,不要输入任何密码
Skip to content

enhance(main/yazi): add .desktop entry #24676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions packages/yazi/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ TERMUX_PKG_DESCRIPTION="Blazing fast terminal file manager written in Rust, base
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="25.5.31"
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/sxyazi/yazi/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=4d005e7c3f32b5574d51ab105597f3da3a4be2f7b5cd1bcb284143ad38253ed4
TERMUX_PKG_BUILD_DEPENDS='aosp-libs, imagemagick'
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_BUILD_IN_SRC=true

termux_step_pre_configure() {
termux_setup_rust
[[ "$TERMUX_ON_DEVICE_BUILD" == "false" ]] && termux_setup_proot
}

termux_step_make() {
Expand All @@ -22,12 +25,29 @@ termux_step_make_install() {
install -Dm700 -t "$TERMUX_PREFIX/bin" "target/${CARGO_TARGET_NAME}/release/yazi"
install -Dm700 -t "$TERMUX_PREFIX/bin" "target/${CARGO_TARGET_NAME}/release/ya"

cd yazi-boot/completions
install -Dm644 "${TERMUX_PKG_NAME}.bash" "${TERMUX_PREFIX}/share/bash-completion/completions/${TERMUX_PKG_NAME}.bash"
install -Dm644 "${TERMUX_PKG_NAME}.elv" "${TERMUX_PREFIX}/share/elvish/lib/${TERMUX_PKG_NAME}.elv"
install -Dm644 "${TERMUX_PKG_NAME}.fish" "${TERMUX_PREFIX}/share/fish/vendor_completions.d/${TERMUX_PKG_NAME}.fish"
install -Dm644 "${TERMUX_PKG_NAME}.nu" "${TERMUX_PREFIX}/share/nushell/vendor/autoload/${TERMUX_PKG_NAME}.nu"
install -Dm644 "_${TERMUX_PKG_NAME}" "${TERMUX_PREFIX}/share/zsh/site-functions/_${TERMUX_PKG_NAME}"
# shell completions
install -Dm644 yazi-boot/completions/yazi.bash "$TERMUX_PREFIX/share/bash-completion/completions/yazi.bash"
install -Dm644 yazi-boot/completions/yazi.elv "$TERMUX_PREFIX/share/elvish/lib/yazi.elv"
install -Dm644 yazi-boot/completions/yazi.fish "$TERMUX_PREFIX/share/fish/vendor_completions.d/yazi.fish"
install -Dm644 yazi-boot/completions/yazi.nu "$TERMUX_PREFIX/share/nushell/vendor/autoload/yazi.nu"
install -Dm644 yazi-boot/completions/_yazi "$TERMUX_PREFIX/share/zsh/site-functions/_yazi"

# desktop entry
install -Dm644 assets/yazi.desktop "$TERMUX_PREFIX/share/applications/yazi.desktop"

# application icons
local res
echo -n "Generating icons:"
for res in 16 24 32 48 64 128 256; do
mkdir -p "${TERMUX_PREFIX}/share/icons/hicolor/${res}x${res}/apps"
termux-proot-run magick assets/logo.png \
-resize "${res}x${res}" \
"${TERMUX_PREFIX}/share/icons/hicolor/${res}x${res}/apps/yazi.png"
[[ -e "${TERMUX_PREFIX}/share/icons/hicolor/${res}x${res}/apps/yazi.png" ]] && {
echo -n " ${res}x${res}"
}
done
echo
}

termux_step_create_debscripts() {
Expand Down