Skip to content

Commit

Permalink
Add .desktop file and generate placeholder icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
boombatower committed Nov 4, 2014
1 parent 27e61d2 commit df494a7
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -53,6 +53,7 @@ doxygen_configure(cpp/ py/)

add_subdirectory(cpp/)
add_subdirectory(py/)
add_subdirectory(assets/)

# process the included python sources, generate setup.py
process_python_modules()
Expand Down
13 changes: 13 additions & 0 deletions assets/CMakeLists.txt
@@ -0,0 +1,13 @@
message("Cropping gaben.png to create placeholder desktop icon...")

file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/dist")
execute_process(COMMAND python3 -c "
import PIL.Image;
cropped=PIL.Image.open('${GLOBAL_ASSET_DIR}/gaben.png').crop((92,137,604,649));
cropped.save('${CMAKE_BINARY_DIR}/dist/openage.png')")

install(FILES "${GLOBAL_ASSET_DIR}/dist/openage.desktop"
DESTINATION "${CMAKE_INSTALL_PREFIX}/usr/share/applications")

install(FILES "${CMAKE_BINARY_DIR}/dist/openage.png"
DESTINATION "${CMAKE_INSTALL_PREFIX}/usr/share/pixmaps")
15 changes: 15 additions & 0 deletions dist/README.md
@@ -0,0 +1,15 @@
# Distribution

Contains files for useful for package distribution.

## Desktop file

The [openage.desktop](openage.desktop) file can be found in this directory and will be installed at
`/usr/share/applications/openage.desktop`.

## Desktop icon

In lieu of a logo/icon for openage a cropped version of [assets/gaben.png](/assets/gaben.png) is
created instead. See [assets/CMakeLists.txt](/assets/CMakeLists.txt) for details on how the icon
is generated. The final icon will be installed at `/usr/share/pixmaps/openage.png` via
`make install`.
10 changes: 10 additions & 0 deletions dist/openage.desktop
@@ -0,0 +1,10 @@
#!/usr/bin/env xdg-open
[Desktop Entry]
Name=openage
Comment=Free engine clone of Age of Empires II
Exec=openage --data=assets %u
Path=~/.openage/
Terminal=true
Type=Application
Icon=openage
Categories=Game;StrategyGame;

0 comments on commit df494a7

Please sign in to comment.