aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-06-15 15:44:00 +0200
committerPřemysl Eric Janouch <p@janouch.name>2023-06-15 16:25:01 +0200
commit4166b17b00a6f300773d77c225cafef459bc7427 (patch)
treef857eecba129badfe31b62fe401d5cadf51c3267
parentd0d248e44c9270076ac5c0cb51fb3a14a354cc2b (diff)
downloadnncmpp-4166b17b00a6f300773d77c225cafef459bc7427.tar.gz
nncmpp-4166b17b00a6f300773d77c225cafef459bc7427.tar.xz
nncmpp-4166b17b00a6f300773d77c225cafef459bc7427.zip
Add an icon and a desktop file for the GUI
-rw-r--r--CMakeLists.txt33
-rw-r--r--nncmpp.desktop9
-rw-r--r--nncmpp.svg9
3 files changed, 51 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9333b13..f5e8afd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -129,6 +129,12 @@ install (TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
install (FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
install (DIRECTORY contrib DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
install (DIRECTORY info DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
+if (WITH_X11)
+ install (FILES ${PROJECT_NAME}.svg
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps)
+ install (FILES ${PROJECT_NAME}.desktop
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
+endif ()
# Generate documentation from text markup
find_program (ASCIIDOCTOR_EXECUTABLE asciidoctor)
@@ -176,6 +182,33 @@ foreach (page ${project_MAN_PAGES})
DESTINATION "${CMAKE_INSTALL_MANDIR}/man${CMAKE_MATCH_1}")
endforeach ()
+# Testing
+option (BUILD_TESTING "Build tests" OFF)
+if (BUILD_TESTING)
+ enable_testing ()
+
+ find_program (xmlwf_EXECUTABLE xmlwf)
+ find_program (xmllint_EXECUTABLE xmllint)
+ foreach (xml ${PROJECT_NAME}.svg)
+ if (xmlwf_EXECUTABLE)
+ add_test (test-xmlwf-${xml} ${xmlwf_EXECUTABLE}
+ ${PROJECT_SOURCE_DIR}/${xml})
+ endif ()
+ if (xmllint_EXECUTABLE)
+ add_test (test-xmllint-${xml} ${xmllint_EXECUTABLE} --noout
+ ${PROJECT_SOURCE_DIR}/${xml})
+ endif ()
+ endforeach ()
+
+ find_program (dfv_EXECUTABLE desktop-file-validate)
+ if (dfv_EXECUTABLE)
+ foreach (df ${PROJECT_NAME}.desktop)
+ add_test (test-dfv-${df} ${dfv_EXECUTABLE}
+ ${PROJECT_SOURCE_DIR}/${df})
+ endforeach ()
+ endif ()
+endif ()
+
# CPack
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Terminal/X11 MPD client")
set (CPACK_PACKAGE_VENDOR "Premysl Eric Janouch")
diff --git a/nncmpp.desktop b/nncmpp.desktop
new file mode 100644
index 0000000..4ba2668
--- /dev/null
+++ b/nncmpp.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Type=Application
+Name=nncmpp
+GenericName=MPD client
+Icon=nncmpp
+Exec=nncmpp %U
+StartupNotify=false
+# Not registering a MimeType, because that depends on MPD.
+Categories=AudioVideo;Audio;Player;
diff --git a/nncmpp.svg b/nncmpp.svg
new file mode 100644
index 0000000..8960736
--- /dev/null
+++ b/nncmpp.svg
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg version="1.0" width="48" height="48" viewBox="0 0 48 48"
+ xmlns="http://www.w3.org/2000/svg">
+ <g transform="translate(5 4) scale(2 2)">
+ <!-- From x11_icon_play, with a stroke for contrast. -->
+ <path d="M 0 0 20 10 0 20 Z" stroke="#eee" stroke-width="2" fill="#000"
+ stroke-linejoin="round" />
+ </g>
+</svg>