diff --git a/app/meson.build b/app/meson.build index 698120a5..5d7495a9 100644 --- a/app/meson.build +++ b/app/meson.build @@ -151,6 +151,12 @@ executable('scrcpy', src, c_args: []) install_man('scrcpy.1') +install_data('../data/icon.svg', + rename: 'scrcpy.svg', + install_dir: 'share/icons/hicolor/scalable/apps') +install_data('../data/icon_256x256.png', + rename: 'scrcpy.png', + install_dir: 'share/icons/hicolor/256x256/apps') ### TESTS diff --git a/app/src/icon.c b/app/src/icon.c index 9944727e..81d0ab47 100644 --- a/app/src/icon.c +++ b/app/src/icon.c @@ -14,9 +14,11 @@ static const char *const scrcpy_icons[] = { #ifdef PORTABLE - NULL, // TODO + "icon.svg", + "icon.png", #else - NULL, // TODO + PREFIX "/share/icons/hicolor/scalable/apps/scrcpy.svg" + PREFIX "/share/icons/hicolor/256x256/apps/scrcpy.png" #endif }; diff --git a/app/src/screen.c b/app/src/screen.c index 3cd4329f..8a2748a9 100644 --- a/app/src/screen.c +++ b/app/src/screen.c @@ -5,9 +5,8 @@ #include #include "events.h" -#include "icon.xpm" +#include "icon.h" #include "scrcpy.h" -#include "tiny_xpm.h" #include "video_buffer.h" #include "util/log.h" @@ -405,10 +404,10 @@ screen_init(struct screen *screen, const struct screen_params *params) { LOGD("Trilinear filtering disabled (not an OpenGL renderer)"); } - SDL_Surface *icon = read_xpm(icon_xpm); + SDL_Surface *icon = scrcpy_icon_load(); if (icon) { SDL_SetWindowIcon(screen->window, icon); - SDL_FreeSurface(icon); + scrcpy_icon_destroy(icon); } else { LOGW("Could not load icon"); } diff --git a/data/icon.svg b/data/icon.svg new file mode 100644 index 00000000..0ab92c2a --- /dev/null +++ b/data/icon.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/data/icon_256x256.png b/data/icon_256x256.png new file mode 100644 index 00000000..b96a1aff Binary files /dev/null and b/data/icon_256x256.png differ diff --git a/release.mk b/release.mk index e327654c..2319f21e 100644 --- a/release.mk +++ b/release.mk @@ -94,6 +94,8 @@ dist-win32: build-server build-win32 cp "$(WIN32_BUILD_DIR)"/app/scrcpy.exe "$(DIST)/$(WIN32_TARGET_DIR)/" cp data/scrcpy-console.bat "$(DIST)/$(WIN32_TARGET_DIR)" cp data/scrcpy-noconsole.vbs "$(DIST)/$(WIN32_TARGET_DIR)" + cp data/icon_256x256.png "$(DIST)/$(WIN32_TARGET_DIR)/icon.png" + cp data/icon.svg "$(DIST)/$(WIN32_TARGET_DIR)" cp prebuilt-deps/ffmpeg-4.3.1-win32-shared/bin/avutil-56.dll "$(DIST)/$(WIN32_TARGET_DIR)/" cp prebuilt-deps/ffmpeg-4.3.1-win32-shared/bin/avcodec-58.dll "$(DIST)/$(WIN32_TARGET_DIR)/" cp prebuilt-deps/ffmpeg-4.3.1-win32-shared/bin/avformat-58.dll "$(DIST)/$(WIN32_TARGET_DIR)/" @@ -110,6 +112,8 @@ dist-win64: build-server build-win64 cp "$(WIN64_BUILD_DIR)"/app/scrcpy.exe "$(DIST)/$(WIN64_TARGET_DIR)/" cp data/scrcpy-console.bat "$(DIST)/$(WIN64_TARGET_DIR)" cp data/scrcpy-noconsole.vbs "$(DIST)/$(WIN64_TARGET_DIR)" + cp data/icon_256x256.png "$(DIST)/$(WIN64_TARGET_DIR)/icon.png" + cp data/icon.svg "$(DIST)/$(WIN64_TARGET_DIR)" cp prebuilt-deps/ffmpeg-4.3.1-win64-shared/bin/avutil-56.dll "$(DIST)/$(WIN64_TARGET_DIR)/" cp prebuilt-deps/ffmpeg-4.3.1-win64-shared/bin/avcodec-58.dll "$(DIST)/$(WIN64_TARGET_DIR)/" cp prebuilt-deps/ffmpeg-4.3.1-win64-shared/bin/avformat-58.dll "$(DIST)/$(WIN64_TARGET_DIR)/" diff --git a/run b/run index 628c5c7e..dc24d1b9 100755 --- a/run +++ b/run @@ -20,4 +20,6 @@ then exit 1 fi -SCRCPY_SERVER_PATH="$BUILDDIR/server/scrcpy-server" "$BUILDDIR/app/scrcpy" "$@" +SCRCPY_ICON_PATH="data/icon.svg" \ +SCRCPY_SERVER_PATH="$BUILDDIR/server/scrcpy-server" \ +"$BUILDDIR/app/scrcpy" "$@"