From 77eca32a1ef5d30cec68b2a9455c8a52ae2b36bb Mon Sep 17 00:00:00 2001 From: DeltaCopy <7x0bb03yq@mozmail.com> Date: Thu, 21 Nov 2024 15:10:21 +0000 Subject: [PATCH 01/19] QT5 support --- .github/assets/pkgbuild/PKGBUILD | 84 +++---- .github/assets/specs/fedora/lightly-qt6.spec | 101 --------- .github/assets/specs/lightly.spec | 163 ++++++++++++++ .../assets/specs/opensuse-tw/lightly-qt6.spec | 70 ------ .../{archlinux-ci.yml => archlinux.yml} | 11 +- .../workflows/{fedora-ci.yml => fedora.yml} | 49 +++-- .../workflows/{kubuntu-ci.yml => kubuntu.yml} | 23 +- .github/workflows/lightly-ci.yml | 34 +-- .github/workflows/{neon-ci.yml => neon.yml} | 22 +- .../{opensuse-tw-ci.yml => opensuse-tw.yml} | 30 ++- CMakeLists.txt | 207 ++++++++++++------ install.sh | 114 ++++++++++ kdecoration/CMakeLists.txt | 6 +- kstyle/animations/lightlydialdata.cpp | 7 +- kstyle/animations/lightlyscrollbardata.cpp | 18 +- kstyle/lightlysplitterproxy.cpp | 14 +- kstyle/lightlywindowmanager.cpp | 25 ++- liblightlycommon/CMakeLists.txt | 11 +- 18 files changed, 615 insertions(+), 374 deletions(-) delete mode 100644 .github/assets/specs/fedora/lightly-qt6.spec create mode 100644 .github/assets/specs/lightly.spec delete mode 100644 .github/assets/specs/opensuse-tw/lightly-qt6.spec rename .github/workflows/{archlinux-ci.yml => archlinux.yml} (89%) rename .github/workflows/{fedora-ci.yml => fedora.yml} (54%) rename .github/workflows/{kubuntu-ci.yml => kubuntu.yml} (64%) rename .github/workflows/{neon-ci.yml => neon.yml} (62%) rename .github/workflows/{opensuse-tw-ci.yml => opensuse-tw.yml} (59%) create mode 100755 install.sh diff --git a/.github/assets/pkgbuild/PKGBUILD b/.github/assets/pkgbuild/PKGBUILD index 9d224372e..e29176ede 100644 --- a/.github/assets/pkgbuild/PKGBUILD +++ b/.github/assets/pkgbuild/PKGBUILD @@ -3,19 +3,21 @@ # Used inside Github Action workflow archlinux-ci # basic info +dev="Bali10050" pkgname="lightly-qt6" pkgver= # change this to match the name of the release tag you want to build from pkgrel=1 pkgdesc="Bali10050's fork of Lightly (A modern style for qt applications)" -url="https://github.com/Bali10050/lightly" +url="https://github.com/$dev/lightly" arch=('x86_64' 'aarch64') license=("GPL-2.0-or-later") pkgdir="$srcdir/fakeinstall_kf6" +build_dir="build_kf6" makedepends=( - 'cmake' - 'extra-cmake-modules' - 'git' + 'cmake' + 'extra-cmake-modules' + 'git' ) options=(!emptydirs !debug) @@ -26,58 +28,62 @@ source=( # use makepkg -g to generate the sha256sum for the release tag -# KF6/Qt6 +# KF6/QT6 depends_kf6=( - 'kdecoration' - 'qt6-declarative' - 'kcoreaddons' - 'kcmutils' - 'kcolorscheme' - 'kconfig' - 'kguiaddons' - 'kiconthemes' - 'kwindowsystem' + 'kdecoration' + 'qt6-declarative' + 'kcoreaddons' + 'kcmutils' + 'kcolorscheme' + 'kconfig' + 'kguiaddons' + 'kiconthemes' + 'kwindowsystem' ) -depends=("${depends_kf6[@]}") +# KF5/QT5 for backward compatibility +depends_kf5=( + 'kcmutils5' + 'frameworkintegration5' + 'kconfigwidgets5' + 'kiconthemes5' + 'kirigami2' + 'kwindowsystem5' +) + +depends=("${depends_kf6[@]}" "${depends_kf5[@]}") conflicts=( - lightly-kf6 - lightly-qt + lightly-kf6 + lightly-qt ) provides=("lightly-qt6") pkgver() { - cd "$srcdir/$pkgname.git" - git describe --tags --long --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' + cd "$srcdir/$pkgname.git" + git describe --tags --long --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' } prepare() { - cd "$srcdir/$pkgname.git" + cd "$srcdir/$pkgname.git" } build() ( - local cmake_options=( - -B build_kf6 - -S "$pkgname.git" - -DBUILD_TESTING=OFF - -Wno-dev - ) - - cmake "${cmake_options[@]}" - - # for build optimization: use all cores -1 to not overload system - - printf "Using $(($(nproc) - 1)) cores\n" - - make -j $(($(nproc) - 1)) -C "$srcdir/build_kf6/kdecoration/config/" - make -j $(($(nproc) - 1)) -C "$srcdir/build_kf6/colors/" - make -j $(($(nproc) - 1)) -C "$srcdir/build_kf6/" + local cmake_options=( + -B $build_dir + -S "$pkgname.git" + -DBUILD_TESTING=OFF + -Wno-dev + ) + + cmake "${cmake_options[@]}" + + cmake --build $build_dir -j $(nproc) ) package() ( - install -dm755 "$pkgdir.git" - DESTDIR="$pkgdir" cmake --install build_kf6 - rm -rf "$pkgdir/usr/lib/cmake" + install -dm755 "$pkgdir.git" + DESTDIR="$pkgdir" cmake --install build_kf6 + rm -rf "$pkgdir/usr/lib/cmake" ) diff --git a/.github/assets/specs/fedora/lightly-qt6.spec b/.github/assets/specs/fedora/lightly-qt6.spec deleted file mode 100644 index 057b3b5f8..000000000 --- a/.github/assets/specs/fedora/lightly-qt6.spec +++ /dev/null @@ -1,101 +0,0 @@ -# Credits: hazel-bunny (https://github.com/hazel-bunny) -# Specfile used inside workflow fedora-ci -%define style Lightly -%define _style lightly -%define dev Bali10050 -%define _qt_major_version 6 -%define release_tag ${TAG} # this line gets updated automatically by Github Actions inside workflow fedora-ci -%define forgeurl https://github.com/%{dev}/%{style}/archive/refs/tags/%{release_tag}.tar.gz -%define version %{release_tag} -%forgemeta - -Name: %{_style}-qt%{_qt_major_version} -Version: %{version} -Release: 1%{?dist} -Summary: A modern style for qt applications -License: GPL-2.0-or-later -Group: System/GUI/KDE - -URL: %{forgeurl} -Source: %{forgesource} - -BuildRequires: gcc-c++ -BuildRequires: cmake >= 3.16 -BuildRequires: extra-cmake-modules >= 5.240.0 - -BuildRequires: kf%{_qt_major_version}-rpm-macros -BuildRequires: kf%{_qt_major_version}-filesystem - -BuildRequires: cmake(Qt%{_qt_major_version}Core) -BuildRequires: cmake(Qt%{_qt_major_version}DBus) -BuildRequires: cmake(Qt%{_qt_major_version}Gui) -BuildRequires: cmake(Qt%{_qt_major_version}Quick) -BuildRequires: cmake(Qt%{_qt_major_version}UiTools) -BuildRequires: cmake(Qt%{_qt_major_version}Widgets) - -BuildRequires: cmake(KF%{_qt_major_version}CoreAddons) -BuildRequires: cmake(KF%{_qt_major_version}Config) -BuildRequires: cmake(KF%{_qt_major_version}ConfigWidgets) -BuildRequires: cmake(KF%{_qt_major_version}Crash) -BuildRequires: cmake(KF%{_qt_major_version}FrameworkIntegration) -BuildRequires: cmake(KF%{_qt_major_version}GuiAddons) -BuildRequires: cmake(KF%{_qt_major_version}GlobalAccel) -BuildRequires: cmake(KF%{_qt_major_version}I18n) -BuildRequires: cmake(KF%{_qt_major_version}IconThemes) -BuildRequires: cmake(KF%{_qt_major_version}KCMUtils) -BuildRequires: cmake(KF%{_qt_major_version}KIO) -BuildRequires: cmake(KF%{_qt_major_version}Kirigami2) -BuildRequires: cmake(KF%{_qt_major_version}Notifications) -BuildRequires: cmake(KF%{_qt_major_version}Package) -BuildRequires: cmake(KF%{_qt_major_version}WindowSystem) - -BuildRequires: cmake(KDecoration2) -BuildRequires: cmake(KWayland) -BuildRequires: cmake(Plasma) -BuildRequires: cmake(Plasma5Support) - -BuildRequires: pkgconfig(x11-xcb) -BuildRequires: pkgconfig(xcb) - -BuildRequires: kwin-devel -BuildRequires: libepoxy-devel -BuildRequires: kf%{_qt_major_version}-kpackage-devel - -Obsoletes: %{_style} <= %{version} - -%description -Lightly is a fork of breeze theme style that aims to be visually modern and minimalistic. - -%prep -%forgeautosetup -p1 - -%build -%cmake_kf6 -DQT_MAJOR_VERSION=%{_qt_major_version} -%cmake_build - -%install -%cmake_install - -%files -%license COPYING -%doc AUTHORS README.md - -%{_bindir}/lightly-settings%{_qt_major_version} - -%{_libdir}/cmake/%{style}/ -%{_libdir}/lib%{_style}common%{_qt_major_version}.so.* - -%{_qt6_plugindir}/kstyle_config/%{_style}styleconfig.so -%{_qt6_plugindir}/org.kde.kdecoration2/org.kde.%{_style}.so -%{_qt6_plugindir}/org.kde.kdecoration2.kcm/kcm_%{_style}decoration.so -%{_qt6_plugindir}/styles/%{_style}%{_qt_major_version}.so - -%{_datadir}/applications/kcm_%{_style}decoration.desktop -%{_datadir}/applications/%{_style}styleconfig.desktop -%{_datadir}/color-schemes/%{style}.colors -%{_datadir}/icons/hicolor/scalable/apps/%{_style}-settings.svgz -%{_datadir}/kservices%{_qt_major_version}/%{_style}decorationconfig.desktop -%{_datadir}/kstyle/themes/%{_style}.themerc - -%changelog -%autochangelog diff --git a/.github/assets/specs/lightly.spec b/.github/assets/specs/lightly.spec new file mode 100644 index 000000000..b2bf9644b --- /dev/null +++ b/.github/assets/specs/lightly.spec @@ -0,0 +1,163 @@ +%global kf6_version 6.2.0 +%define qt6_version 6.6.0 +%define kf5_version 5.102.0 +%define qt5_version 5.15.2 +%define dev Bali10050 +%define style Lightly +%define _style lightly +%define release_tag ${TAG} # this line gets updated automatically by Github Actions + +Name: %{style} +Version: %{release_tag} +Release: 0 +Summary: A modern style for qt applications +License: GPL-3.0-or-later +Group: System/GUI/KDE +URL: https://github.com/%{dev}/%{style} +Source0: https://github.com/%{dev}/%{style}/archive/refs/tags/%{version}.tar.gz +BuildRequires: cmake >= 3.16 +BuildRequires: fdupes +BuildRequires: gettext +%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel_version} +BuildRequires: extra-cmake-modules >= %{kf6_version} +BuildRequires: kf5-rpm-macros +BuildRequires: kf6-rpm-macros +%elif 0%{?mageia} +BuildRequires: kf6-extra-cmake-modules >= %{kf6_version} +BuildRequires: kf5-macros +BuildRequires: kf6-macros + +%else +#OpenSUSE +BuildRequires: kf6-extra-cmake-modules >= %{kf6_version} +BuildRequires: kf5-filesystem +BuildRequires: kf6-filesystem +%endif +BuildRequires: pkgconfig + +#lightly5 dependencies +BuildRequires: cmake(KF5Config) >= %{kf5_version} +BuildRequires: cmake(KF5ConfigWidgets) >= %{kf5_version} +BuildRequires: cmake(KF5CoreAddons) >= %{kf5_version} +BuildRequires: cmake(KF5FrameworkIntegration) >= %{kf5_version} +BuildRequires: cmake(KF5GuiAddons) >= %{kf5_version} +BuildRequires: cmake(KF5I18n) >= %{kf5_version} +BuildRequires: cmake(KF5IconThemes) >= %{kf5_version} +BuildRequires: cmake(KF5Kirigami2) >= %{kf5_version} +BuildRequires: cmake(KF5WindowSystem) >= %{kf5_version} +BuildRequires: cmake(Qt5DBus) >= %{qt5_version} +BuildRequires: cmake(Qt5Quick) >= %{qt5_version} +BuildRequires: cmake(Qt5Widgets) >= %{qt5_version} + +#lightly6 dependencies +BuildRequires: cmake(KF6ColorScheme) >= %{kf6_version} +BuildRequires: cmake(KF6Config) >= %{kf6_version} +BuildRequires: cmake(KF6CoreAddons) >= %{kf6_version} +BuildRequires: cmake(KF6FrameworkIntegration) >= %{kf6_version} +BuildRequires: cmake(KF6GuiAddons) >= %{kf6_version} +BuildRequires: cmake(KF6I18n) >= %{kf6_version} +BuildRequires: cmake(KF6IconThemes) >= %{kf6_version} +BuildRequires: cmake(KF6KCMUtils) >= %{kf6_version} +BuildRequires: cmake(KF6KirigamiPlatform) >= %{kf6_version} +BuildRequires: cmake(KF6WindowSystem) >= %{kf6_version} +BuildRequires: cmake(Qt6Core) >= %{qt6_version} +BuildRequires: cmake(Qt6DBus) >= %{qt6_version} +BuildRequires: cmake(Qt6Quick) >= %{qt6_version} +BuildRequires: cmake(Qt6Widgets) >= %{qt6_version} + +%description +Lightly is a fork of breeze theme style that aims to be visually modern and minimalistic. + +%prep +%autosetup -n %{name}-%{version} -p1 + +%build +%cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DKDE_INSTALL_USE_QT_SYS_PATHS=ON +%cmake_build + +%install +%cmake_install + + +%fdupes %{buildroot}/%{_prefix} + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%license COPYING +%doc AUTHORS README.md + +%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel_version} + +%{_libdir}/lib%{_style}common5.so.* +%{_libdir}/lib%{_style}common6.so.* +%{_datadir}/applications/%{_style}styleconfig.desktop +%{_datadir}/applications/kcm_%{_style}decoration.desktop +%{_datadir}/kservices6/%{_style}decorationconfig.desktop +%dir %{_kf6_qtplugindir} +%dir %{_kf6_qtplugindir}/org.kde.kdecoration2.kcm +%{_kf6_qtplugindir}/org.kde.kdecoration2.kcm/kcm_%{_style}decoration.so +%dir %{_kf6_qtplugindir}/org.kde.kdecoration2/ +%{_kf6_qtplugindir}/org.kde.kdecoration2/org.kde.%{_style}.so +%dir %{_kf6_qtplugindir}/kstyle_config +%{_kf6_qtplugindir}/kstyle_config/%{_style}styleconfig.so +%dir %{_kf5_qtplugindir}/styles +%{_kf5_qtplugindir}/styles/%{_style}5.so +%dir %{_kf6_qtplugindir}/styles +%{_kf6_qtplugindir}/styles/%{_style}6.so +%dir %{_datadir}/kstyle +%dir %{_datadir}/kstyle/themes +%{_datadir}/kstyle/themes/%{_style}.themerc +%{_bindir}/%{_style}-settings6 +%dir %{_datadir}/icons/hicolor/scalable +%dir %{_datadir}/icons/hicolor/scalable/apps +%{_datadir}/icons/hicolor/scalable/apps/%{_style}-settings.svgz +%dir %{_datadir}/color-schemes/ +%{_datadir}/color-schemes/%{style}.colors +%{_libdir}/cmake/%{style}/ + + +%else +#OpenSUSE + +%{_libdir}/lib%{_style}common5.so.* +%{_libdir}/lib%{_style}common6.so.* +%{_kf6_applicationsdir}/%{_style}styleconfig.desktop +%{_kf6_applicationsdir}/kcm_%{_style}decoration.desktop +%{_datadir}/kservices6/%{_style}decorationconfig.desktop +%dir %{_kf6_plugindir} +%dir %{_kf6_plugindir}/org.kde.kdecoration2.kcm +%{_kf6_plugindir}/org.kde.kdecoration2.kcm/kcm_%{_style}decoration.so +%dir %{_kf6_plugindir}/org.kde.kdecoration2/ +%{_kf6_plugindir}/org.kde.kdecoration2/org.kde.%{_style}.so +%dir %{_kf6_plugindir}/kstyle_config +%{_kf6_plugindir}/kstyle_config/%{_style}styleconfig.so +%dir %{_kf5_plugindir}/styles +%{_kf5_plugindir}/styles/%{_style}5.so +%dir %{_kf6_plugindir}/styles +%{_kf6_plugindir}/styles/%{_style}6.so +%dir %{_kf6_sharedir}/kstyle +%dir %{_kf6_sharedir}/kstyle/themes +%{_kf6_sharedir}/kstyle/themes/%{_style}.themerc +%{_kf6_bindir}/%{_style}-settings6 +%dir %{_kf6_iconsdir}/hicolor/scalable +%dir %{_kf6_iconsdir}/hicolor/scalable/apps +%{_kf6_iconsdir}/hicolor/scalable/apps/%{_style}-settings.svgz +%dir %{_datadir}/color-schemes/ +%{_datadir}/color-schemes/%{style}.colors +%{_kf6_libdir}/cmake/%{style}/ + +%endif + +%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel_version} + +%changelog +%autochangelog + +%else +#OpenSUSE + +%changelog + +%endif diff --git a/.github/assets/specs/opensuse-tw/lightly-qt6.spec b/.github/assets/specs/opensuse-tw/lightly-qt6.spec deleted file mode 100644 index dd9c82e79..000000000 --- a/.github/assets/specs/opensuse-tw/lightly-qt6.spec +++ /dev/null @@ -1,70 +0,0 @@ -# Specfile used inside Github Action workflow opensuse-tw-ci - -%global kf6_version 6 -%define _qt_major_version 6 -%define dev Bali10050 -%define style Lightly -%define _style lightly - -Name: lightly -Version: ${TAG} # this line gets updated automatically by Github Actions inside workflow opensuse-tw-ci -Release: 0 -Summary: A modern style for qt applications -License: GPL-3.0-or-later -URL: https://github.com/%{dev}/%{style} -Source0: https://github.com/%{dev}/%{style}/archive/refs/tags/%{version}.tar.gz -BuildRequires: kf6-extra-cmake-modules >= %{kf6_version} -BuildRequires: pkgconfig -BuildRequires: cmake(KDecoration2) >= 6.0 -BuildRequires: cmake(KF6Config) >= %{kf6_version} -BuildRequires: cmake(KF6ConfigWidgets) >= %{kf6_version} -BuildRequires: cmake(KF6CoreAddons) >= %{kf6_version} -BuildRequires: cmake(KF6FrameworkIntegration) >= %{kf6_version} -BuildRequires: cmake(KF6GuiAddons) >= %{kf6_version} -BuildRequires: cmake(KF6I18n) >= %{kf6_version} -BuildRequires: cmake(KF6IconThemes) >= %{kf6_version} -BuildRequires: cmake(KF6KCMUtils) >= %{kf6_version} -BuildRequires: cmake(KF6WindowSystem) >= %{kf6_version} -BuildRequires: cmake(KWayland) >= 6.0 -BuildRequires: cmake(Plasma) >= 6.0 -BuildRequires: cmake(Qt6DBus) >= %{_qt_major_version} -BuildRequires: cmake(Qt6Quick) >= %{_qt_major_version} -BuildRequires: cmake(Qt6Widgets) >= %{_qt_major_version} -BuildRequires: pkgconfig(xcb) - -%description -Lightly is a fork of breeze theme style that aims to be visually modern and minimalistic. - -%prep -%autosetup -p1 -n Lightly-%{version} - -%build -%cmake_kf6 - -%kf6_build - -%install -%kf6_install - -%files -%license COPYING -%doc AUTHORS README.md - -%{_bindir}/lightly-settings%{_qt_major_version} - -%{_libdir}/cmake/%{style}/ -%{_libdir}/lib%{_style}common%{_qt_major_version}.so.* - -%{_kf6_plugindir}/kstyle_config/%{_style}styleconfig.so -%{_kf6_plugindir}/org.kde.kdecoration2/org.kde.%{_style}.so -%{_kf6_plugindir}/org.kde.kdecoration2.kcm/kcm_%{_style}decoration.so -%{_kf6_plugindir}/styles/%{_style}%{_qt_major_version}.so - -%{_datadir}/applications/kcm_%{_style}decoration.desktop -%{_datadir}/applications/%{_style}styleconfig.desktop -%{_datadir}/color-schemes/%{style}.colors -%{_datadir}/icons/hicolor/scalable/apps/%{_style}-settings.svgz -%{_datadir}/kservices%{_qt_major_version}/%{_style}decorationconfig.desktop -%{_datadir}/kstyle/themes/%{_style}.themerc - -%changelog diff --git a/.github/workflows/archlinux-ci.yml b/.github/workflows/archlinux.yml similarity index 89% rename from .github/workflows/archlinux-ci.yml rename to .github/workflows/archlinux.yml index 54b3082f2..a9a69a14d 100644 --- a/.github/workflows/archlinux-ci.yml +++ b/.github/workflows/archlinux.yml @@ -10,7 +10,7 @@ on: env: PKGBUILD: $GITHUB_WORKSPACE/.github/assets/pkgbuild/PKGBUILD jobs: - build-release: + build: runs-on: ubuntu-latest container: archlinux:latest steps: @@ -28,7 +28,9 @@ jobs: cmake extra-cmake-modules qt6-base \ kdecoration qt6-declarative kcoreaddons \ kcmutils kcolorscheme kconfig kguiaddons \ - kiconthemes kwindowsystem --noconfirm + kiconthemes kwindowsystem kcmutils5 \ + frameworkintegration5 kconfigwidgets5 kiconthemes5 \ + kirigami2 kwindowsystem5 --noconfirm - name: Setup build user run: | useradd builduser -m # Create the builduser @@ -41,8 +43,8 @@ jobs: cp ${{ env.PKGBUILD }} /var/tmp/lightly-archlinux sed -i "s/.*pkgver=.*/pkgver=${{ inputs.version }}/" /var/tmp/lightly-archlinux/PKGBUILD - name: Change permissions of build directory - run: | - chown builduser:builduser -R /var/tmp/lightly-archlinux + run: | + chown builduser:builduser -R /var/tmp/lightly-archlinux - name: Generate package checksum run: sudo -u builduser bash -c 'cd /var/tmp/lightly-archlinux; makepkg -g >> PKGBUILD' - name: Build package @@ -57,4 +59,3 @@ jobs: if: startsWith(github.ref, 'refs/tags/') with: files: ${{ env.ZST_ASSET }} - diff --git a/.github/workflows/fedora-ci.yml b/.github/workflows/fedora.yml similarity index 54% rename from .github/workflows/fedora-ci.yml rename to .github/workflows/fedora.yml index 04731c6f8..0621adc5d 100644 --- a/.github/workflows/fedora-ci.yml +++ b/.github/workflows/fedora.yml @@ -1,4 +1,4 @@ -# Fedora 40 +# Fedora 41/40 # Build Lightly from release tag and publish .rpm package on: @@ -10,20 +10,26 @@ on: version: required: true type: string + containers: + required: true + type: string env: - SPEC_FILE: $GITHUB_WORKSPACE/.github/assets/specs/fedora/lightly-qt6.spec + SPEC_FILE: $GITHUB_WORKSPACE/.github/assets/specs/lightly.spec jobs: - build-release: + build: + strategy: + max-parallel: 2 + matrix: + image: ${{ fromJson(inputs.containers) }} runs-on: ubuntu-latest - container: fedora:latest + container: ${{ matrix.image }} steps: - name: Checkout local uses: actions/checkout@v4.2.0 with: repository: ${{ github.repository }} sparse-checkout: | - .github/assets/specs/fedora/lightly-qt6.spec - sparse-checkout-cone-mode: false + .github/assets/specs/lightly.spec - name: Update tag version inside spec file run: sed -i "s/.*%define release_tag.*/%define release_tag ${{ inputs.version }}/" ${{ env.SPEC_FILE }} - uses: actions/cache/restore@v4.1.0 @@ -34,39 +40,34 @@ jobs: fail-on-cache-miss: true - name: Install dependencies run: | - sudo dnf install -y -q git rpmdevtools rpmlint cmake extra-cmake-modules "cmake(KDecoration2)" kwin-devel \ - kf6-kcolorscheme-devel kf6-kguiaddons-devel kf6-ki18n-devel kf6-kiconthemes-devel \ - kf6-kirigami-devel kf6-kcmutils-devel kf6-frameworkintegration-devel \ - "cmake(KF6Crash)" "cmake(KF6GlobalAccel)" "cmake(KF6KIO)" "cmake(KF6Notifications)" \ - "cmake(KF6Package)" "cmake(KWayland)" "cmake(Plasma)" "cmake(Plasma5Support)" \ - kf6-kpackage-devel libepoxy-devel + sudo dnf install -y -q git rpmdevtools rpmlint cmake extra-cmake-modules "cmake(KDecoration2)" kwin-devel libepoxy-devel \ + "cmake(Qt5Core)" "cmake(Qt5Gui)" "cmake(Qt5DBus)" "cmake(KF5GuiAddons)" "cmake(KF5WindowSystem)" \ + "cmake(KF5I18n)" "cmake(KF5CoreAddons)" "cmake(KF5ConfigWidgets)" "cmake(Qt5UiTools)" "cmake(KF5GlobalAccel)" \ + "cmake(KF5IconThemes)" "cmake(KF5Init)" "cmake(KF5KIO)" "cmake(KF5Notifications)" kf5-kpackage-devel kf5-kcmutils-devel \ + qt5-qtquickcontrols2-devel kf5-kirigami2-devel "cmake(KF5Crash)" "cmake(KF5FrameworkIntegration)" \ + kf6-kcolorscheme-devel kf6-kguiaddons-devel kf6-ki18n-devel kf6-kiconthemes-devel \ + kf6-kirigami-devel kf6-kcmutils-devel kf6-frameworkintegration-devel \ + "cmake(KF6Crash)" "cmake(KF6GlobalAccel)" "cmake(KF6KIO)" "cmake(KF6Notifications)" \ + "cmake(KF6Package)" "cmake(KWayland)" "cmake(Plasma)" "cmake(Plasma5Support)" \ + kf6-kpackage-devel libepoxy-devel fdupes - name: Create rpm tree run: rpmdev-setuptree - - name: Move tarball asset into sources - run: | - dest_filename=Lightly-${{ inputs.version }}.tar.gz - mv ${{ inputs.cache-file-path }} $HOME/rpmbuild/SOURCES/$dest_filename - ls -lart $HOME/rpmbuild/SOURCES/ + - name: Move tarball asset to rpm build sources location + run: mv ${{ inputs.cache-file-path }} $HOME/rpmbuild/SOURCES/${{ inputs.version }}.tar.gz - name: Move rpm specfile to specs run: mv ${{ env.SPEC_FILE }} $HOME/rpmbuild/SPECS/ - name: Build rpm binary package - id: step_get_version run: | cd $HOME/rpmbuild/SPECS - rpmbuild -bb --quiet lightly-qt6.spec + rpmbuild -bb --quiet lightly.spec rpm_file=$(find $HOME/rpmbuild/RPMS/x86_64 -name "*.rpm*" ! -name "*src*" ! -name "*debug*") echo "rpm_file = $rpm_file" source /etc/os-release echo "Version ID = $VERSION_ID" - mv $rpm_file $HOME/rpmbuild/RPMS/x86_64/lightly-${{ inputs.version }}.fc$VERSION_ID.x86_64.rpm - - ls -lart $HOME/rpmbuild/RPMS/x86_64/ - echo "RPM_ASSET=$HOME/rpmbuild/RPMS/x86_64/lightly-${{ inputs.version }}.fc$VERSION_ID.x86_64.rpm" >> "$GITHUB_ENV" - name: Release uses: softprops/action-gh-release@v2.0.8 if: startsWith(github.ref, 'refs/tags/') with: files: ${{ env.RPM_ASSET }} - diff --git a/.github/workflows/kubuntu-ci.yml b/.github/workflows/kubuntu.yml similarity index 64% rename from .github/workflows/kubuntu-ci.yml rename to .github/workflows/kubuntu.yml index 390745a24..aab6a767e 100644 --- a/.github/workflows/kubuntu-ci.yml +++ b/.github/workflows/kubuntu.yml @@ -12,10 +12,8 @@ on: version: required: true type: string -env: - BUILD_REPO: https://github.com/Bali10050/Lightly/ jobs: - build-release: + build: runs-on: ubuntu-latest container: deltacopy/kubuntu:0.1 steps: @@ -27,18 +25,19 @@ jobs: fail-on-cache-miss: true - name: Install build dependencies run: | - apt-get install -y -qq qt6-base-dev libkf6coreaddons-dev libkf6colorscheme-dev \ - libkf6config-dev libkf6guiaddons-dev libkf6i18n-dev libkf6iconthemes-dev \ - libkf6windowsystem-dev libkf6kcmutils-dev libkirigami-dev libkdecorations2-dev extra-cmake-modules + apt-get install -y -qq cmake build-essential libkf5config-dev libkdecorations2-dev \ + libqt5x11extras5-dev qtdeclarative5-dev extra-cmake-modules \ + libkf5guiaddons-dev libkf5configwidgets-dev libkf5windowsystem-dev kirigami2-dev \ + libkf5coreaddons-dev libkf5iconthemes-dev gettext qt3d5-dev libkf5kcmutils-dev \ + qt6-base-dev libkf6coreaddons-dev libkf6colorscheme-dev \ + libkf6config-dev libkf6guiaddons-dev libkf6i18n-dev libkf6iconthemes-dev \ + libkf6windowsystem-dev libkf6kcmutils-dev libkirigami-dev - name: Extract release tarball - run: | - tar xvf ${{ inputs.cache-file-path }} + run: tar xvf ${{ inputs.cache-file-path }} - name: Build Lightly run: | - cmake -B build_kf6 -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_TESTING=OFF -Wno-dev -S Lightly-${{inputs.version}} - ls -lrta build_kf6 - make -j $(nproc) -C build_kf6/kdecoration/config/ - make -j $(nproc) -C build_kf6 + cmake -B build_kf6 -DBUILD_TESTING=OFF -Wno-dev -S Lightly-${{inputs.version}} + cmake --build build_kf6 -j $(nproc) - name: Create deb package id: create_deb_package run: | diff --git a/.github/workflows/lightly-ci.yml b/.github/workflows/lightly-ci.yml index 0dfb3c55e..fe675dec4 100644 --- a/.github/workflows/lightly-ci.yml +++ b/.github/workflows/lightly-ci.yml @@ -3,11 +3,11 @@ name: Lightly build & release on: push: tags: - - "v*.*.*" + - "v*" env: BUILD_TYPE: Release BUILD_WS: build_kf6 - BUILD_REPO: https://github.com/Bali10050/Lightly/ + BUILD_REPO: https://github.com/DeltaCopy/Lightly/ jobs: release-ci: runs-on: ubuntu-latest @@ -28,16 +28,16 @@ jobs: id: step_getlatest_tag run: | # get latest release tag from remote - latest_tag=$(git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags $BUILD_REPO '*.*.*' \ + latest_tag=$(git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags $BUILD_REPO '*.*' \ | tail --lines=1 | cut --delimiter='/' --fields=3) - + echo "INFO: Latest tag = $latest_tag" test ! -z "$latest_tag" && echo "LATEST_TAG=$latest_tag" >> "$GITHUB_ENV" \ || echo "ERROR: Latest tag not found" || exit 1 - + # use the tag name but remove the 'v' for the asset name to publish tagname=$(echo $latest_tag | sed 's/v//') - + echo "VERSION=$tagname" >> "$GITHUB_OUTPUT" - name: Download tag asset id: step_get_asset @@ -52,35 +52,35 @@ jobs: Kubuntu: needs: release-ci - uses: ./.github/workflows/kubuntu-ci.yml + uses: ./.github/workflows/kubuntu.yml with: cache-file-path: ${{ needs.release-ci.outputs.ASSET }} version: ${{ needs.release-ci.outputs.VERSION }} openSUSE-Tumbleweed: needs: release-ci - uses: ./.github/workflows/opensuse-tw-ci.yml + uses: ./.github/workflows/opensuse-tw.yml with: cache-file-path: ${{ needs.release-ci.outputs.ASSET }} version: ${{ needs.release-ci.outputs.VERSION }} KDE-Neon: needs: release-ci - uses: ./.github/workflows/neon-ci.yml + uses: ./.github/workflows/neon.yml with: cache-file-path: ${{ needs.release-ci.outputs.ASSET }} version: ${{ needs.release-ci.outputs.VERSION }} - Fedora-40: + Fedora: needs: release-ci - uses: ./.github/workflows/fedora-ci.yml + uses: ./.github/workflows/fedora.yml with: cache-file-path: ${{ needs.release-ci.outputs.ASSET }} version: ${{ needs.release-ci.outputs.VERSION }} + containers: "['fedora:latest', 'fedora:40']" - # Archlinux: - # needs: release-ci - # uses: ./.github/workflows/archlinux-ci.yml - # with: - # version: ${{ needs.release-ci.outputs.VERSION }} - + Archlinux: + needs: release-ci + uses: ./.github/workflows/archlinux.yml + with: + version: ${{ needs.release-ci.outputs.VERSION }} diff --git a/.github/workflows/neon-ci.yml b/.github/workflows/neon.yml similarity index 62% rename from .github/workflows/neon-ci.yml rename to .github/workflows/neon.yml index a03839c69..2728607f5 100644 --- a/.github/workflows/neon-ci.yml +++ b/.github/workflows/neon.yml @@ -12,10 +12,8 @@ on: version: required: true type: string -env: - BUILD_REPO: https://github.com/Bali10050/Lightly/ jobs: - build-release: + build: runs-on: ubuntu-latest container: deltacopy/lightly-kde-neon:0.1 steps: @@ -25,15 +23,24 @@ jobs: key: ${{ runner.os }}-v${{ inputs.version }}-${{ hashFiles(inputs.cache-file-path) }} path: ${{ inputs.cache-file-path }} fail-on-cache-miss: true + - name: Run update + run: apt-get update -y + - name: Install build dependencies + run: | + apt-get install -y -qq cmake build-essential libkf5config-dev libkdecorations2-dev \ + libqt5x11extras5-dev qtdeclarative5-dev extra-cmake-modules \ + libkf5guiaddons-dev libkf5configwidgets-dev libkf5windowsystem-dev kirigami2-dev \ + libkf5coreaddons-dev libkf5iconthemes-dev gettext qt3d5-dev libkf5kcmutils-dev \ + qt6-base-dev libkf6coreaddons-dev \ + libkf6config-dev libkf6guiaddons-dev libkf6i18n-dev libkf6iconthemes-dev \ + libkf6windowsystem-dev libkf6kcmutils-dev libkirigami-dev - name: Extract release tarball run: | tar xvf ${{ inputs.cache-file-path }} - name: Build Lightly run: | - cmake -B build_kf6 -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_TESTING=OFF -Wno-dev -S Lightly-${{inputs.version}} - ls -lrta build_kf6 - make -j $(nproc) -C build_kf6/kdecoration/config/ - make -j $(nproc) -C build_kf6 + cmake -B build_kf6 -DBUILD_TESTING=OFF -Wno-dev -S Lightly-${{inputs.version}} + cmake --build build_kf6 -j $(nproc) - name: Create deb package id: create_deb_package run: | @@ -47,3 +54,4 @@ jobs: if: startsWith(github.ref, 'refs/tags/') with: files: ${{ steps.create_deb_package.outputs.DEB_ASSET }} + \ No newline at end of file diff --git a/.github/workflows/opensuse-tw-ci.yml b/.github/workflows/opensuse-tw.yml similarity index 59% rename from .github/workflows/opensuse-tw-ci.yml rename to .github/workflows/opensuse-tw.yml index db6e4b2ba..1902faa29 100644 --- a/.github/workflows/opensuse-tw-ci.yml +++ b/.github/workflows/opensuse-tw.yml @@ -11,41 +11,40 @@ on: required: true type: string env: - SPEC_FILE: $GITHUB_WORKSPACE/.github/assets/specs/opensuse-tw/lightly-qt6.spec + SPEC_FILE: $GITHUB_WORKSPACE/.github/assets/specs/lightly.spec jobs: - build-release: + build: runs-on: ubuntu-latest container: opensuse/tumbleweed:latest steps: - name: Install build dependencies run: | - zypper in -y kdecoration6-devel kf6-kconfig-devel kf6-kconfigwidgets-devel \ - kf6-kcoreaddons-devel kf6-frameworkintegration-devel kf6-kcmutils-devel \ - kf6-kwindowsystem-devel kwayland6-devel libplasma6-devel kf6-kirigami-devel zstd rpm-build + zypper in -y zstd rpm-build cmake gcc-c++ extra-cmake-modules ki18n-devel frameworkintegration-devel kguiaddons-devel \ + kcmutils-devel kwindowsystem-devel libqt5-qtquick3d-devel kirigami2-devel libKF5I18n5 \ + kdecoration6-devel kf6-kconfig-devel kf6-kconfigwidgets-devel \ + kf6-kcoreaddons-devel kf6-frameworkintegration-devel kf6-kcmutils-devel \ + kf6-kwindowsystem-devel kwayland6-devel libplasma6-devel kf6-kirigami-devel fdupes - uses: actions/cache/restore@v4.1.0 id: cache with: - key: ${{ runner.os }}-v${{ inputs.version }}-${{ hashFiles(inputs.cache-file-path) }} + key: ${{ runner.os }}-v${{ inputs.version }}-${{ hashFiles(inputs.cache-file-path) }} path: ${{ inputs.cache-file-path }} fail-on-cache-miss: true - - name: Move tarball to rpm build location - run: | - mv ${{ inputs.cache-file-path }} /usr/src/packages/SOURCES/${{ inputs.version }}.tar.gz + - name: Move tarball asset to rpm build sources location + run: mv ${{ inputs.cache-file-path }} /usr/src/packages/SOURCES/${{ inputs.version }}.tar.gz - name: Checkout local uses: actions/checkout@v4.2.0 with: repository: ${{ github.repository }} - sparse-checkout: .github - sparse-checkout-cone-mode: false + sparse-checkout: .github/assets/specs/lightly.spec - name: Update tag version inside spec file - run: | - sed -i "s/.*Version:.*/Version: ${{ inputs.version }}/" ${{ env.SPEC_FILE }} + run: sed -i "s/.*%define release_tag.*/%define release_tag ${{ inputs.version }}/" ${{ env.SPEC_FILE }} - name: Copy opensuse specfile to rpm build location run: cp ${{ env.SPEC_FILE }} /usr/src/packages/SPECS - name: Create rpm binary file run: | cd /usr/src/packages/SPECS - rpmbuild -bb lightly-qt6.spec + rpmbuild -bb lightly.spec rpm_file=$(find /usr/src/packages/RPMS/x86_64 -name "*.rpm*" ! -name "*src*" ! -name "*debug*") echo "rpm_file = $rpm_file" mv $rpm_file /usr/src/packages/RPMS/x86_64/lightly-${{ inputs.version }}.openSUSE-tumbleweed.x86_64.rpm @@ -55,6 +54,3 @@ jobs: if: startsWith(github.ref, 'refs/tags/') with: files: ${{ env.RPM_ASSET }} - - - diff --git a/CMakeLists.txt b/CMakeLists.txt index b30451c2a..4f80603bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,9 +3,10 @@ project(lightly) set(PROJECT_VERSION "6.80") set(PROJECT_VERSION_MAJOR 6) - -set(KF6_MIN_VERSION "5.240.0") +set(KF5_MIN_VERSION "5.102.0") +set(KF6_MIN_VERSION "6.2.0") set(KDE_COMPILERSETTINGS_LEVEL "5.82") +set(QT5_MIN_VERSION "5.15.2") set(QT_MIN_VERSION "6.6.0") include(GenerateExportHeader) @@ -13,7 +14,8 @@ include(WriteBasicConfigVersionFile) include(FeatureSummary) include(GNUInstallDirs) -find_package(ECM ${KF6_MIN_VERSION} REQUIRED NO_MODULE) +find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) +#find_package(ECM ${KF6_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) set(CMAKE_CXX_STANDARD 20) @@ -28,81 +30,160 @@ include(KDEGitCommitHooks) include(GtkUpdateIconCache) +option(BUILD_QT5 "Build with QT5" ON) +option(BUILD_QT6 "Build with QT6" ON) + +set(QT_NO_CREATE_VERSIONLESS_TARGETS ON) +set(QT_NO_CREATE_VERSIONLESS_FUNCTIONS ON) + if(WIN32 OR APPLE) set(WITH_DECORATIONS OFF) endif() -set(QT_MAJOR_VERSION 6) -include(KDEInstallDirs6) -include(KDECMakeSettings) - -option(WITH_DECORATIONS "Build Lightly window decorations for KWin" ON) - -find_package(Qt6 ${QT_MIN_VERSION} REQUIRED CONFIG COMPONENTS Widgets DBus) -find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS - CoreAddons - ColorScheme - Config - GuiAddons - I18n - IconThemes - WindowSystem) - if(NOT WIN32 AND NOT APPLE) - find_package(KF6KCMUtils ${KF6_MIN_VERSION}) - set_package_properties(KF6KCMUtils PROPERTIES - TYPE REQUIRED - DESCRIPTION "Helps create configuration modules" - PURPOSE "KCMUtils used for the configuration modules or the decoration and Qt Style" - ) - endif() +function(build_qt5) + set(QT_MAJOR_VERSION 5) + include(KDEInstallDirs5) + include(KDECMakeSettings) + option(WITH_DECORATIONS "Build Lightly window decorations for KWin" ON) + + find_package(Qt5 ${QT5_MIN_VERSION} REQUIRED CONFIG COMPONENTS Widgets DBus) + find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS + CoreAddons + Config + GuiAddons + I18n + IconThemes + WindowSystem) + if(NOT WIN32 AND NOT APPLE) + find_package(KF5KCMUtils ${KF5_MIN_VERSION}) + set_package_properties(KF5KCMUtils PROPERTIES + TYPE REQUIRED + DESCRIPTION "Helps create configuration modules" + PURPOSE "KCMUtils used for the configuration modules or the decoration and Qt Style" + ) + endif() + + find_package(Qt5 ${QT5_MIN_VERSION} OPTIONAL_COMPONENTS Quick) + if(${Qt5Quick_FOUND}) + find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2) + endif() + + find_package(KF5FrameworkIntegration ${KF5_MIN_VERSION} CONFIG ) + set_package_properties(KF${QT_MAJOR_VERSION}FrameworkIntegration PROPERTIES + DESCRIPTION "KF${QT_MAJOR_VERSION} Framework Integration" + URL "https://projects.kde.org/projects/frameworks/frameworkintegration" + TYPE OPTIONAL + PURPOSE "Required to use KStyle convenience functionalities in style") + + set(LIGHTLY_HAVE_KSTYLE ${KF5FrameworkIntegration_FOUND}) + set(LIGHTLY_HAVE_QTQUICK ${Qt5Quick_FOUND}) + + + #add_subdirectory(colors) + add_subdirectory(kstyle kstyle5) + add_subdirectory(liblightlycommon liblightlycommon5) + #add_subdirectory(misc) + unset(QUERY_EXECUTABLE CACHE) +endfunction() +if(BUILD_QT5) + message("-- **** Build QT5 - On ****") + build_qt5() +endif() -find_package(Qt6 ${QT_MIN_VERSION} OPTIONAL_COMPONENTS Quick) - if(${Qt6Quick_FOUND}) - find_package(KF6KirigamiPlatform ${KF6_MIN_VERSION} REQUIRED) +function(build_qt6) + set(QT_MAJOR_VERSION 6) + include(KDEInstallDirs6) + include(KDECMakeSettings) + + option(WITH_DECORATIONS "Build Lightly window decorations for KWin" ON) + + find_package(Qt6 ${QT_MIN_VERSION} REQUIRED CONFIG COMPONENTS Widgets DBus) + find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS + CoreAddons + ColorScheme + Config + GuiAddons + I18n + IconThemes + WindowSystem) + if(NOT WIN32 AND NOT APPLE) + find_package(KF6KCMUtils ${KF6_MIN_VERSION}) + set_package_properties(KF6KCMUtils PROPERTIES + TYPE REQUIRED + DESCRIPTION "Helps create configuration modules" + PURPOSE "KCMUtils used for the configuration modules or the decoration and Qt Style" + ) + endif() + + find_package(Qt6 ${QT_MIN_VERSION} OPTIONAL_COMPONENTS Quick) + if(${Qt6Quick_FOUND}) + find_package(KF6KirigamiPlatform ${KF6_MIN_VERSION} REQUIRED) + endif() + + find_package(KF6FrameworkIntegration ${KF6_MIN_VERSION} CONFIG ) + set_package_properties(KF${QT_MAJOR_VERSION}FrameworkIntegration PROPERTIES + DESCRIPTION "KF${QT_MAJOR_VERSION} Framework Integration" + URL "https://projects.kde.org/projects/frameworks/frameworkintegration" + TYPE OPTIONAL + PURPOSE "Required to use KStyle convenience functionalities in style") + + set(LIGHTLY_HAVE_KSTYLE ${KF6FrameworkIntegration_FOUND}) + set(LIGHTLY_HAVE_QTQUICK ${Qt6Quick_FOUND}) + + + add_library(Qt::Core ALIAS Qt6::Core) + add_library(Qt::Gui ALIAS Qt6::Gui) + add_library(Qt::OpenGL ALIAS Qt6::OpenGL) + add_library(Qt::Network ALIAS Qt6::Network) + if(Qt6_VERSION_MINOR GREATER 6) + add_library(Qt::PlatformModuleInternal ALIAS Qt6::PlatformModuleInternal) endif() -find_package(KF6FrameworkIntegration ${KF6_MIN_VERSION} CONFIG ) - set_package_properties(KF${QT_MAJOR_VERSION}FrameworkIntegration PROPERTIES - DESCRIPTION "KF6 Framework Integration" - URL "https://projects.kde.org/projects/frameworks/frameworkintegration" - TYPE OPTIONAL - PURPOSE "Required to use KStyle convenience functionalities in style") - -set(LIGHTLY_HAVE_KSTYLE ${KF6FrameworkIntegration_FOUND}) -set(LIGHTLY_HAVE_QTQUICK ${Qt6Quick_FOUND}) - - -add_subdirectory(colors) -add_subdirectory(kstyle kstyle6) -add_subdirectory(liblightlycommon liblightlycommon6) -#add_subdirectory(misc) + #add_subdirectory(colors) + add_subdirectory(kstyle kstyle6) + add_subdirectory(liblightlycommon liblightlycommon6) + #add_subdirectory(misc) if(WITH_DECORATIONS) find_package(KDecoration2 REQUIRED) add_subdirectory(kdecoration) endif() -ki18n_install(po) - -# create a Config.cmake and a ConfigVersion.cmake file and install them -include(ECMSetupVersion) -ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX LIGHTLY - PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/LightlyConfigVersion.cmake" - ) - -set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/Lightly") + ki18n_install(po) + + # create a Config.cmake and a ConfigVersion.cmake file and install them + include(ECMSetupVersion) + ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX LIGHTLY + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/LightlyConfigVersion.cmake" + ) + + set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/Lightly") + + configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/LightlyConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/LightlyConfig.cmake" + PATH_VARS KDE_INSTALL_FULL_DATADIR + INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} + ) + + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LightlyConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/LightlyConfigVersion.cmake" + DESTINATION "${CMAKECONFIG_INSTALL_DIR}" + COMPONENT Devel + ) + unset(QUERY_EXECUTABLE CACHE) +endfunction() + +if(BUILD_QT6) + message("-- **** Build QT6 - On ****") + build_qt6() +endif() -configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/LightlyConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/LightlyConfig.cmake" - PATH_VARS KDE_INSTALL_FULL_DATADIR - INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} - ) +function(build_colors) + include(KDEInstallDirs) + add_subdirectory(colors) +endfunction() -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LightlyConfig.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/LightlyConfigVersion.cmake" - DESTINATION "${CMAKECONFIG_INSTALL_DIR}" - COMPONENT Devel - ) +build_colors() # add clang-format target for all our real source files file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h) diff --git a/install.sh b/install.sh new file mode 100755 index 000000000..7b23a8a2f --- /dev/null +++ b/install.sh @@ -0,0 +1,114 @@ +#!/bin/env bash + +QT_BUILD=$1 +SRC_DIR=$(pwd) +BUILD_DIR="$SRC_DIR/build" +CMAKE_OPTS=( + -B $BUILD_DIR + -S $SRC_DIR + -DBUILD_TESTING=OFF + -Wno-dev +) +PROJECT="lightly" +_PROJECT="Lightly" + +build_qt6() { + echo " *** Building with QT6 *** " + remove_build + remove_qt6_files + cmake "${CMAKE_OPTS[@]}" -DBUILD_QT6=ON -DBUILD_QT5=OFF && cmake --build $BUILD_DIR -j $(nproc) && cd $BUILD_DIR && sudo cmake --install . && echo "Installation completed!" || echo "Installation failed!" && exit 1 + cd "$SRC_DIR" +} + +build_qt5() { + echo " *** Building with QT5 *** " + remove_build + remove_qt5_files + cmake "${CMAKE_OPTS[@]}" -DBUILD_QT6=OFF -DBUILD_QT5=ON && cmake --build $BUILD_DIR -j $(nproc) && cd $BUILD_DIR && sudo cmake --install . && echo "Installation completed!" || echo "Installation failed!" && exit 1 + cd "$SRC_DIR" +} + +# build using QT5 and QT6 +build_default() { + echo " *** Building with QT5 && QT6 *** " + remove_build + remove_qt5_files + remove_qt6_files + cmake "${CMAKE_OPTS[@]}" && cmake --build $BUILD_DIR -j $(nproc) && cd $BUILD_DIR && sudo cmake --install . && echo "Installation completed!" || echo "Installation failed!" && exit 1 + cd "$SRC_DIR" +} + +remove_build() { + if [ -d "$SRC_DIR/build" ]; then + echo "Removing existing build directory" + sudo rm -rf $SRC_DIR/build + fi + + cd "$SRC_DIR" +} + +# if existing +remove_qt6_files() { + files=( + "/usr/lib64/qt6/plugins/styles/${PROJECT}6.so" + "/usr/lib/qt6/plugins/styles/${PROJECT}6.so" + "/usr/share/kstyle/themes/${PROJECT}.themerc" + "/usr/lib64/qt6/plugins/kstyle_config/${PROJECT}styleconfig.so" + "/usr/lib/qt6/plugins/kstyle_config/${PROJECT}styleconfig.so" + "/usr/share/applications/${PROJECT}styleconfig.desktop" + "/usr/bin/${PROJECT}-settings6" + "/usr/share/icons/hicolor/scalable/apps/${PROJECT}-settings.svgz" + "/usr/lib64/lib${PROJECT}common6.so.6.80" + "/usr/lib/lib${PROJECT}common6.so.6.80" + "/usr/lib64/lib${PROJECT}common6.so.6" + "/usr/lib/lib${PROJECT}common6.so.6" + "/usr/lib64/qt6/plugins/org.kde.kdecoration2/org.kde.${PROJECT}.so" + "/usr/lib/qt6/plugins/org.kde.kdecoration2/org.kde.${PROJECT}.so" + "/usr/lib64/qt6/plugins/org.kde.kdecoration2.kcm/kcm_${PROJECT}decoration.so" + "/usr/lib/qt6/plugins/org.kde.kdecoration2.kcm/kcm_${PROJECT}decoration.so" + "/usr/share/applications/kcm_${PROJECT}decoration.desktop" + "/usr/lib64/cmake/${PROJECT}/${PROJECT}Config.cmake" + "/usr/lib/cmake/${PROJECT}/${PROJECT}Config.cmake" + "/usr/lib64/cmake/${PROJECT}/${PROJECT}ConfigVersion.cmake" + "/usr/lib/cmake/${PROJECT}/${PROJECT}ConfigVersion.cmake" + "/usr/share/color-schemes/${_PROJECT}.colors" + /usr/lib/cmake/"${PROJECT^}" + ) + + for f in ${files[@]}; do + sudo rm -rf "$f" + done +} + +# if existing +remove_qt5_files() { + files=( + "/usr/lib64/qt5/plugins/styles/${PROJECT}5.so" + "/usr/lib/qt5/plugins/styles/${PROJECT}5.so" + "/usr/lib64/lib${PROJECT}common5.so.6.80" + "/usr/lib/lib${PROJECT}common5.so.6.80" + "/usr/lib64/lib${PROJECT}common5.so.6" + "/usr/lib/lib${PROJECT}common5.so.6" + "/usr/lib64/qt/plugins/styles/${PROJECT}5.so" + ) + + for f in ${files[@]}; do + sudo rm -rf "$f" + done +} + +case "$QT_BUILD" in +qt5 | QT5) + build_qt5 + ;; +qt6 | QT6) + build_qt6 + ;; +remove) + remove_qt5_files + remove_qt6_files + ;; +*) + build_default + ;; +esac diff --git a/kdecoration/CMakeLists.txt b/kdecoration/CMakeLists.txt index 7c365c44f..11b8155ea 100644 --- a/kdecoration/CMakeLists.txt +++ b/kdecoration/CMakeLists.txt @@ -29,9 +29,7 @@ set_target_properties(lightlydecoration PROPERTIES target_link_libraries(lightlydecoration PUBLIC - Qt::Core - Qt::Gui - Qt::DBus + Qt6::DBus KDecoration2::KDecoration PRIVATE lightlycommon6 @@ -43,8 +41,6 @@ target_link_libraries(lightlydecoration KF6::WindowSystem KF6::KCMUtils ) - install(TARGETS lightlydecoration DESTINATION ${KDE_INSTALL_PLUGINDIR}/${KDECORATION_PLUGIN_DIR}) install(FILES config/lightlydecorationconfig.desktop DESTINATION ${KDE_INSTALL_DATADIR}/kservices6) - add_subdirectory(config) diff --git a/kstyle/animations/lightlydialdata.cpp b/kstyle/animations/lightlydialdata.cpp index 02d72f7d4..e8f05a3a5 100644 --- a/kstyle/animations/lightlydialdata.cpp +++ b/kstyle/animations/lightlydialdata.cpp @@ -71,7 +71,12 @@ namespace Lightly QHoverEvent *hoverEvent = static_cast(event); // store position - _position = hoverEvent->position().toPoint(); + _position = +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + hoverEvent->position().toPoint(); +#else + hoverEvent->pos(); +#endif // trigger animation if position match handle rect updateState( _handleRect.contains( _position ) ); diff --git a/kstyle/animations/lightlyscrollbardata.cpp b/kstyle/animations/lightlyscrollbardata.cpp index 0ae4ca75b..49d5c84bd 100644 --- a/kstyle/animations/lightlyscrollbardata.cpp +++ b/kstyle/animations/lightlyscrollbardata.cpp @@ -140,15 +140,25 @@ namespace Lightly QStyleOptionSlider opt( qt_qscrollbarStyleOption( scrollBar ) ); // cast event - QHoverEvent *hoverEvent = static_cast(event); - QStyle::SubControl hoverControl = scrollBar->style()->hitTestComplexControl(QStyle::CC_ScrollBar, &opt, hoverEvent->position().toPoint(), scrollBar); - + QHoverEvent *hoverEvent = static_cast(event); + + QStyle::SubControl hoverControl = +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + scrollBar->style()->hitTestComplexControl(QStyle::CC_ScrollBar, &opt, hoverEvent->position().toPoint(), scrollBar); +#else + scrollBar->style()->hitTestComplexControl(QStyle::CC_ScrollBar, &opt, hoverEvent->pos(), scrollBar); +#endif // update hover state updateAddLineArrow( hoverControl ); updateSubLineArrow( hoverControl ); // store position - _position = hoverEvent->position().toPoint(); + _position = +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + hoverEvent->position().toPoint(); +#else + hoverEvent->pos(); +#endif } diff --git a/kstyle/lightlysplitterproxy.cpp b/kstyle/lightlysplitterproxy.cpp index 4960e629f..d35bffb3a 100644 --- a/kstyle/lightlysplitterproxy.cpp +++ b/kstyle/lightlysplitterproxy.cpp @@ -262,11 +262,19 @@ namespace Lightly } else { // map event position to current splitter and post. - QMouseEvent copy( - mouseEvent->type(), +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + QMouseEvent copy(mouseEvent->type(), _splitter.data()->mapFromGlobal( mouseEvent->globalPosition() ), mouseEvent->button(), - mouseEvent->buttons(), mouseEvent->modifiers()); + mouseEvent->buttons(), + mouseEvent->modifiers()); +#else + QMouseEvent copy(mouseEvent->type(), + _splitter.data()->mapFromGlobal(mouseEvent->globalPos()), + mouseEvent->button(), + mouseEvent->buttons(), + mouseEvent->modifiers()); +#endif QCoreApplication::sendEvent( _splitter.data(), © ); diff --git a/kstyle/lightlywindowmanager.cpp b/kstyle/lightlywindowmanager.cpp index fd04c1bc7..c883e7d4f 100644 --- a/kstyle/lightlywindowmanager.cpp +++ b/kstyle/lightlywindowmanager.cpp @@ -423,7 +423,12 @@ namespace Lightly { _quickTarget = item; _dragPoint = mouseEvent->pos(); - _globalDragPoint = mouseEvent->globalPosition().toPoint(); + _globalDragPoint = +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + mouseEvent->globalPosition().toPoint(); +#else + mouseEvent->globalPos(); +#endif if( _dragTimer.isActive() ) _dragTimer.stop(); _dragTimer.start( _dragDelay, this ); @@ -446,7 +451,12 @@ namespace Lightly // save target and drag point _target = widget; _dragPoint = position; - _globalDragPoint = mouseEvent->globalPosition().toPoint(); + _globalDragPoint = +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + mouseEvent->globalPosition().toPoint(); +#else + mouseEvent->globalPos(); +#endif _dragAboutToStart = true; // send a move event to the current child with same position @@ -475,6 +485,14 @@ namespace Lightly auto mouseEvent = static_cast( event ); if (mouseEvent->source() != Qt::MouseEventNotSynthesized) { return false; } + + auto eventPos = +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + mouseEvent->globalPosition().toPoint(); +#else + mouseEvent->globalPos(); +#endif + if( !_dragInProgress ) { @@ -489,8 +507,7 @@ namespace Lightly } else resetDrag(); - } else if (QPoint(mouseEvent->globalPosition().toPoint() - _globalDragPoint).manhattanLength() >= _dragDistance) { - + } else if (QPoint(eventPos - _globalDragPoint).manhattanLength() >= _dragDistance) { _dragTimer.start( 0, this ); } diff --git a/liblightlycommon/CMakeLists.txt b/liblightlycommon/CMakeLists.txt index 6a6711f6f..20e6564a8 100644 --- a/liblightlycommon/CMakeLists.txt +++ b/liblightlycommon/CMakeLists.txt @@ -15,8 +15,15 @@ generate_export_header(lightlycommon${QT_MAJOR_VERSION} target_link_libraries(lightlycommon${QT_MAJOR_VERSION} PUBLIC - Qt::Core - Qt::Gui) + Qt${QT_MAJOR_VERSION}::Core + Qt${QT_MAJOR_VERSION}::Gui + Qt${QT_MAJOR_VERSION}::Widgets + + KF${QT_MAJOR_VERSION}::GuiAddons + KF${QT_MAJOR_VERSION}::ConfigCore + KF${QT_MAJOR_VERSION}::ConfigGui + KF${QT_MAJOR_VERSION}::IconThemes + KF${QT_MAJOR_VERSION}::I18n) set_target_properties(lightlycommon${QT_MAJOR_VERSION} PROPERTIES VERSION ${PROJECT_VERSION} From 92c1db4650c573fff2b5a2f20112ad071b92a475 Mon Sep 17 00:00:00 2001 From: DeltaCopy <7x0bb03yq@mozmail.com> Date: Fri, 22 Nov 2024 10:40:59 +0000 Subject: [PATCH 02/19] Update README to reflect QT5 changes. --- README.md | 105 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 64 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 033e6e1fa..4bb3e2295 100644 --- a/README.md +++ b/README.md @@ -54,96 +54,119 @@ This means that this fork allows real changes, and not just maintainence. ## Manual +### To ensure this application style works on applications still using QT5 both QT5 and QT6 dependencies are require to be installed before building from source. + +### Installation script +A script called `install.sh` is now available which both builds and installs this application style. + +`./install.sh` will remove if existing, build and install Lightly. + +`./install.sh remove` will remove Lightly. + #### Void Linux ``` -sudo xbps-install -Sy extra-cmake-modules base-devel qt6-base qt6-base-devel qt6-tools-devel kf6-kcmutils-devel kf6-kconfigwidgets-devel kf6-kdecoration-devel kf6-kirigami-devel kf6-kcoreaddons-devel kf6-kcolorscheme-devel kf6-kconfig-devel kf6-kguiaddons-devel kf6-ki18n-devel kf6-kiconthemes-devel kf6-kwindowsystem-devel kf6-frameworkintegration-devel kf6-karchive-devel kf6-kcodecs-devel kf6-kwidgetsaddons-devel qt6-declarative-devel qt6-svg-devel qt6-wayland-devel kf6-kwidgetsaddons-devel kf6-knotifications-devel +sudo xbps-install -Sy git extra-cmake-modules base-devel qt6-base qt6-base-devel qt6-tools-devel kf6-kcmutils-devel kf6-kconfigwidgets-devel kf6-kdecoration-devel kf6-kirigami-devel kf6-kcoreaddons-devel kf6-kcolorscheme-devel kf6-kconfig-devel kf6-kguiaddons-devel kf6-ki18n-devel kf6-kiconthemes-devel kf6-kwindowsystem-devel kf6-frameworkintegration-devel kf6-karchive-devel kf6-kcodecs-devel kf6-kwidgetsaddons-devel qt6-declarative-devel qt6-svg-devel qt6-wayland-devel kf6-kwidgetsaddons-devel kf6-knotifications-devel +``` +``` +git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git +cd Lightly +./install.sh QT6 ``` *** -#### Arch Linux +#### Arch Linux ``` -sudo pacman -S cmake extra-cmake-modules kdecoration qt6-declarative kcoreaddons kcmutils kcolorscheme kconfig kguiaddons kiconthemes kwindowsystem git +sudo pacman -S --noconfirm \ + cmake extra-cmake-modules kdecoration qt6-declarative kcoreaddons \ + kcmutils kcolorscheme kconfig kguiaddons kiconthemes kwindowsystem git \ + qt5-declarative qt5-x11extras gcc make kcmutils5 \ + frameworkintegration5 kconfigwidgets5 kiconthemes5 \ + kirigami2 kwindowsystem5 ``` ``` git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git -cd Lightly && mkdir build && cd build -cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_TESTING=OFF .. -cd ./kdecoration/config/ -make -j $(nproc) -cd ../../ -make -j $(nproc) -sudo make install +cd Lightly +./install.sh ``` *** -#### Fedora +#### Fedora ##### Fedora 40/41 ``` -sudo dnf install -y git cmake extra-cmake-modules "cmake(KDecoration2)" kwin-devel \ - kf6-kcolorscheme-devel kf6-kguiaddons-devel kf6-ki18n-devel kf6-kiconthemes-devel \ - kf6-kirigami-devel kf6-kcmutils-devel kf6-frameworkintegration-devel +sudo dnf install -y \ + git cmake extra-cmake-modules "cmake(KDecoration2)" kwin-devel \ + kf6-kcolorscheme-devel kf6-kguiaddons-devel kf6-ki18n-devel kf6-kiconthemes-devel \ + kf6-kirigami-devel kf6-kcmutils-devel kf6-frameworkintegration-devel \ + libepoxy-devel "cmake(Qt5Core)" "cmake(Qt5Gui)" "cmake(Qt5DBus)" "cmake(KF5GuiAddons)" \ + "cmake(KF5WindowSystem)" "cmake(KF5I18n)" "cmake(KF5CoreAddons)" "cmake(KF5ConfigWidgets)" \ + "cmake(Qt5UiTools)" "cmake(KF5GlobalAccel)" "cmake(KF5IconThemes)" "cmake(KF5Init)" \ + "cmake(KF5KIO)" kf5-kpackage-devel kf5-kcmutils-devel qt5-qtquickcontrols2-devel \ + kf5-kirigami2-devel "cmake(KF5FrameworkIntegration)" ``` ``` git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git -cd Lightly && mkdir build && cd build -cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_LIBDIR=lib64 -DBUILD_TESTING=OFF .. -cd ./kdecoration/config/ -make -j $(nproc) -cd ../../ -make -j $(nproc) -sudo make install +cd Lightly +./install.sh ``` *** -#### openSUSE Tumbleweed +#### openSUSE Tumbleweed ``` -sudo zypper in --no-recommends ninja cmake kf6-extra-cmake-modules kf6-kconfig-devel kf6-frameworkintegration-devel gmp-ecm-devel kf6-kconfigwidgets-devel kf6-kguiaddons-devel kf6-ki18n-devel kf6-kiconthemes-devel kf6-kwindowsystem-devel kf6-kcolorscheme-devel kf6-kcoreaddons-devel kf6-kcmutils-devel kcmutils qt6-quick-devel kf6-kirigami-devel qt6-base-devel kdecoration6-devel qt6-tools qt6-widgets-devel gcc-c++ extra-cmake-modules libQt5Gui-devel libQt5DBus-devel libqt5-qttools-devel libqt5-qtx11extras-devel libQt5OpenGL-devel libQt5Network-devel libepoxy-devel kconfig-devel kconfigwidgets-devel kcrash-devel kglobalaccel-devel ki18n-devel kio-devel kservice-devel kinit-devel knotifications-devel kwindowsystem-devel kguiaddons-devel kiconthemes-devel kpackage-devel kwin5-devel xcb-util-devel xcb-util-cursor-devel xcb-util-wm-devel xcb-util-keysyms-devel git +sudo zypper in --no-recommends \ + git ninja cmake kf6-extra-cmake-modules kf6-kconfig-devel \ + kf6-frameworkintegration-devel gmp-ecm-devel kf6-kconfigwidgets-devel \ + kf6-kguiaddons-devel kf6-ki18n-devel kf6-kiconthemes-devel kf6-kwindowsystem-devel \ + kf6-kcolorscheme-devel kf6-kcoreaddons-devel kf6-kcmutils-devel kcmutils \ + qt6-quick-devel kf6-kirigami-devel qt6-base-devel kdecoration6-devel \ + qt6-tools qt6-widgets-devel gcc-c++ extra-cmake-modules libQt5Gui-devel \ + libQt5DBus-devel libqt5-qttools-devel libqt5-qtx11extras-devel \ + libQt5OpenGL-devel libQt5Network-devel libepoxy-devel kconfig-devel \ + kconfigwidgets-devel kcrash-devel kglobalaccel-devel ki18n-devel kio-devel \ + kservice-devel kinit-devel knotifications-devel kwindowsystem-devel kguiaddons-devel \ + kiconthemes-devel kpackage-devel kwin5-devel xcb-util-devel xcb-util-cursor-devel \ + xcb-util-wm-devel xcb-util-keysyms-devel kcmutils-devel \ + libqt5-qtquick3d-devel kirigami2-devel libKF5I18n5 ``` ``` git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git -cd Lightly && mkdir build && cd build -cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_LIBDIR=lib64 -DBUILD_TESTING=OFF .. -cd ./kdecoration/config/ -make -j $(nproc) -cd ../../ -make -j $(nproc) -sudo make install +cd Lightly +./install.sh ``` *** -#### KDE neon +#### KDE neon ``` sudo apt install git build-essential cmake kf6-extra-cmake-modules kf6-extra-cmake-modules kf6-frameworkintegration-dev kf6-kcmutils-dev kf6-kcolorscheme-dev kf6-kconfig-dev kf6-kconfigwidgets-dev kf6-kcoreaddons-dev kf6-kguiaddons-dev kf6-ki18n-dev kf6-kiconthemes-dev kf6-kirigami2-dev kf6-kpackage-dev kf6-kservice-dev kf6-kwindowsystem-dev kirigami2-dev kwayland-dev libx11-dev libkdecorations2-dev libkf5config-dev libkf5configwidgets-dev libkf5coreaddons-dev libkf5guiaddons-dev libkf5i18n-dev libkf5iconthemes-dev libkf5kcmutils-dev libkf5package-dev libkf5service-dev libkf5style-dev libkf5wayland-dev libkf5windowsystem-dev libplasma-dev libqt5x11extras5-dev qt6-base-dev qt6-declarative-dev qtbase5-dev qtdeclarative5-dev gettext qt6-svg-dev extra-cmake-modules qt3d5-dev ``` ``` git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git -cd Lightly && mkdir build && cd build -cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_TESTING=OFF .. -cd ./kdecoration/config/ -make -j $(nproc) -cd ../../ -make -j $(nproc) -sudo make install +cd Lightly +./install.sh ``` *** -#### Distrobox (Fedora 41) +#### Distrobox (Fedora 41) ``` distrobox create --name lightly --image registry.fedoraproject.org/fedora-toolbox:41 distrobox enter lightly ``` ``` -sudo dnf install -y cmake extra-cmake-modules "cmake(KDecoration2)" kwin-devel \ +sudo dnf install -y git cmake extra-cmake-modules "cmake(KDecoration2)" kwin-devel \ kf6-kcolorscheme-devel kf6-kguiaddons-devel kf6-ki18n-devel kf6-kiconthemes-devel \ - kf6-kirigami-devel kf6-kcmutils-devel + kf6-kirigami-devel kf6-kcmutils-devel \ + libepoxy-devel "cmake(Qt5Core)" "cmake(Qt5Gui)" "cmake(Qt5DBus)" "cmake(KF5GuiAddons)" \ + "cmake(KF5WindowSystem)" "cmake(KF5I18n)" "cmake(KF5CoreAddons)" "cmake(KF5ConfigWidgets)" \ + "cmake(Qt5UiTools)" "cmake(KF5GlobalAccel)" "cmake(KF5IconThemes)" "cmake(KF5Init)" \ + "cmake(KF5KIO)" kf5-kpackage-devel kf5-kcmutils-devel qt5-qtquickcontrols2-devel \ + kf5-kirigami2-devel "cmake(KF5FrameworkIntegration)" git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git cd Lightly From 48308714895e21cef965a0b1309db3e384e767e6 Mon Sep 17 00:00:00 2001 From: DeltaCopy <7x0bb03yq@mozmail.com> Date: Fri, 22 Nov 2024 10:43:24 +0000 Subject: [PATCH 03/19] Added install.sh steps. --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4bb3e2295..1587ecb50 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,11 @@ A script called `install.sh` is now available which both builds and installs thi `./install.sh` will remove if existing, build and install Lightly. -`./install.sh remove` will remove Lightly. +`./install.sh` remove` will remove Lightly. + +`./install.sh QT5` will build only using QT5/KF5 dependencies + +`./install.sh QT6` will build only using QT6/KF6 dependencies #### Void Linux ``` From c225e204830d08f278633a3c82075b2a541309ee Mon Sep 17 00:00:00 2001 From: DeltaCopy <7x0bb03yq@mozmail.com> Date: Fri, 22 Nov 2024 10:45:34 +0000 Subject: [PATCH 04/19] Formatting void linux dependencies. --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1587ecb50..819b0a384 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,14 @@ A script called `install.sh` is now available which both builds and installs thi #### Void Linux ``` -sudo xbps-install -Sy git extra-cmake-modules base-devel qt6-base qt6-base-devel qt6-tools-devel kf6-kcmutils-devel kf6-kconfigwidgets-devel kf6-kdecoration-devel kf6-kirigami-devel kf6-kcoreaddons-devel kf6-kcolorscheme-devel kf6-kconfig-devel kf6-kguiaddons-devel kf6-ki18n-devel kf6-kiconthemes-devel kf6-kwindowsystem-devel kf6-frameworkintegration-devel kf6-karchive-devel kf6-kcodecs-devel kf6-kwidgetsaddons-devel qt6-declarative-devel qt6-svg-devel qt6-wayland-devel kf6-kwidgetsaddons-devel kf6-knotifications-devel +sudo xbps-install -Sy \ + git extra-cmake-modules base-devel qt6-base qt6-base-devel qt6-tools-devel \ + kf6-kcmutils-devel kf6-kconfigwidgets-devel kf6-kdecoration-devel \ + kf6-kirigami-devel kf6-kcoreaddons-devel kf6-kcolorscheme-devel \ + kf6-kconfig-devel kf6-kguiaddons-devel kf6-ki18n-devel kf6-kiconthemes-devel \ + kf6-kwindowsystem-devel kf6-frameworkintegration-devel kf6-karchive-devel \ + kf6-kcodecs-devel kf6-kwidgetsaddons-devel qt6-declarative-devel \ + qt6-svg-devel qt6-wayland-devel kf6-kwidgetsaddons-devel kf6-knotifications-devel ``` ``` git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git From a21354b47db69a65fbd59827e8d4ec76335ba2f7 Mon Sep 17 00:00:00 2001 From: DeltaCopy <7x0bb03yq@mozmail.com> Date: Fri, 22 Nov 2024 10:48:36 +0000 Subject: [PATCH 05/19] Cleanup install.sh instructions. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 819b0a384..e6bc8d1d3 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ This means that this fork allows real changes, and not just maintainence. ### Installation script A script called `install.sh` is now available which both builds and installs this application style. -`./install.sh` will remove if existing, build and install Lightly. +`./install.sh` will remove if existing, build and install Lightly using both QT5/QT6 dependencies. -`./install.sh` remove` will remove Lightly. +`./install.sh QT5` will build & install using only QT5/KF5 dependencies. -`./install.sh QT5` will build only using QT5/KF5 dependencies +`./install.sh QT6` will build & install using only QT6/KF6 dependencies. -`./install.sh QT6` will build only using QT6/KF6 dependencies +`./install.sh remove` will remove Lightly. #### Void Linux ``` From c5e0f804abfe850755472a69c1d865b1f7da82b3 Mon Sep 17 00:00:00 2001 From: DeltaCopy <7x0bb03yq@mozmail.com> Date: Fri, 22 Nov 2024 10:52:19 +0000 Subject: [PATCH 06/19] Cleanup Neon instructions. --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e6bc8d1d3..104143ae1 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,17 @@ cd Lightly #### KDE neon ``` -sudo apt install git build-essential cmake kf6-extra-cmake-modules kf6-extra-cmake-modules kf6-frameworkintegration-dev kf6-kcmutils-dev kf6-kcolorscheme-dev kf6-kconfig-dev kf6-kconfigwidgets-dev kf6-kcoreaddons-dev kf6-kguiaddons-dev kf6-ki18n-dev kf6-kiconthemes-dev kf6-kirigami2-dev kf6-kpackage-dev kf6-kservice-dev kf6-kwindowsystem-dev kirigami2-dev kwayland-dev libx11-dev libkdecorations2-dev libkf5config-dev libkf5configwidgets-dev libkf5coreaddons-dev libkf5guiaddons-dev libkf5i18n-dev libkf5iconthemes-dev libkf5kcmutils-dev libkf5package-dev libkf5service-dev libkf5style-dev libkf5wayland-dev libkf5windowsystem-dev libplasma-dev libqt5x11extras5-dev qt6-base-dev qt6-declarative-dev qtbase5-dev qtdeclarative5-dev gettext qt6-svg-dev extra-cmake-modules qt3d5-dev +sudo apt install -y \ + git build-essential cmake kf6-extra-cmake-modules kf6-extra-cmake-modules kf6-frameworkintegration-dev \ + kf6-kcmutils-dev kf6-kcolorscheme-dev kf6-kconfig-dev kf6-kconfigwidgets-dev \ + kf6-kcoreaddons-dev kf6-kguiaddons-dev kf6-ki18n-dev kf6-kiconthemes-dev \ + kf6-kirigami2-dev kf6-kpackage-dev kf6-kservice-dev kf6-kwindowsystem-dev \ + kirigami2-dev kwayland-dev libx11-dev libkdecorations2-dev libkf5config-dev \ + libkf5configwidgets-dev libkf5coreaddons-dev libkf5guiaddons-dev libkf5i18n-dev \ + libkf5iconthemes-dev libkf5kcmutils-dev libkf5package-dev libkf5service-dev \ + libkf5style-dev libkf5wayland-dev libkf5windowsystem-dev libplasma-dev \ + libqt5x11extras5-dev qt6-base-dev qt6-declarative-dev qtbase5-dev \ + qtdeclarative5-dev gettext qt6-svg-dev extra-cmake-modules qt3d5-dev ``` ``` git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git From 6a8619aaf625d10bd605247a37c6973ea74f52b7 Mon Sep 17 00:00:00 2001 From: DeltaCopy <7x0bb03yq@mozmail.com> Date: Fri, 22 Nov 2024 18:31:56 +0000 Subject: [PATCH 07/19] Pass in additional cmake arguments for qt5/6 --- README.md | 6 ++++-- install.sh | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 104143ae1..7cbb55ba8 100644 --- a/README.md +++ b/README.md @@ -54,10 +54,12 @@ This means that this fork allows real changes, and not just maintainence. ## Manual -### To ensure this application style works on applications still using QT5 both QT5 and QT6 dependencies are require to be installed before building from source. +### To ensure this application style works on applications still using QT5 both QT5 and QT6 dependencies are required to be installed before building from source. ### Installation script -A script called `install.sh` is now available which both builds and installs this application style. + +> [!NOTE] +> A script called `install.sh` is now available which both builds and installs this application style. `./install.sh` will remove if existing, build and install Lightly using both QT5/QT6 dependencies. diff --git a/install.sh b/install.sh index 7b23a8a2f..5c80d783a 100755 --- a/install.sh +++ b/install.sh @@ -8,6 +8,7 @@ CMAKE_OPTS=( -S $SRC_DIR -DBUILD_TESTING=OFF -Wno-dev + -DKDE_INSTALL_USE_QT_SYS_PATHS=ON ) PROJECT="lightly" _PROJECT="Lightly" From 3165e61c6f4386eb40e6451fe2a612d871ea8b75 Mon Sep 17 00:00:00 2001 From: DeltaCopy <7x0bb03yq@mozmail.com> Date: Fri, 22 Nov 2024 19:05:01 +0000 Subject: [PATCH 08/19] Added Kubuntu build/install steps --- README.md | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7cbb55ba8..cefae19ca 100644 --- a/README.md +++ b/README.md @@ -110,8 +110,7 @@ cd Lightly ##### Fedora 40/41 ``` -sudo dnf install -y \ - git cmake extra-cmake-modules "cmake(KDecoration2)" kwin-devel \ +sudo dnf install -y git cmake extra-cmake-modules "cmake(KDecoration2)" kwin-devel \ kf6-kcolorscheme-devel kf6-kguiaddons-devel kf6-ki18n-devel kf6-kiconthemes-devel \ kf6-kirigami-devel kf6-kcmutils-devel kf6-frameworkintegration-devel \ libepoxy-devel "cmake(Qt5Core)" "cmake(Qt5Gui)" "cmake(Qt5DBus)" "cmake(KF5GuiAddons)" \ @@ -130,8 +129,7 @@ cd Lightly #### openSUSE Tumbleweed ``` -sudo zypper in --no-recommends \ - git ninja cmake kf6-extra-cmake-modules kf6-kconfig-devel \ +sudo zypper in --no-recommends git ninja cmake kf6-extra-cmake-modules kf6-kconfig-devel \ kf6-frameworkintegration-devel gmp-ecm-devel kf6-kconfigwidgets-devel \ kf6-kguiaddons-devel kf6-ki18n-devel kf6-kiconthemes-devel kf6-kwindowsystem-devel \ kf6-kcolorscheme-devel kf6-kcoreaddons-devel kf6-kcmutils-devel kcmutils \ @@ -155,8 +153,8 @@ cd Lightly #### KDE neon ``` -sudo apt install -y \ - git build-essential cmake kf6-extra-cmake-modules kf6-extra-cmake-modules kf6-frameworkintegration-dev \ +sudo apt install -y git build-essential cmake kf6-extra-cmake-modules \ + kf6-extra-cmake-modules kf6-frameworkintegration-dev \ kf6-kcmutils-dev kf6-kcolorscheme-dev kf6-kconfig-dev kf6-kconfigwidgets-dev \ kf6-kcoreaddons-dev kf6-kguiaddons-dev kf6-ki18n-dev kf6-kiconthemes-dev \ kf6-kirigami2-dev kf6-kpackage-dev kf6-kservice-dev kf6-kwindowsystem-dev \ @@ -206,6 +204,21 @@ cd ../../ make -j $(nproc) make install ``` +#### Kubuntu (24.10) +``` +sudo apt-get install -y -qq cmake build-essential libkf5config-dev libkdecorations2-dev \ + libqt5x11extras5-dev qtdeclarative5-dev extra-cmake-modules \ + libkf5guiaddons-dev libkf5configwidgets-dev libkf5windowsystem-dev kirigami2-dev \ + libkf5coreaddons-dev libkf5iconthemes-dev gettext qt3d5-dev libkf5kcmutils-dev \ + qt6-base-dev libkf6coreaddons-dev libkf6colorscheme-dev \ + libkf6config-dev libkf6guiaddons-dev libkf6i18n-dev libkf6iconthemes-dev \ + libkf6windowsystem-dev libkf6kcmutils-dev libkirigami-dev +``` +``` +git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git +cd Lightly +./install.sh +``` Set environment variable on plasma startup: ``` From 852bf6fc23c58682977e664b8e78e1789bca66da Mon Sep 17 00:00:00 2001 From: DeltaCopy <7x0bb03yq@mozmail.com> Date: Fri, 22 Nov 2024 19:11:48 +0000 Subject: [PATCH 09/19] README update, adding missing line separator --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index cefae19ca..1b416a302 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,9 @@ cd ../../ make -j $(nproc) make install ``` +*** + + #### Kubuntu (24.10) ``` sudo apt-get install -y -qq cmake build-essential libkf5config-dev libkdecorations2-dev \ From f567b9f1e12bc02d2871892be1fc7727bed09249 Mon Sep 17 00:00:00 2001 From: DeltaCopy <7x0bb03yq@mozmail.com> Date: Fri, 22 Nov 2024 19:13:02 +0000 Subject: [PATCH 10/19] Moved the fedora distrobox steps back up --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1b416a302..8419503a5 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,13 @@ cd ../../ make -j $(nproc) make install ``` +``` + +Set environment variable on plasma startup: +``` +echo "export QT_PLUGIN_PATH=$HOME/.local/lib64/plugins:\$QT_PLUGIN_PATH" > $HOME/.config/plasma-workspace/env/localthemes.sh && chmod +x $HOME/.config/plasma-workspace/env/localthemes.sh +``` + *** @@ -221,12 +228,7 @@ sudo apt-get install -y -qq cmake build-essential libkf5config-dev libkdecoratio git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git cd Lightly ./install.sh -``` -Set environment variable on plasma startup: -``` -echo "export QT_PLUGIN_PATH=$HOME/.local/lib64/plugins:\$QT_PLUGIN_PATH" > $HOME/.config/plasma-workspace/env/localthemes.sh && chmod +x $HOME/.config/plasma-workspace/env/localthemes.sh -``` *** ## Known issues & solutions From 9c7bbb7b9ef593d9d18d36204c44754686c8f47f Mon Sep 17 00:00:00 2001 From: DeltaCopy <7x0bb03yq@mozmail.com> Date: Fri, 22 Nov 2024 19:15:47 +0000 Subject: [PATCH 11/19] README update --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8419503a5..5068b3bfd 100644 --- a/README.md +++ b/README.md @@ -205,15 +205,12 @@ make -j $(nproc) make install ``` ``` - Set environment variable on plasma startup: -``` + echo "export QT_PLUGIN_PATH=$HOME/.local/lib64/plugins:\$QT_PLUGIN_PATH" > $HOME/.config/plasma-workspace/env/localthemes.sh && chmod +x $HOME/.config/plasma-workspace/env/localthemes.sh ``` - *** - #### Kubuntu (24.10) ``` sudo apt-get install -y -qq cmake build-essential libkf5config-dev libkdecorations2-dev \ @@ -228,8 +225,7 @@ sudo apt-get install -y -qq cmake build-essential libkf5config-dev libkdecoratio git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git cd Lightly ./install.sh - -*** +``` ## Known issues & solutions From 996214cd37ace298d4874b8ad7d84a4040112262 Mon Sep 17 00:00:00 2001 From: DeltaCopy <7x0bb03yq@mozmail.com> Date: Fri, 22 Nov 2024 19:16:26 +0000 Subject: [PATCH 12/19] README update --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5068b3bfd..979945058 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,7 @@ This means that this fork allows real changes, and not just maintainence. #### Void Linux ``` -sudo xbps-install -Sy \ - git extra-cmake-modules base-devel qt6-base qt6-base-devel qt6-tools-devel \ +sudo xbps-install -Sy git extra-cmake-modules base-devel qt6-base qt6-base-devel qt6-tools-devel \ kf6-kcmutils-devel kf6-kconfigwidgets-devel kf6-kdecoration-devel \ kf6-kirigami-devel kf6-kcoreaddons-devel kf6-kcolorscheme-devel \ kf6-kconfig-devel kf6-kguiaddons-devel kf6-ki18n-devel kf6-kiconthemes-devel \ @@ -90,8 +89,7 @@ cd Lightly #### Arch Linux ``` -sudo pacman -S --noconfirm \ - cmake extra-cmake-modules kdecoration qt6-declarative kcoreaddons \ +sudo pacman -S --noconfirm cmake extra-cmake-modules kdecoration qt6-declarative kcoreaddons \ kcmutils kcolorscheme kconfig kguiaddons kiconthemes kwindowsystem git \ qt5-declarative qt5-x11extras gcc make kcmutils5 \ frameworkintegration5 kconfigwidgets5 kiconthemes5 \ From 31699923e0ecbd1456ec74729cec93c2b35a5ae7 Mon Sep 17 00:00:00 2001 From: DeltaCopy <7x0bb03yq@mozmail.com> Date: Fri, 22 Nov 2024 19:17:14 +0000 Subject: [PATCH 13/19] README update --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 979945058..430d3d739 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,7 @@ git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git cd Lightly ./install.sh ``` +*** ## Known issues & solutions From 2e1c8d20c1441befa5c4beab8f6f15681ad834dd Mon Sep 17 00:00:00 2001 From: zspher <66728045+zspher@users.noreply.github.com> Date: Wed, 27 Nov 2024 01:20:25 -0700 Subject: [PATCH 14/19] feat: add initial nixos support --- .gitignore | 2 ++ flake.lock | 43 ++++++++++++++++++++++++++ flake.nix | 39 ++++++++++++++++++++++++ nix/package.nix | 81 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 165 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 nix/package.nix diff --git a/.gitignore b/.gitignore index 83a5014d4..9e4065028 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .vscode/ build/ .clang-format + +result* diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..dbe385190 --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1732014248, + "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..8695e71f3 --- /dev/null +++ b/flake.nix @@ -0,0 +1,39 @@ +{ + description = "Fork of breeze theme style that aims to be visually modern and minimalistic"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + # + systems.url = "github:nix-systems/default-linux"; + }; + + outputs = + { + nixpkgs, + systems, + ... + }: + let + inherit (nixpkgs) lib; + perSystem = + f: + lib.genAttrs (import systems) ( + system: + f { + pkgs = import nixpkgs { inherit system; }; + } + ); + in + { + packages = perSystem ( + { pkgs }: + rec { + default = lightly-qt6; + lightly-qt6 = pkgs.kdePackages.callPackage ./nix/package.nix { }; + lightly-qt5 = pkgs.libsForQt5.callPackage ./nix/package.nix { inherit lightly-qt6; }; + } + ); + + }; +} diff --git a/nix/package.nix b/nix/package.nix new file mode 100644 index 000000000..44397337a --- /dev/null +++ b/nix/package.nix @@ -0,0 +1,81 @@ +{ + lib, + stdenv, + cmake, + qtbase, + wrapQtAppsHook, + kwindowsystem, + kiconthemes, + kdecoration, + kcoreaddons, + kcolorscheme ? null, + kcmutils, + frameworkintegration, + extra-cmake-modules, + lightly-qt6 ? null, +}: +let + inherit (builtins) baseNameOf; + inherit (lib.sources) cleanSourceWith cleanSource; + inherit (lib.strings) hasSuffix; + isQt5 = lib.versionOlder qtbase.version "6"; +in +stdenv.mkDerivation (finalAttrs: { + pname = "lightly-qt${if isQt5 then "5" else "6"}"; + version = "0.5.7"; + + src = cleanSourceWith { + filter = + name: _type: + let + baseName = baseNameOf (toString name); + in + !(hasSuffix ".nix" baseName); + src = cleanSource ../.; + }; + + postInstall = lib.optionalString isQt5 '' + rm -r $out/share + ln -s "${lightly-qt6}/share" "$out/share" + ln -s "${lightly-qt6}/bin" "$out/bin" + ''; + + buildInputs = [ qtbase ]; + + propagatedBuildInputs = + [ + frameworkintegration + kcmutils + kcoreaddons + kdecoration + kiconthemes + kwindowsystem + ] + ++ lib.optionals (!isQt5) [ + kcolorscheme + ]; + + nativeBuildInputs = [ + cmake + extra-cmake-modules + wrapQtAppsHook + ]; + + cmakeFlags = [ + (lib.cmakeBool "BUILD_QT5" isQt5) + (lib.cmakeBool "BUILD_QT6" (!isQt5)) + ]; + + outputs = [ + "out" + "dev" + ]; + + meta = with lib; { + description = "Fork of the Lightly breeze theme style that aims to be visually modern and minimalistic"; + mainProgram = "lightly-settings6"; + homepage = "https://github.com/Bali10050/Lightly"; + license = licenses.gpl2Plus; + platforms = platforms.all; + }; +}) From 9c936d60ded8b0db3cb440fab894bc7da616c38a Mon Sep 17 00:00:00 2001 From: zspher <66728045+zspher@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:51:23 -0700 Subject: [PATCH 15/19] feat(flake): make systems local --- flake.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 8695e71f3..0c4fd8fa1 100644 --- a/flake.nix +++ b/flake.nix @@ -3,22 +3,22 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - - # - systems.url = "github:nix-systems/default-linux"; }; outputs = { nixpkgs, - systems, ... }: let inherit (nixpkgs) lib; + systems = [ + "aarch64-linux" + "x86_64-linux" + ]; perSystem = f: - lib.genAttrs (import systems) ( + lib.genAttrs systems ( system: f { pkgs = import nixpkgs { inherit system; }; From b54409ef885f54bc3eafbde6f4d6c12ea79c8a47 Mon Sep 17 00:00:00 2001 From: zspher <66728045+zspher@users.noreply.github.com> Date: Fri, 29 Nov 2024 16:21:02 -0700 Subject: [PATCH 16/19] chore: update flake.lock --- flake.lock | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/flake.lock b/flake.lock index dbe385190..d98d6b864 100644 --- a/flake.lock +++ b/flake.lock @@ -18,23 +18,7 @@ }, "root": { "inputs": { - "nixpkgs": "nixpkgs", - "systems": "systems" - } - }, - "systems": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" + "nixpkgs": "nixpkgs" } } }, From 5ea8687ce93c84e362a9b5f7a3b0cc92b1bc9406 Mon Sep 17 00:00:00 2001 From: DeltaCopy <7x0bb03yq@mozmail.com> Date: Sat, 30 Nov 2024 17:22:01 +0000 Subject: [PATCH 17/19] Cleaned up compiler warnings --- kstyle/lightlyhelper.cpp | 61 +++++++++++++++++++++------------ kstyle/lightlyhelper.h | 26 +++++++++++--- kstyle/lightlysplitterproxy.cpp | 45 ++++++++++++++---------- kstyle/lightlystyle.cpp | 39 +++++++++++---------- kstyle/lightlywindowmanager.cpp | 13 +++++-- 5 files changed, 117 insertions(+), 67 deletions(-) diff --git a/kstyle/lightlyhelper.cpp b/kstyle/lightlyhelper.cpp index 8d53c076b..616c0a671 100644 --- a/kstyle/lightlyhelper.cpp +++ b/kstyle/lightlyhelper.cpp @@ -40,6 +40,8 @@ #include #include +#include + //#include namespace Lightly @@ -49,24 +51,41 @@ namespace Lightly static const qreal arrowShade = 0.15; //____________________________________________________________________ - Helper::Helper( KSharedConfig::Ptr config, QObject *parent ): - _config( std::move( config ) ) + PaletteChangedEventFilter::PaletteChangedEventFilter(Helper *helper) + : QObject(helper) + , _helper(helper) { - - if ( qApp ) { - connect(qApp, &QApplication::paletteChanged, this, [this]() { - if (qApp->property("KDE_COLOR_SCHEME_PATH").isValid()) { - const auto path = qApp->property("KDE_COLOR_SCHEME_PATH").toString(); - KConfig config(path, KConfig::SimpleConfig); - KConfigGroup group( config.group("WM") ); - const QPalette palette( QApplication::palette() ); - _activeTitleBarColor = group.readEntry( "activeBackground", palette.color( QPalette::Active, QPalette::Highlight ) ); - _activeTitleBarTextColor = group.readEntry( "activeForeground", palette.color( QPalette::Active, QPalette::HighlightedText ) ); - _inactiveTitleBarColor = group.readEntry( "inactiveBackground", palette.color( QPalette::Disabled, QPalette::Highlight ) ); - _inactiveTitleBarTextColor = group.readEntry( "inactiveForeground", palette.color( QPalette::Disabled, QPalette::HighlightedText ) ); - } - }); + } + + //____________________________________________________________________ + bool PaletteChangedEventFilter::eventFilter(QObject *watched, QEvent *event) { + if (event->type() != QEvent::ApplicationPaletteChange || watched != qApp) { + return QObject::eventFilter(watched, event); + } + if (!qApp->property("KDE_COLOR_SCHEME_PATH").isValid()) { + return QObject::eventFilter(watched, event); } + const auto path = qApp->property("KDE_COLOR_SCHEME_PATH").toString(); + if (!path.isEmpty()) { + KConfig config(path, KConfig::SimpleConfig); + KConfigGroup group(config.group(QStringLiteral("WM"))); + const QPalette palette(QApplication::palette()); + _helper->_activeTitleBarColor = group.readEntry("activeBackground", palette.color(QPalette::Active, QPalette::Highlight)); + _helper->_activeTitleBarTextColor = group.readEntry("activeForeground", palette.color(QPalette::Active, QPalette::HighlightedText)); + _helper->_inactiveTitleBarColor = group.readEntry("inactiveBackground", palette.color(QPalette::Disabled, QPalette::Highlight)); + _helper->_inactiveTitleBarTextColor = group.readEntry("inactiveForeground", palette.color(QPalette::Disabled, QPalette::HighlightedText)); + } + return QObject::eventFilter(watched, event); + } + + + + //____________________________________________________________________ + Helper::Helper( KSharedConfig::Ptr config, QObject *parent ) + : QObject(parent) + , _config( std::move( config ) ) + , _eventFilter(new PaletteChangedEventFilter(this)) + { } //____________________________________________________________________ @@ -142,7 +161,7 @@ namespace Lightly { return KColorUtils::mix( hoverColor( palette ), palette.color( QPalette::ButtonText ), 0.15 ); } //____________________________________________________________________ - QColor Helper::sidePanelOutlineColor( const QPalette& palette, bool hasFocus, qreal opacity, AnimationMode mode ) const + QColor Helper::sidePanelOutlineColor( const QPalette& palette ) const { QColor outline( qGray(palette.color( QPalette::Window ).rgb()) > 150 ? QColor(0,0,0,20) : QColor(0,0,0,50) ); @@ -465,7 +484,7 @@ namespace Lightly //______________________________________________________________________________ void Helper::renderFrame( QPainter* painter, const QRect& rect, - const QColor& color, const QPalette& palette, const bool windowActive, const bool enabled ) const + const QColor& color, const bool windowActive, const bool enabled ) const { painter->setRenderHint( QPainter::Antialiasing ); @@ -1514,16 +1533,14 @@ namespace Lightly //______________________________________________________________________________ void Helper::renderProgressBarGroove( QPainter* painter, const QRect& rect, - const QColor& color, const bool isContent ) const + const QColor& color ) const { // setup painter painter->setRenderHint( QPainter::Antialiasing, true ); const QRectF baseRect( rect ); - - int thickness = Metrics::ProgressBar_Thickness; - if( !isContent ) thickness = qMax(Metrics::ProgressBar_Thickness-2, 0); + const qreal radius(0.5 * static_cast(Metrics::ProgressBar_Thickness)); // content diff --git a/kstyle/lightlyhelper.h b/kstyle/lightlyhelper.h index 8f060087d..e2ecfc2b0 100644 --- a/kstyle/lightlyhelper.h +++ b/kstyle/lightlyhelper.h @@ -38,6 +38,7 @@ namespace Lightly { + class PaletteChangedEventFilter; //* lightly style helper class. /** contains utility functions used at multiple places in both lightly style and lightly window decoration */ @@ -108,7 +109,7 @@ namespace Lightly QColor buttonHoverOutlineColor( const QPalette& ) const; //* side panel outline color, using animations - QColor sidePanelOutlineColor( const QPalette&, bool hasFocus = false, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; + QColor sidePanelOutlineColor( const QPalette& ) const; //* frame background color QColor frameBackgroundColor( const QPalette& palette ) const @@ -163,7 +164,7 @@ namespace Lightly void renderFocusLine( QPainter*, const QRect&, const QColor& ) const; //* generic frame - void renderFrame( QPainter*, const QRect&, const QColor& color, const QPalette& palette, const bool windowActive, const bool enabled = true ) const; + void renderFrame( QPainter*, const QRect&, const QColor& color, const bool windowActive, const bool enabled = true ) const; //* side panel frame void renderSidePanelFrame( QPainter*, const QRect&, const QColor& outline, Side ) const; @@ -232,11 +233,11 @@ namespace Lightly void renderDialContents( QPainter*, const QRect&, const QColor&, qreal first, qreal second ) const; //* progress bar groove - void renderProgressBarGroove( QPainter*, const QRect&, const QColor&, const bool isContent = false ) const; + void renderProgressBarGroove( QPainter*, const QRect&, const QColor& ) const; //* progress bar contents void renderProgressBarContents( QPainter* painter, const QRect& rect, const QColor& color ) const - { return renderProgressBarGroove( painter, rect, color, true ); } + { return renderProgressBarGroove( painter, rect, color ); } //* progress bar contents (animated) void renderProgressBarBusyContents( QPainter* painter, const QRect& rect, const QColor& first, const QColor& second, bool horizontal, bool reverse, int progress ) const; @@ -334,6 +335,9 @@ namespace Lightly KStatefulBrush _windowAlternateBackgroundBrush; //@} + //* event filter + PaletteChangedEventFilter *_eventFilter; + //*@name windeco colors //@{ QColor _activeTitleBarColor; @@ -344,6 +348,20 @@ namespace Lightly mutable bool _cachedAutoValid = false; friend class ToolsAreaManager; + friend class PaletteChangedEventFilter; + }; + + class PaletteChangedEventFilter : public QObject { + Q_OBJECT + + public: + explicit PaletteChangedEventFilter(Helper *); + + protected: + bool eventFilter(QObject *watched, QEvent *event) override; + + private: + Helper *_helper; }; } diff --git a/kstyle/lightlysplitterproxy.cpp b/kstyle/lightlysplitterproxy.cpp index d35bffb3a..0df9e8c32 100644 --- a/kstyle/lightlysplitterproxy.cpp +++ b/kstyle/lightlysplitterproxy.cpp @@ -254,27 +254,30 @@ namespace Lightly QMouseEvent copy( mouseEvent->type(), _hook, +#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0) + mouseEvent->globalPosition().toPoint(), +#endif mouseEvent->button(), - mouseEvent->buttons(), mouseEvent->modifiers()); + mouseEvent->buttons(), + mouseEvent->modifiers()); QCoreApplication::sendEvent( _splitter.data(), © ); } else { // map event position to current splitter and post. +QMouseEvent copy(mouseEvent->type(), #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - QMouseEvent copy(mouseEvent->type(), - _splitter.data()->mapFromGlobal( mouseEvent->globalPosition() ), - mouseEvent->button(), - mouseEvent->buttons(), - mouseEvent->modifiers()); + _splitter.data()->mapFromGlobal(mouseEvent->globalPosition().toPoint()), #else - QMouseEvent copy(mouseEvent->type(), - _splitter.data()->mapFromGlobal(mouseEvent->globalPos()), - mouseEvent->button(), - mouseEvent->buttons(), - mouseEvent->modifiers()); + _splitter.data()->mapFromGlobal(mouseEvent->globalPos()), +#endif +#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0) + mouseEvent->globalPosition().toPoint(), #endif + mouseEvent->button(), + mouseEvent->buttons(), + mouseEvent->modifiers()); QCoreApplication::sendEvent( _splitter.data(), © ); @@ -365,15 +368,19 @@ namespace Lightly hide(); parentWidget()->setUpdatesEnabled(true); - // send hover event - if( _splitter ) - { - QHoverEvent hoverEvent( - qobject_cast(_splitter.data()) ? QEvent::HoverLeave : QEvent::HoverMove, - _splitter.data()->mapFromGlobal(QCursor::pos()), _hook); - QCoreApplication::sendEvent( _splitter.data(), &hoverEvent ); + // send hover event + if (_splitter) { + // SplitterProxy intercepts HoverLeave/HoverMove events to _splitter, + // but this is meant to reach it directly. Unset _splitter to stop interception. + auto splitter = _splitter; _splitter.clear(); - + QHoverEvent hoverEvent(qobject_cast(splitter.data()) ? QEvent::HoverLeave : QEvent::HoverMove, + splitter.data()->mapFromGlobal(QCursor::pos()), +#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0) + splitter.data()->mapFromGlobal(QCursor::pos()), +#endif + _hook); + QCoreApplication::sendEvent(splitter.data(), &hoverEvent); } // kill timer if any diff --git a/kstyle/lightlystyle.cpp b/kstyle/lightlystyle.cpp index 106e5ea1a..e7193507d 100644 --- a/kstyle/lightlystyle.cpp +++ b/kstyle/lightlystyle.cpp @@ -1600,17 +1600,19 @@ Style::Style() if( !scrollBar->rect().contains( position ) ) continue; // copy event, send and return - QMouseEvent copy( - mouseEvent->type(), - position, - mouseEvent->button(), - mouseEvent->buttons(), mouseEvent->modifiers()); - - QCoreApplication::sendEvent( scrollBar, © ); - event->setAccepted( true ); - return true; + QMouseEvent copy(mouseEvent->type(), + position, +#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0) + QCursor::pos(), +#endif + mouseEvent->button(), + mouseEvent->buttons(), + mouseEvent->modifiers()); - } + QCoreApplication::sendEvent(scrollBar, ©); + event->setAccepted(true); + return true; + } break; @@ -1686,7 +1688,7 @@ Style::Style() } else if( StyleConfigData::dockWidgetDrawFrame() && (dockWidget->features() & (QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable))){ - _helper->renderFrame( &painter, rect, background, palette, windowActive ); + _helper->renderFrame( &painter, rect, background, windowActive ); } else { @@ -3639,14 +3641,14 @@ Style::Style() _animations->inputWidgetEngine().updateState( widget, AnimationHover, mouseOver && !hasFocus ); // retrieve animation mode and opacity - const AnimationMode mode( _animations->inputWidgetEngine().frameAnimationMode( widget ) ); - const qreal opacity( _animations->inputWidgetEngine().frameOpacity( widget ) ); + _animations->inputWidgetEngine().frameAnimationMode( widget ) ; + _animations->inputWidgetEngine().frameOpacity( widget ) ; // render if( !StyleConfigData::sidePanelDrawFrame() && widget && widget->property( PropertyNames::sidePanelView ).toBool() ) { - const auto outline( _helper->sidePanelOutlineColor( palette, hasFocus, opacity, mode ) ); + const auto outline( _helper->sidePanelOutlineColor( palette ) ); const bool reverseLayout( option->direction == Qt::RightToLeft ); const Side side( reverseLayout ? SideRight : SideLeft ); if( (widget->window()->windowFlags() & Qt::WindowType_Mask) == Qt::Dialog ) @@ -3684,7 +3686,7 @@ Style::Style() }*/ const auto background( isTitleWidget ? palette.color( widget->backgroundRole() ) : palette.color( QPalette::Base ) ); - _helper->renderFrame( painter, rect, background, palette, windowActive, enabled ); + _helper->renderFrame( painter, rect, background, windowActive, enabled ); } @@ -3808,7 +3810,7 @@ Style::Style() } //______________________________________________________________ - bool Style::drawFrameGroupBoxPrimitive( const QStyleOption* option, QPainter* painter, const QWidget* widget) const + bool Style::drawFrameGroupBoxPrimitive( const QStyleOption* option, QPainter* painter, const QWidget* ) const { // cast option and check @@ -5511,8 +5513,8 @@ Style::Style() const bool useStrongFocus( StyleConfigData::menuItemDrawStrongFocus() ); _animations->inputWidgetEngine().updateState( widget, AnimationHover, selected ); - const AnimationMode mode( _animations->inputWidgetEngine().buttonAnimationMode( widget ) ); - const qreal opacity( _animations->inputWidgetEngine().buttonOpacity( widget ) ); + _animations->inputWidgetEngine().buttonAnimationMode( widget ); + _animations->inputWidgetEngine().buttonOpacity( widget ); // render hover and focus if( selected || sunken ) @@ -5554,7 +5556,6 @@ Style::Style() // checkbox state CheckBoxState state( menuItemOption->checked ? CheckOn : CheckOff ); - const bool active( menuItemOption->checked ); //const auto color( _helper->checkBoxIndicatorColor( palette, false, enabled && active ) ); const auto background( state == CheckOn ? palette.color( QPalette::Highlight ) : palette.color( QPalette::Button ) ); //_helper->renderCheckBoxBackground( painter, checkBoxRect, palette.color( QPalette::Window ), sunken ); //not needed diff --git a/kstyle/lightlywindowmanager.cpp b/kstyle/lightlywindowmanager.cpp index c883e7d4f..e15037a37 100644 --- a/kstyle/lightlywindowmanager.cpp +++ b/kstyle/lightlywindowmanager.cpp @@ -172,8 +172,7 @@ namespace Lightly post some mouseRelease event to the target, in order to counter balance the mouse press that triggered the drag. Note that it triggers a resetDrag */ - QMouseEvent mouseEvent( QEvent::MouseButtonRelease, _parent->_dragPoint, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier ); - qApp->sendEvent( _parent->_target.data(), &mouseEvent ); + QMouseEvent mouseEvent(QEvent::MouseButtonRelease, _parent->_dragPoint, QCursor::pos(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); return false; @@ -464,7 +463,15 @@ namespace Lightly auto localPoint( _dragPoint ); if( child ) localPoint = child->mapFrom( widget, localPoint ); else child = widget; - QMouseEvent localMouseEvent( QEvent::MouseMove, localPoint, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier ); + QMouseEvent localMouseEvent(QEvent::MouseMove, + localPoint, +#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0) + QCursor::pos(), +#endif + Qt::NoButton, + Qt::LeftButton, + Qt::NoModifier); + localMouseEvent.setTimestamp(mouseEvent->timestamp()); qApp->sendEvent( child, &localMouseEvent ); // never eat event From 9224c25421c094d8859b9bc00176f2d752cc12b5 Mon Sep 17 00:00:00 2001 From: zspher <66728045+zspher@users.noreply.github.com> Date: Sun, 1 Dec 2024 14:33:15 -0700 Subject: [PATCH 18/19] docs: add nixos & home-manager install instructions --- README.md | 71 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 57 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 430d3d739..ef13971af 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - # About this fork This fork attempts to revive lightly with a different approach from boehs, with the assumption that Luwx won't ever resume his project. @@ -7,7 +6,6 @@ This means that this fork allows real changes, and not just maintainence. ![Lightly](https://github.com/user-attachments/assets/ae39fc7f-8277-48b1-b80c-9e307542b8b0) - ## The to-do list - [x] Make a new readme @@ -17,8 +15,8 @@ This means that this fork allows real changes, and not just maintainence. - [ ] Make some meaningful commits - [ ] Expand to-do list - ## My plans for changes at the moment -- They are in progress, I'm just really slow + - [x] Redesign the tabbar - [ ] Fix the issues I caused with it - [x] Align it a little better, ~~now it's slightly too left,~~ it needs slightly larger margins for ~~both sides~~ the right side @@ -31,12 +29,14 @@ This means that this fork allows real changes, and not just maintainence. - [x] Add my own colorscheme to it - [ ] Use [klassy](https://github.com/paulmcauley/klassy) for window decorations (I don't know how to use make / cmake, so it'll take a while) - [ ] Make installation in all major distros easy - - [x] Can be built on most distros that support plasma 6 + - [x] Can be built on most distros that support plasma 6 - [ ] Rename the project to something like „Darkly” to reflect the changes, and for it to be installable alongside the other lightly - [ ] Maintain the project ## Installation + ## Automatic + ### Thanks to @DeltaCopy, you can use one of these install methods: #### Fedora copr @@ -51,7 +51,6 @@ This means that this fork allows real changes, and not just maintainence. - ## Manual ### To ensure this application style works on applications still using QT5 both QT5 and QT6 dependencies are required to be installed before building from source. @@ -70,6 +69,7 @@ This means that this fork allows real changes, and not just maintainence. `./install.sh remove` will remove Lightly. #### Void Linux + ``` sudo xbps-install -Sy git extra-cmake-modules base-devel qt6-base qt6-base-devel qt6-tools-devel \ kf6-kcmutils-devel kf6-kconfigwidgets-devel kf6-kdecoration-devel \ @@ -79,12 +79,14 @@ sudo xbps-install -Sy git extra-cmake-modules base-devel qt6-base qt6-base-devel kf6-kcodecs-devel kf6-kwidgetsaddons-devel qt6-declarative-devel \ qt6-svg-devel qt6-wayland-devel kf6-kwidgetsaddons-devel kf6-knotifications-devel ``` + ``` git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git cd Lightly ./install.sh QT6 ``` -*** + +--- #### Arch Linux @@ -93,19 +95,20 @@ sudo pacman -S --noconfirm cmake extra-cmake-modules kdecoration qt6-declarative kcmutils kcolorscheme kconfig kguiaddons kiconthemes kwindowsystem git \ qt5-declarative qt5-x11extras gcc make kcmutils5 \ frameworkintegration5 kconfigwidgets5 kiconthemes5 \ - kirigami2 kwindowsystem5 + kirigami2 kwindowsystem5 ``` + ``` git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git cd Lightly ./install.sh ``` -*** +--- #### Fedora -##### Fedora 40/41 +##### Fedora 40/41 ``` sudo dnf install -y git cmake extra-cmake-modules "cmake(KDecoration2)" kwin-devel \ @@ -117,13 +120,15 @@ sudo dnf install -y git cmake extra-cmake-modules "cmake(KDecoration2)" kwin-dev "cmake(KF5KIO)" kf5-kpackage-devel kf5-kcmutils-devel qt5-qtquickcontrols2-devel \ kf5-kirigami2-devel "cmake(KF5FrameworkIntegration)" ``` + ``` git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git cd Lightly ./install.sh ``` -*** +--- + #### openSUSE Tumbleweed ``` @@ -141,15 +146,17 @@ sudo zypper in --no-recommends git ninja cmake kf6-extra-cmake-modules kf6-kconf xcb-util-wm-devel xcb-util-keysyms-devel kcmutils-devel \ libqt5-qtquick3d-devel kirigami2-devel libKF5I18n5 ``` + ``` git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git cd Lightly ./install.sh ``` -*** +--- #### KDE neon + ``` sudo apt install -y git build-essential cmake kf6-extra-cmake-modules \ kf6-extra-cmake-modules kf6-frameworkintegration-dev \ @@ -163,15 +170,17 @@ sudo apt install -y git build-essential cmake kf6-extra-cmake-modules \ libqt5x11extras5-dev qt6-base-dev qt6-declarative-dev qtbase5-dev \ qtdeclarative5-dev gettext qt6-svg-dev extra-cmake-modules qt3d5-dev ``` + ``` git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git cd Lightly ./install.sh ``` -*** +--- #### Distrobox (Fedora 41) + ``` distrobox create --name lightly --image registry.fedoraproject.org/fedora-toolbox:41 distrobox enter lightly @@ -202,14 +211,17 @@ cd ../../ make -j $(nproc) make install ``` + ``` Set environment variable on plasma startup: echo "export QT_PLUGIN_PATH=$HOME/.local/lib64/plugins:\$QT_PLUGIN_PATH" > $HOME/.config/plasma-workspace/env/localthemes.sh && chmod +x $HOME/.config/plasma-workspace/env/localthemes.sh ``` -*** + +--- #### Kubuntu (24.10) + ``` sudo apt-get install -y -qq cmake build-essential libkf5config-dev libkdecorations2-dev \ libqt5x11extras5-dev qtdeclarative5-dev extra-cmake-modules \ @@ -219,12 +231,43 @@ sudo apt-get install -y -qq cmake build-essential libkf5config-dev libkdecoratio libkf6config-dev libkf6guiaddons-dev libkf6i18n-dev libkf6iconthemes-dev \ libkf6windowsystem-dev libkf6kcmutils-dev libkirigami-dev ``` + ``` git clone --single-branch --depth=1 https://github.com/Bali10050/Lightly.git cd Lightly ./install.sh ``` -*** + +#### Nixos + +1. add `inputs.lightly.url = "github:Bali10050/Lightly";` to `flake.nix` +2. nixos or home-manager + +- for home-manager + +```nix +qt = { + style.package = [ + inputs.lightly.packages.${pkgs.system}.lightly-qt5 + inputs.lightly.packages.${pkgs.system}.lightly-qt6 + ]; + platformTheme.name = "qtct"; +}; +``` + +- for nixos + +```nix +qt.platformTheme = "qt5ct"; +environment.systemPackages = with pkgs; [ + inputs.lightly.packages.${pkgs.system}.lightly-qt5 + inputs.lightly.packages.${pkgs.system}.lightly-qt6 +] +``` + +3. select lightly in qt5ct / qt6ct + +--- ## Known issues & solutions From 53598944db4ce90b2e77078d10c0c72e6e71a052 Mon Sep 17 00:00:00 2001 From: DeltaCopy <7x0bb03yq@mozmail.com> Date: Mon, 2 Dec 2024 11:03:35 +0000 Subject: [PATCH 19/19] Removing unknown dependency from kubuntu, and added new remove paths --- README.md | 2 +- install.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 430d3d739..3fadb0855 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ cd Lightly sudo zypper in --no-recommends git ninja cmake kf6-extra-cmake-modules kf6-kconfig-devel \ kf6-frameworkintegration-devel gmp-ecm-devel kf6-kconfigwidgets-devel \ kf6-kguiaddons-devel kf6-ki18n-devel kf6-kiconthemes-devel kf6-kwindowsystem-devel \ - kf6-kcolorscheme-devel kf6-kcoreaddons-devel kf6-kcmutils-devel kcmutils \ + kf6-kcolorscheme-devel kf6-kcoreaddons-devel kf6-kcmutils-devel \ qt6-quick-devel kf6-kirigami-devel qt6-base-devel kdecoration6-devel \ qt6-tools qt6-widgets-devel gcc-c++ extra-cmake-modules libQt5Gui-devel \ libQt5DBus-devel libqt5-qttools-devel libqt5-qtx11extras-devel \ diff --git a/install.sh b/install.sh index 5c80d783a..abb47bad4 100755 --- a/install.sh +++ b/install.sh @@ -74,6 +74,10 @@ remove_qt6_files() { "/usr/lib/cmake/${PROJECT}/${PROJECT}ConfigVersion.cmake" "/usr/share/color-schemes/${_PROJECT}.colors" /usr/lib/cmake/"${PROJECT^}" + "/usr/lib/x86_64-linux-gnu/qt6/plugins/org.kde.kdecoration2/org.kde.${PROJECT}.so" + "/usr/lib/x86_64-linux-gnu/qt6/plugins/kstyle_config/${PROJECT}styleconfig.so" + "/usr/lib/x86_64-linux-gnu/qt6/plugins/org.kde.kdecoration2.kcm/kcm_${PROJECT}decoration.so" + "/usr/lib/x86_64-linux-gnu/qt6/plugins/styles/${PROJECT}6.so" ) for f in ${files[@]}; do @@ -91,6 +95,7 @@ remove_qt5_files() { "/usr/lib64/lib${PROJECT}common5.so.6" "/usr/lib/lib${PROJECT}common5.so.6" "/usr/lib64/qt/plugins/styles/${PROJECT}5.so" + "/usr/lib/x86_64-linux-gnu/qt5/plugins/styles/${PROJECT}5.so" ) for f in ${files[@]}; do