From a99ab83ecb9911d9980aca919be5511e606884fa Mon Sep 17 00:00:00 2001 From: Aidan Harris Date: Sat, 30 Mar 2024 18:43:16 +0000 Subject: [PATCH] Fix the application icon on KDE Plasma Wayland (#1531) * Fix the application icon on KDE Plasma Wayland This fixes the application icon on KDE Plasma Wayland (tested on Plasma 6) and possibly other Wayland compositors too. The desktop filename was chosen because this is the identifier that the Hydrus Flatpak application uses. Distribution packagers should make sure that this name matches with the desktop file that they install (for example, Gentoo installs a /usr/share/applications/hydrus-client-hydrus.desktop file). It is strongly suggested that distributions install their Hydrus .desktop file at /usr/share/applications/io.github.hydrusnetwork.hydrus.desktop to avoid needing to apply extra patches, etc. * Rename .desktop file and update setup_desktop.sh --- docs/running_from_source.md | 2 +- hydrus/client/ClientController.py | 1 + setup_desktop.sh | 8 ++++---- ...rus.desktop => io.github.hydrusnetwork.hydrus.desktop} | 0 4 files changed, 6 insertions(+), 5 deletions(-) rename static/{hydrus.desktop => io.github.hydrusnetwork.hydrus.desktop} (100%) diff --git a/docs/running_from_source.md b/docs/running_from_source.md index 812d46cf..b9ed1b4f 100644 --- a/docs/running_from_source.md +++ b/docs/running_from_source.md @@ -169,7 +169,7 @@ There are three special external libraries. You just have to get them and put th If you get an error about the venv failing to activate during `setup_venv.sh`, you may need to install venv especially for your system. The specific error message should help you out, but you'll be looking at something along the lines of `apt install python3.10-venv`. - If you like, you can run the `setup_desktop.sh` file to install a hydrus.desktop file to your applications folder. (Or check the template in `install_dir/static/hydrus.desktop` and do it yourself!) + If you like, you can run the `setup_desktop.sh` file to install an io.github.hydrusnetwork.hydrus.desktop file to your applications folder. (Or check the template in `install_dir/static/io.github.hydrusnetwork.hydrus.desktop` and do it yourself!) === "macOS" diff --git a/hydrus/client/ClientController.py b/hydrus/client/ClientController.py index 443f5720..47a94cd2 100644 --- a/hydrus/client/ClientController.py +++ b/hydrus/client/ClientController.py @@ -105,6 +105,7 @@ class App( QW.QApplication ): self._pubsub = pubsub self.setApplicationName( 'Hydrus Client' ) + self.setDesktopFileName( 'io.github.hydrusnetwork.hydrus' ) self.setApplicationVersion( str( HC.SOFTWARE_VERSION ) ) diff --git a/setup_desktop.sh b/setup_desktop.sh index c0e1df12..35cc5407 100755 --- a/setup_desktop.sh +++ b/setup_desktop.sh @@ -3,8 +3,8 @@ pushd "$(dirname "$0")" || exit 1 INSTALL_DIR="$(readlink -f .)" -DESKTOP_SOURCE_PATH=$INSTALL_DIR/static/hydrus.desktop -DESKTOP_DEST_PATH=$HOME/.local/share/applications/hydrus.desktop +DESKTOP_SOURCE_PATH=$INSTALL_DIR/static/io.github.hydrusnetwork.hydrus.desktop +DESKTOP_DEST_PATH=$HOME/.local/share/applications/io.github.hydrusnetwork.hydrus.desktop echo "Install folder appears to be $INSTALL_DIR" @@ -16,11 +16,11 @@ fi if [ -f "$DESKTOP_DEST_PATH" ]; then - echo "You already have a hydrus.desktop file at $DESKTOP_DEST_PATH. Would you like to overwrite it? y/n " + echo "You already have an io.github.hydrusnetwork.hydrus.desktop file at $DESKTOP_DEST_PATH. Would you like to overwrite it? y/n " else - echo "Create a hydrus.desktop file at $DESKTOP_DEST_PATH? y/n " + echo "Create an io.github.hydrusnetwork.hydrus.desktop file at $DESKTOP_DEST_PATH? y/n " fi diff --git a/static/hydrus.desktop b/static/io.github.hydrusnetwork.hydrus.desktop similarity index 100% rename from static/hydrus.desktop rename to static/io.github.hydrusnetwork.hydrus.desktop