Skip to content

Commit

Permalink
make sure the icon is used for the desktop launcher and the applicati…
Browse files Browse the repository at this point in the history
…on windows
  • Loading branch information
ftl committed Jun 14, 2023
1 parent 8746a57 commit 3aa18e4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 20 deletions.
37 changes: 19 additions & 18 deletions .assets/hellocontest.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 27 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,31 @@ install:
cp ./${BINARY_NAME} ${DESTDIR}${BINDIR}/${BINARY_NAME}
mkdir -p ${DESTDIR}${SHAREDIR}/applications
cp ./.assets/${BINARY_NAME}.desktop ${DESTDIR}${SHAREDIR}/applications/${BINARY_NAME}.desktop
mkdir -p ${DESTDIR}${SHAREDIR}/icons/hicolor/256x256/apps/
cp ./.assets/${BINARY_NAME}-256x256.png ${DESTDIR}${SHAREDIR}/icons/hicolor/256x256/apps/${BINARY_NAME}.png
mkdir -p ${DESTDIR}${SHAREDIR}/icons/hicolor/128x128/apps/
cp ./.assets/${BINARY_NAME}-128x128.png ${DESTDIR}${SHAREDIR}/icons/hicolor/128x128/apps/${BINARY_NAME}.png
mkdir -p ${DESTDIR}${SHAREDIR}/icons/hicolor/48x48/apps/
cp ./.assets/${BINARY_NAME}-48x48.png ${DESTDIR}${SHAREDIR}/icons/hicolor/48x48/apps/${BINARY_NAME}.png
mkdir -p ${DESTDIR}${SHAREDIR}/icons/hicolor/32x32/apps/
cp ./.assets/${BINARY_NAME}-32x32.png ${DESTDIR}${SHAREDIR}/icons/hicolor/32x32/apps/${BINARY_NAME}.png
mkdir -p ${DESTDIR}${SHAREDIR}/icons/hicolor/16x16/apps/
cp ./.assets/${BINARY_NAME}-16x16.png ${DESTDIR}${SHAREDIR}/icons/hicolor/16x16/apps/${BINARY_NAME}.png
mkdir -p ${DESTDIR}${SHAREDIR}/icons/hicolor/scalable/apps/
cp ./.assets/${BINARY_NAME}.svg ${DESTDIR}${SHAREDIR}/icons/hicolor/scalable/apps/${BINARY_NAME}.svg

uninstall:
rm ${DESTDIR}${BINDIR}/${BINARY_NAME}
rm -f ${DESTDIR}${BINDIR}/${BINARY_NAME}
rm -f ${DESTDIR}${SHAREDIR}/applications/${BINARY_NAME}.desktop
rm -f ${DESTDIR}${SHAREDIR}/icons/hicolor/256x256/apps/${BINARY_NAME}.png
rm -f ${DESTDIR}${SHAREDIR}/icons/hicolor/128x128/apps/${BINARY_NAME}.png
rm -f ${DESTDIR}${SHAREDIR}/icons/hicolor/48x48/apps/${BINARY_NAME}.png
rm -f ${DESTDIR}${SHAREDIR}/icons/hicolor/32x32/apps/${BINARY_NAME}.png
rm -f ${DESTDIR}${SHAREDIR}/icons/hicolor/16x16/apps/${BINARY_NAME}.png
rm -f ${DESTDIR}${SHAREDIR}/icons/hicolor/scalable/apps/${BINARY_NAME}.svg

update_icons:
gtk-update-icon-cache ${DESTDIR}${SHAREDIR}/icons/hicolor

checkout_latest:
git checkout `git tag --sort=committerdate | tail -1`
Expand All @@ -55,10 +77,14 @@ debpkg:
cp ./.assets/${BINARY_NAME}.desktop ./.debpkg${SHAREDIR}/applications/${BINARY_NAME}.desktop
mkdir -p ./.debpkg${SHAREDIR}/icons/hicolor/256x256/apps/
cp ./.assets/${BINARY_NAME}-256x256.png ./.debpkg${SHAREDIR}/icons/hicolor/256x256/apps/${BINARY_NAME}.png
mkdir -p ./.debpkg${SHAREDIR}/icons/hicolor/128x128/apps/
cp ./.assets/${BINARY_NAME}-128x128.png ./.debpkg${SHAREDIR}/icons/hicolor/128x128/apps/${BINARY_NAME}.png
mkdir -p ./.debpkg${SHAREDIR}/icons/hicolor/48x48/apps/
cp ./.assets/${BINARY_NAME}-48x48.png ./.debpkg${SHAREDIR}/icons/hicolor/48x48/apps/${BINARY_NAME}.png
mkdir -p ./.debpkg${SHAREDIR}/icons/hicolor/32x32/apps/
cp ./.assets/${BINARY_NAME}-32x32.png ./.debpkg${SHAREDIR}/icons/hicolor/32x32/apps/${BINARY_NAME}.png
mkdir -p ./.debpkg${SHAREDIR}/icons/hicolor/16x16/apps/
cp ./.assets/${BINARY_NAME}-16x16.png ./.debpkg${SHAREDIR}/icons/hicolor/16x16/apps/${BINARY_NAME}.png
mkdir -p ./.debpkg${SHAREDIR}/icons/hicolor/scalable/apps/
cp ./.assets/${BINARY_NAME}.svg ./.debpkg${SHAREDIR}/icons/hicolor/scalable/apps/${BINARY_NAME}.svg
dpkg-deb --build ./.debpkg .
Expand Down
5 changes: 4 additions & 1 deletion ui/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ import (
"github.com/ftl/hellocontest/ui/style"
)

const AppID = "ft.hellocontest"

// Run the application
func Run(version string, args []string) {
var err error
app := &application{id: "ft.hellocontest", version: version}
app := &application{id: AppID, version: version}

gdk.SetAllowedBackends("x11")
gtk.WindowSetDefaultIconName("hellocontest")

app.app, err = gtk.ApplicationNew(app.id, glib.APPLICATION_FLAGS_NONE)
if err != nil {
Expand Down

0 comments on commit 3aa18e4

Please sign in to comment.