This commit is contained in:
2026-07-10 15:11:51 +08:00
parent 8bfcf23bc2
commit da17239d7d
148 changed files with 2542 additions and 4873 deletions
+91 -33
View File
@@ -1,40 +1,55 @@
#!/usr/bin/env bash
##makedesc: Install lite-xl v2.1.7
# https://github.com/lite-xl/lite-xl/releases
# https://lite-xl.com/setup/getting-started/
set -eo pipefail
echo
echo "==============================================="
echo "Installing lite-xl v2.1.7..."
echo "==============================================="
echo
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: lite-xl portable install is not supported on macOS. Use brew install --cask lite-xl or build from source." >&2
exit 1
fi
tar_url="https://github.com/lite-xl/lite-xl/releases/download/v2.1.7/lite-xl-v2.1.7-addons-linux-x86_64-portable.tar.gz"
lpm_url="https://github.com/lite-xl/lite-xl-plugin-manager/releases/download/latest/lpm.x86_64-linux"
tar_filepath="$HOME/install/lite-xl-v2.1.7.tar.gz"
untar_dir="$HOME/install"
installed() { command -v "$1" >/dev/null 2>&1; }
rm -rf \
"$HOME/.local/bin/lpm" \
"$HOME/install/lite-xl" \
"$HOME/.local/bin/lite-xl" \
"$HOME/.local/share/lite-xl"
install() {
echo
echo "==============================================="
echo "Installing lite-xl v2.1.7"
echo "==============================================="
echo
mkdir -vp \
"$untar_dir" \
"$HOME/.local/bin" \
"$HOME/.local/share/lite-xl"
# https://github.com/lite-xl/lite-xl/releases
# https://lite-xl.com/setup/getting-started/
wget "$tar_url" -O "$tar_filepath" && \
wget "$lpm_url" -O "$HOME/.local/bin/lpm" && \
chmod +x "$HOME/.local/bin/lpm" && \
tar -xzf "$tar_filepath" -C "$untar_dir" && \
cp -vf "$untar_dir/lite-xl/lite-xl" "$HOME/.local/bin/" && \
cp -vfr "$untar_dir"/lite-xl/data/* "$HOME/.local/share/lite-xl/"
tar_url="https://github.com/lite-xl/lite-xl/releases/download/v2.1.7/lite-xl-v2.1.7-addons-linux-x86_64-portable.tar.gz"
lpm_url="https://github.com/lite-xl/lite-xl-plugin-manager/releases/download/latest/lpm.x86_64-linux"
tar_filepath="$HOME/install/lite-xl-v2.1.7.tar.gz"
untar_dir="$HOME/install"
# echo -e "\nexport LITE_SCALE=1 # https://github.com/lite-xl/lite-xl/issues/1173\n" >> $HOME/.profile
cat << EOF > "$HOME/.local/share/applications/org.lite_xl.lite_xl.desktop"
rm -rf \
"$HOME/.local/bin/lpm" \
"$HOME/install/lite-xl" \
"$HOME/.local/bin/lite-xl" \
"$HOME/.local/share/lite-xl"
mkdir -p \
"$untar_dir" \
"$HOME/.local/bin" \
"$HOME/.local/share/lite-xl"
if installed wget; then
wget -q --show-progress "$tar_url" -O "$tar_filepath"
wget -q --show-progress "$lpm_url" -O "$HOME/.local/bin/lpm"
else
curl -fsSL "$tar_url" -o "$tar_filepath"
curl -fsSL "$lpm_url" -o "$HOME/.local/bin/lpm"
fi
chmod +x "$HOME/.local/bin/lpm"
tar -xzf "$tar_filepath" -C "$untar_dir"
cp -f "$untar_dir/lite-xl/lite-xl" "$HOME/.local/bin/"
cp -fr "$untar_dir"/lite-xl/data/* "$HOME/.local/share/lite-xl/"
cat << EOF > "$HOME/.local/share/applications/org.lite_xl.lite_xl.desktop"
[Desktop Entry]
Type=Application
Name=Lite XL
@@ -47,9 +62,52 @@ Categories=Development;IDE;
MimeType=text/plain;
EOF
sudo update-desktop-database && \
xdg-desktop-menu forceupdate
if command -v update-desktop-database >/dev/null 2>&1; then
sudo update-desktop-database
fi
if command -v xdg-desktop-menu >/dev/null 2>&1; then
xdg-desktop-menu forceupdate
fi
echo
echo "Finish!"
echo
echo
echo "Finish!"
echo
}
remove() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew uninstall --cask lite-xl 2>/dev/null || true
fi
return
fi
echo
echo "==============================================="
echo "Removing lite-xl"
echo "==============================================="
echo
rm -rf \
"$HOME/.local/bin/lite-xl" \
"$HOME/.local/bin/lpm" \
"$HOME/.local/share/applications/org.lite_xl.lite_xl.desktop" \
"$HOME/.local/share/lite-xl" \
"$HOME/.config/lite-xl"
if command -v update-desktop-database >/dev/null 2>&1; then
sudo update-desktop-database
fi
if command -v xdg-desktop-menu >/dev/null 2>&1; then
xdg-desktop-menu forceupdate
fi
echo
echo "Finish!"
echo
}
case "$1" in
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac