diff --git a/assets/pi-session-launcher-1024.png b/assets/pi-session-launcher-1024.png new file mode 100644 index 0000000..840b79b Binary files /dev/null and b/assets/pi-session-launcher-1024.png differ diff --git a/assets/pi-session-launcher-128.png b/assets/pi-session-launcher-128.png new file mode 100644 index 0000000..ee804c8 Binary files /dev/null and b/assets/pi-session-launcher-128.png differ diff --git a/assets/pi-session-launcher-256.png b/assets/pi-session-launcher-256.png new file mode 100644 index 0000000..4a0ba1f Binary files /dev/null and b/assets/pi-session-launcher-256.png differ diff --git a/assets/pi-session-launcher-48.png b/assets/pi-session-launcher-48.png new file mode 100644 index 0000000..6737c53 Binary files /dev/null and b/assets/pi-session-launcher-48.png differ diff --git a/assets/pi-session-launcher-64.png b/assets/pi-session-launcher-64.png new file mode 100644 index 0000000..23619bd Binary files /dev/null and b/assets/pi-session-launcher-64.png differ diff --git a/assets/pi-session-launcher.png b/assets/pi-session-launcher.png new file mode 100644 index 0000000..624b8d4 Binary files /dev/null and b/assets/pi-session-launcher.png differ diff --git a/assets/pi_session_launcher_icon_1787135239183.jpg b/assets/pi_session_launcher_icon_1787135239183.jpg new file mode 100644 index 0000000..700614d Binary files /dev/null and b/assets/pi_session_launcher_icon_1787135239183.jpg differ diff --git a/assets/terminal_resume_icon_1787135339359.jpg b/assets/terminal_resume_icon_1787135339359.jpg new file mode 100644 index 0000000..6a44291 Binary files /dev/null and b/assets/terminal_resume_icon_1787135339359.jpg differ diff --git a/install.sh b/install.sh index 644b9c5..add82d7 100755 --- a/install.sh +++ b/install.sh @@ -6,7 +6,8 @@ set -euo pipefail DIR="$(cd "$(dirname "$0")" && pwd)" APP="$DIR/pi-session-launcher.py" BIN="$DIR/dist/pi-session-launcher" -DESKTOP="$HOME/.local/share/applications/pi-session-launcher.desktop" +APP_ID="it.enne2.pi-session-launcher" +DESKTOP="$HOME/.local/share/applications/$APP_ID.desktop" # usa l'eseguibile portabile se presente, altrimenti lo script python if [[ -x "$BIN" ]]; then @@ -24,6 +25,23 @@ fi chmod +x "$APP" 2>/dev/null || true +# icona nel tema icone KDE (più dimensioni: KDE le scala dal tema) +ICON_SRC="$DIR/assets/pi-session-launcher.png" +if [[ -f "$ICON_SRC" ]]; then + for size in 48 64 128 256 512; do + ICON_DIR="$HOME/.local/share/icons/hicolor/${size}x${size}/apps" + mkdir -p "$ICON_DIR" + if [[ -f "$DIR/assets/pi-session-launcher-${size}.png" ]]; then + cp "$DIR/assets/pi-session-launcher-${size}.png" "$ICON_DIR/$APP_ID.png" + else + cp "$ICON_SRC" "$ICON_DIR/$APP_ID.png" + fi + done + ICON_NAME="$APP_ID" +else + ICON_NAME="utilities-terminal" +fi + mkdir -p "$(dirname "$DESKTOP")" cat > "$DESKTOP" < str: return first or "(sessione senza messaggi)" +def icon_path(): + """Percorso dell'icona: dati bundlati (PyInstaller) o cartella assets del sorgente.""" + base = getattr(sys, "_MEIPASS", os.path.dirname(os.path.abspath(__file__))) + for rel in ("assets/pi-session-launcher.png", "pi-session-launcher.png"): + p = os.path.join(base, rel) + if os.path.isfile(p): + return p + return None + + # --------------------------------------------------------------------------- # GUI # --------------------------------------------------------------------------- @@ -224,6 +234,12 @@ class LauncherWindow(Gtk.ApplicationWindow): def __init__(self, app): super().__init__(application=app, title=APP_TITLE) self.set_default_size(1000, 600) + icon = icon_path() + if icon: + try: + self.set_icon_from_file(icon) + except Exception: + pass # modello: markup_sessione, cwd, rel_time, abs_time, mtime(float), path, size(int), search_text self.store = Gtk.ListStore(str, str, str, str, float, str, int, str) @@ -465,7 +481,8 @@ class LauncherWindow(Gtk.ApplicationWindow): class LauncherApp(Gtk.Application): def __init__(self): - super().__init__(application_id="it.enne2.pi-session-launcher") + # deve combaciare con il nome del file .desktop (senza estensione) + super().__init__(application_id=APP_ID) self.win = None def do_activate(self): @@ -474,7 +491,15 @@ class LauncherApp(Gtk.Application): self.win.present() +APP_ID = "it.enne2.pi-session-launcher" + + def main(): + # KDE Plasma/Wayland: l'icona di finestra viene associata via app-id + # + file .desktop con lo stesso nome stem (vedi ricerca Perplexity). + # GLib richiede un punto nell'application_id (reverse-DNS). + GLib.set_prgname(APP_ID) + Gtk.Window.set_default_icon_name(APP_ID) app = LauncherApp() app.run(sys.argv)