From b6779d541a87fd413623c650d5fa9831d267032c Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 13 Jan 2021 16:18:58 -0600 Subject: [PATCH] lxqt: fix themes and translations LXQt binaries look for their themes and translations based on the name of the binary, which is changed by the wrapper script. This patches liblxqt to recover the original name from the wrapped binary name. --- pkgs/desktops/lxqt/liblxqt/default.nix | 3 +++ .../lxqt/liblxqt/fix-application-path.patch | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/desktops/lxqt/liblxqt/fix-application-path.patch diff --git a/pkgs/desktops/lxqt/liblxqt/default.nix b/pkgs/desktops/lxqt/liblxqt/default.nix index ee915491f85..959afe1b887 100644 --- a/pkgs/desktops/lxqt/liblxqt/default.nix +++ b/pkgs/desktops/lxqt/liblxqt/default.nix @@ -39,6 +39,9 @@ mkDerivation rec { xorg.libXScrnSaver ]; + # convert name of wrapped binary, e.g. .lxqt-whatever-wrapped to the original name, e.g. lxqt-whatever so binaries can find their resources + patches = [ ./fix-application-path.patch ]; + postPatch = '' sed -i "s|\''${POLKITQT-1_POLICY_FILES_INSTALL_DIR}|''${out}/share/polkit-1/actions|" CMakeLists.txt ''; diff --git a/pkgs/desktops/lxqt/liblxqt/fix-application-path.patch b/pkgs/desktops/lxqt/liblxqt/fix-application-path.patch new file mode 100644 index 00000000000..12ef97db5d8 --- /dev/null +++ b/pkgs/desktops/lxqt/liblxqt/fix-application-path.patch @@ -0,0 +1,23 @@ +--- a/lxqtapplication.cpp ++++ b/lxqtapplication.cpp +@@ -77,7 +77,7 @@ Application::Application(int &argc, char** argv, bool handleQuitSignals) + + void Application::updateTheme() + { +- const QString styleSheetKey = QFileInfo(applicationFilePath()).fileName(); ++ const QString styleSheetKey = QFileInfo(applicationFilePath()).fileName().mid(1).chopped(8); + setStyleSheet(lxqtTheme.qss(styleSheetKey)); + Q_EMIT themeChanged(); + } + +--- a/lxqttranslator.cpp ++++ b/lxqttranslator.cpp +@@ -147,7 +147,7 @@ bool Translator::translateApplication(const QString &applicationName) + if (!applicationName.isEmpty()) + return translate(applicationName); + else +- return translate(QFileInfo(QCoreApplication::applicationFilePath()).baseName()); ++ return translate(QFileInfo(QCoreApplication::applicationFilePath()).baseName().mid(1).chopped(8)); + } + +