c644636e57
Add Linux desktop integration that installs a user-level .desktop file and icon under XDG data directories so taskbars can match the PySentry window to the application icon. Pass the installed icon path into Linux autostart desktop entries when available, while keeping the Windows and fallback autostart APIs compatible. Bump the application version to 0.2.2, update README artifact examples, and record the release notes in docs/CHANGELOG.md. Also adjust the Mermaid architecture diagram so Gitea can render it without invalid SVG line-break tags.
31 lines
996 B
Go
31 lines
996 B
Go
package assets
|
|
|
|
import (
|
|
_ "embed"
|
|
|
|
"fyne.io/fyne/v2"
|
|
)
|
|
|
|
// The application icon is embedded into the binary instead of being loaded from
|
|
// an assets directory at runtime. That keeps the Windows/Linux distribution to a
|
|
// single executable and avoids the common failure mode where the app starts with
|
|
// a generic icon because a sidecar PNG was not copied with the binary.
|
|
//
|
|
// The blank import enables the compiler directive below; no runtime package
|
|
// initialization from embed is required.
|
|
//
|
|
//go:embed pysentry-icon.png
|
|
var iconBytes []byte
|
|
|
|
func Icon() fyne.Resource {
|
|
// Fyne accepts resources from memory, so the same embedded PNG can be used
|
|
// for the window icon and tray icon. The Windows Explorer icon is still added
|
|
// by the build script through the .ico resource, because Explorer reads PE
|
|
// resources rather than Fyne runtime state.
|
|
return fyne.NewStaticResource("pysentry-icon.png", iconBytes)
|
|
}
|
|
|
|
func IconBytes() []byte {
|
|
return append([]byte(nil), iconBytes...)
|
|
}
|