#!/bin/bash # Put Routine in the app grid so it can be pinned to the dash. Re-run after moving the repo. # (Runs this checkout as it is: for a copy of its own, updated by re-running, see install-linux.sh.) set -euo pipefail REPO="$(cd "$(dirname "$0")/.." && pwd)" APPS=~/.local/share/applications HICOLOR=~/.local/share/icons/hicolor ICON="$HICOLOR/scalable/apps/me.teafry.routine.svg" mkdir -p "$APPS" "$HICOLOR/scalable/apps" cp "$REPO/shared/icon.svg" "$ICON" # fixed sizes too, for whatever doesn't read SVG (rendered with Qt, which the app needs anyway) for n in 48 64 128 256; do mkdir -p "$HICOLOR/${n}x${n}/apps" QT_QPA_PLATFORM=offscreen PYTHONPATH="$REPO" python3 -c " import sys from routine.qt.QtGui import QGuiApplication, QIcon a = QGuiApplication(sys.argv) QIcon(sys.argv[1]).pixmap(int(sys.argv[2]), int(sys.argv[2])).save(sys.argv[3])" \ "$REPO/shared/icon.svg" "$n" "$HICOLOR/${n}x${n}/apps/me.teafry.routine.png" 2>/dev/null done cat > "$APPS/me.teafry.routine.desktop" </dev/null || true gtk-update-icon-cache -q -t -f "$HICOLOR" 2>/dev/null || true echo "Installed: search for Routine in Activities, then right-click → Pin to Dash."