Skip to content

Instantly share code, notes, and snippets.

@rodjek
Last active September 8, 2026 03:40
Show Gist options
  • Select an option

  • Save rodjek/318fb971191fd339ee0082dad23ee2da to your computer and use it in GitHub Desktop.

Select an option

Save rodjek/318fb971191fd339ee0082dad23ee2da to your computer and use it in GitHub Desktop.
gdng
#!/bin/bash
APPIMAGE="${HOME}/Applications/GoldenDict-ng.AppImage"
APPIMAGE_FOLDER=$(dirname "${APPIMAGE}")
APPIMAGE_LINK="https://github.com/pkgforge-dev/GoldenDict-ng-AppImage/releases/download/26.8.0-1%402026-09-01_1788277826/GoldenDict-ng-26.8.0-1-anylinux-x86_64.AppImage"
DESKTOP_FILE="${HOME}/.local/share/applications/goldendict-ng.desktop"
DESKTOP_FOLDER=$(dirname "${DESKTOP_FILE}")
ICON="https://raw.githubusercontent.com/xiaoyifang/goldendict-ng/refs/heads/staged/icons/programicon.png"
mkdir -p "${APPIMAGE_FOLDER}"
if [ ! -f "${APPIMAGE}" ]; then
curl -Lo "${APPIMAGE}" "${APPIMAGE_LINK}"
fi
chmod 0755 "${APPIMAGE}"
mkdir -p "${DESKTOP_FOLDER}"
if [ ! -f "${DESKTOP_FILE}" ]; then
cat << EOF > "${DESKTOP_FILE}"
[Desktop Entry]
Version=1.1
Type=Application
Name=GoldenDict-ng
GenericName=Multiformat Dictionary
Comment=A feature-rich dictionary lookup program
Icon=io.github.xiaoyifang.goldendict_ng
Exec=${HOME}/Applications/GoldenDict-ng.AppImage
Actions=
MimeType=x-scheme-handler/goldendict;x-scheme-handler/dict;
Categories=Dictionary;Education;Office;Qt;
Keywords=dict;dictionary;
StartupWMClass=GoldenDict-ng
EOF
curl -Lo goldendict.png "${ICON}"
xdg-icon-resource install --novendor --size 64 goldendict.png io.github.xiaoyifang.goldendict_ng
update-desktop-database ~/.local/share/applications
xdg-desktop-menu forceupdate
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment