Files
lintunes/packaging/install-desktop.sh
T
trav d93a265c33 v0.87.1: one app icon (lint.jpg, wave's corner radius) on desktop and andTunes 0.4.2; quitting no longer segfaults
The swap-a-PNG icon is gone: scripts/make_icons.py renders packaging/lint.jpg
into packaging/lintunes.png and the andTunes launcher. Quitting ends with
os._exit once aboutToQuit has saved everything — Python's teardown of the
QApplication wrapper segfaulted on every quit.
2026-11-06 02:01:06 -08:00

36 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Install the lintunes .desktop entry and icon for the current user, so GNOME
# shows a proper icon and the app can be pinned to the dash.
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
APPS_DIR="$HOME/.local/share/applications"
ICON_DIR="$HOME/.local/share/icons/hicolor/512x512/apps"
mkdir -p "$APPS_DIR" "$ICON_DIR"
cp "$HERE/lintunes.png" "$ICON_DIR/lintunes.png"
# The icon used to install at 256x256; an old copy there would shadow this one.
rm -f "$HOME/.local/share/icons/hicolor/256x256/apps/lintunes.png"
# If lintunes isn't on PATH, point Exec at this checkout's module instead.
# We must NOT rely on the working directory: GNOME's dash launches apps via a
# systemd scope that does not reliably honor the Path= key, so `python3 -m`
# would fail with "No module named 'lintunes'". Put the checkout on PYTHONPATH
# and use absolute python so the launch is independent of CWD and PATH.
PROJECT_DIR="$(dirname "$HERE")"
PY="$(command -v python3 || echo /usr/bin/python3)"
if command -v lintunes >/dev/null 2>&1; then
cp "$HERE/lintunes.desktop" "$APPS_DIR/lintunes.desktop"
else
sed -e "s|^Exec=lintunes|Exec=/usr/bin/env PYTHONPATH=$PROJECT_DIR $PY -m lintunes.main|" \
-e "s|^Terminal=|Path=$PROJECT_DIR\nTerminal=|" \
"$HERE/lintunes.desktop" > "$APPS_DIR/lintunes.desktop"
fi
command -v update-desktop-database >/dev/null 2>&1 && \
update-desktop-database "$APPS_DIR" || true
command -v gtk-update-icon-cache >/dev/null 2>&1 && \
gtk-update-icon-cache -t "$HOME/.local/share/icons/hicolor" 2>/dev/null || true
echo "Installed. Find 'LinTunes' in the app grid; right-click to pin to dash."