From 1d9db8075349be4f84996304b29193570906a4cc Mon Sep 17 00:00:00 2001 From: alex1701c Date: Sun, 5 May 2024 08:44:04 +0200 Subject: [PATCH] Clean up install scripts and add QT6 build option --- README.md | 19 +++---------------- install-user.sh | 35 ----------------------------------- install.sh | 19 +++++++++++++++---- uninstall.sh | 14 ++++++++++++++ 4 files changed, 32 insertions(+), 55 deletions(-) delete mode 100755 install-user.sh create mode 100755 uninstall.sh diff --git a/README.md b/README.md index 0f7f5eb..ec2a477 100644 --- a/README.md +++ b/README.md @@ -57,29 +57,16 @@ sudo pacman -S cmake extra-cmake-modules knotifications kwallet kcmutils ## Installation Method -### Option A: Easy oneliner method - +Easy oneliner method: ```bash curl https://raw.githubusercontent.com/alex1701c/QuickWebShortcuts/master/install.sh | bash ``` -### Option B: Easy oneliner method (without admin privileges) - -```bash -curl https://raw.githubusercontent.com/alex1701c/QuickWebShortcuts/master/install-user.sh | bash -``` - -### Option C: Manual method - +Alternatively, you can clone the repo and run the install.sh script ```bash git clone https://github.com/alex1701c/QuickWebShortcuts.git cd QuickWebShortcuts/ -mkdir build -cd build -cmake -DKDE_INSTALL_QTPLUGINDIR=$(kf5-config --qt-plugins) -DCMAKE_BUILD_TYPE=Release .. -make -sudo make install -kquitapp5 krunner 2> /dev/null; kstart5 --windowclass krunner krunner > /dev/null 2>&1 & +./install.sh ``` **Note**: KWallet is not required for building this project but without it the proxy feature for the diff --git a/install-user.sh b/install-user.sh deleted file mode 100755 index e3fb837..0000000 --- a/install-user.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# Exit if something fails -set -e - -if [[ $(basename "$PWD") != "QuickWebShortcuts"* ]];then - git clone https://github.com/alex1701c/QuickWebShortcuts - cd QuickWebShortcuts/ -fi - -# Create folders -mkdir -p build -mkdir -p ~/.local/lib/qt/plugins -mkdir -p ~/.local/share/kservices5 -mkdir -p ~/.local/share/pixmaps - -cd build - -# Add the installation path to the QT_PLUGIN_PATH -if [[ -z "${QT_PLUGIN_PATH}" || "${QT_PLUGIN_PATH}" != *".local/lib/qt/plugins/"* ]]; then - echo "export QT_PLUGIN_PATH=~/.local/lib/qt/plugins/:$QT_PLUGIN_PATH" >> ~/.bashrc - export QT_PLUGIN_PATH=~/.local/lib/qt/plugins/:$QT_PLUGIN_PATH -fi - -cmake -DKDE_INSTALL_QTPLUGINDIR="~/.local/lib/qt/plugins" \ --DKDE_INSTALL_KSERVICES5DIR="~/.local/share/kservices5" \ --DSEARCH_ENGINE_ICON_DIR="~/.local/share/pixmaps/" \ --DCMAKE_BUILD_TYPE=Release .. -make -j$(nproc) -make install - -kquitapp5 krunner 2> /dev/null -kstart5 --windowclass krunner krunner > /dev/null 2>&1 & - -echo "Installation finished !"; diff --git a/install.sh b/install.sh index be4e6e7..b3da1b5 100755 --- a/install.sh +++ b/install.sh @@ -7,12 +7,23 @@ fi mkdir -p build cd build +krunner_version=$(krunner --version | grep -oP "(?<=krunner )\d+") +if [[ "$krunner_version" == "6" ]]; then + echo "Building for Plasma6" + BUILD_QT6_OPTION="-DBUILD_WITH_QT6=ON" +else + echo "Building for Plasma5" + BUILD_QT6_OPTION="" +fi -cmake -DKDE_INSTALL_QTPLUGINDIR=$(kf5-config --qt-plugins) -DCMAKE_BUILD_TYPE=Release .. +cmake .. -DCMAKE_BUILD_TYPE=Release -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DBUILD_TESTING=OFF $BUILD_QT6_OPTION make -j$(nproc) sudo make install -quitapp5 krunner 2> /dev/null -kstart5 --windowclass krunner krunner > /dev/null 2>&1 & +# KRunner needs to be restarted for the changes to be applied +if pgrep -x krunner > /dev/null +then + kquitapp5 krunner +fi -echo "Installation finished !"; \ No newline at end of file +echo "Installation finished!"; diff --git a/uninstall.sh b/uninstall.sh new file mode 100755 index 0000000..24b98a5 --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# Exit if something fails +set -e + +cd build +sudo make uninstall + +# KRunner needs to be restarted for the changes to be applied +if pgrep -x krunner > /dev/null +then + kquitapp5 krunner +fi +