Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into window-rules
Browse files Browse the repository at this point in the history
  • Loading branch information
taj-ny committed Jan 3, 2025
2 parents 3c84e7d + 078822e commit b4954a0
Show file tree
Hide file tree
Showing 21 changed files with 427 additions and 49 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/fedora-41.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Fedora 41

on:
push:
branches: [ main ]
paths-ignore: [ "**.md" ]
pull_request:
branches: [ main ]
paths-ignore: [ "**.md" ]
schedule:
- cron: "0 0 * * *"

jobs:
build:
runs-on: ubuntu-latest
container:
image: fedora:41
options: --user root

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install Dependencies
run: dnf -y install git cmake extra-cmake-modules gcc-g++ kf6-kwindowsystem-devel plasma-workspace-devel libplasma-devel qt6-qtbase-private-devel qt6-qtbase-devel cmake kwin-devel extra-cmake-modules kwin-devel kf6-knotifications-devel kf6-kio-devel kf6-kcrash-devel kf6-ki18n-devel kf6-kguiaddons-devel libepoxy-devel kf6-kglobalaccel-devel kf6-kcmutils-devel kf6-kconfigwidgets-devel kf6-kdeclarative-devel kdecoration-devel kf6-kglobalaccel kf6-kdeclarative libplasma kf6-kio qt6-qtbase kf6-kguiaddons kf6-ki18n wayland-devel

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build

- name: Build
run: cmake --build ${{github.workspace}}/build -j
34 changes: 34 additions & 0 deletions .github/workflows/neon-unstable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: KDE Neon (unstable)

on:
push:
branches: [ main ]
paths-ignore: [ "**.md" ]
pull_request:
branches: [ main ]
paths-ignore: [ "**.md" ]
schedule:
- cron: "0 0 * * *"

jobs:
build:
runs-on: ubuntu-latest
container:
image: invent-registry.kde.org/neon/docker-images/plasma:unstable
options: --user root

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Refresh Packages
run: apt update

- name: Install Dependencies
run: apt install -y git cmake g++ extra-cmake-modules qt6-tools-dev kwin-dev libkf6configwidgets-dev gettext libkf6crash-dev libkf6globalaccel-dev libkf6kio-dev libkf6service-dev libkf6notifications-dev libkf6kcmutils-dev libkdecorations3-dev

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build

- name: Build
run: cmake --build ${{github.workspace}}/build -j
34 changes: 34 additions & 0 deletions .github/workflows/opensuse-tumbleweed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: openSUSE Tumbleweed

on:
push:
branches: [ main ]
paths-ignore: [ "**.md" ]
pull_request:
branches: [ main ]
paths-ignore: [ "**.md" ]
schedule:
- cron: "0 0 * * *"

jobs:
build:
runs-on: ubuntu-latest
container:
image: opensuse/tumbleweed
options: --user root

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Refresh Packages
run: zypper ref

- name: Install Dependencies
run: zypper in -y git cmake-full gcc-c++ kf6-extra-cmake-modules kcoreaddons-devel kguiaddons-devel kconfigwidgets-devel kwindowsystem-devel ki18n-devel kiconthemes-devel kpackage-devel frameworkintegration-devel kcmutils-devel kirigami2-devel "cmake(KF6Config)" "cmake(KF6CoreAddons)" "cmake(KF6FrameworkIntegration)" "cmake(KF6GuiAddons)" "cmake(KF6I18n)" "cmake(KF6KCMUtils)" "cmake(KF6KirigamiPlatform)" "cmake(KF6WindowSystem)" "cmake(Qt6Core)" "cmake(Qt6DBus)" "cmake(Qt6Quick)" "cmake(Qt6Svg)" "cmake(Qt6Widgets)" "cmake(Qt6Xml)" "cmake(Qt6UiTools)" "cmake(KF6Crash)" "cmake(KF6GlobalAccel)" "cmake(KF6KIO)" "cmake(KF6Service)" "cmake(KF6Notifications)" libepoxy-devel kwin6-devel

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build

- name: Build
run: cmake --build ${{github.workspace}}/build -j
17 changes: 16 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CPACK_PACKAGE_NAME "kwin-better-blur")
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
set(CPACK_PACKAGE_FILE_NAME "kwin-better-blur")
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Fork of the KWin Blur effect for KDE Plasma 6 with additional features (including force blur) and bug fixes")
include(CPack)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose Release or Debug" FORCE)
endif()
Expand Down Expand Up @@ -73,7 +80,15 @@ if(${KWin_VERSION} VERSION_GREATER_EQUAL 6.1.90)
add_compile_definitions(KWIN_6_2_OR_GREATER)
endif()

find_package(KDecoration2 REQUIRED)
find_package(KDecoration2)
find_package(KDecoration3)
if (${KDecoration3_FOUND})
add_compile_definitions(KDECORATION3)
endif()
if(NOT ${KDecoration3_FOUND} AND NOT ${KDecoration2_FOUND})
message(FATAL_ERROR "Could not find KDecoration2 or KDecoration3.")
endif()


find_package(KWinDBusInterface CONFIG REQUIRED)

Expand Down
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# KWin Better Blur [![AUR Version](https://img.shields.io/aur/version/kwin-effects-forceblur)](https://aur.archlinux.org/packages/kwin-effects-forceblur)
Better Blur (formerly kwin-effects-forceblur) is a fork the KWin Blur effect for KDE Plasma 6 with additional features and bug fixes.
Better Blur is a fork the KWin Blur effect for KDE Plasma 6 with additional features and bug fixes.

![image](https://github.com/taj-ny/kwin-effects-forceblur/assets/79316397/1078cf12-e6da-43c7-80b4-d90a8b0f3404)
<sup>Window opacity has been set to 85% for System Settings, Dolphin and VSCodium, Firefox uses a transparent theme | [NixOS configuration](https://github.com/taj-ny/nix-config)</sup>
Expand All @@ -8,7 +8,7 @@ Better Blur (formerly kwin-effects-forceblur) is a fork the KWin Blur effect for
- X11 and Wayland support
- Force blur
- Rounded corners with optional anti-aliasing
- Static blur for much lower GPU usage, works best with tiling
- Static blur for much lower GPU usage

### Bug fixes
Fixes for blur-related Plasma bugs that haven't been patched yet.
Expand Down Expand Up @@ -47,6 +47,9 @@ Fixes for blur-related Plasma bugs that haven't been patched yet.
</details>

# Building from source
> [!NOTE]
> On Fedora Kinoite and other distributions based on it, the effect must be built in a container.
### Dependencies
- CMake
- Extra CMake Modules
Expand Down Expand Up @@ -74,7 +77,7 @@ Fixes for blur-related Plasma bugs that haven't been patched yet.
</details>

<details>
<summary>Fedora</summary>
<summary>Fedora 40, 41</summary>
<br>

```
Expand All @@ -98,10 +101,29 @@ cd kwin-effects-forceblur
mkdir build
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
make -j
```

### Installation
<details>
<summary>Fedora Kinoite</summary>
<br>

```sh
cpack -V -G RPM
exit # exit the container
sudo rpm-ostree install kwin-effects-forceblur/build/kwin-better-blur.rpm
```
</details>
<details>
<summary>Other distributions</summary>
<br>

```sh
sudo make install
```
</details>

Remove the *build* directory when rebuilding the effect.

# Usage
Expand Down
18 changes: 17 additions & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ Obvious options are not explained here.
| **Window top corner radius** | Requires *Blur window decorations as well* to be enabled for windows with decorations. |
| **Anti-aliasing** | Makes rounded corners appear smoother. |

<<<<<<< HEAD
## Static blur
When enabled, a cached texture will be painted behind the window instead of actually blurring the background (dynamic blur).
The blurred areas of the window will also be marked as opaque, causing KWin to not paint anything behind the window.
Both things result in lower resource usage.
=======
# Static blur
When enabled, the blur texture will be cached and reused. The blurred areas of the window will be marked as opaque, resulting in KWin not painting anything behind them.
Only one image per screen is cached at a time.
>>>>>>> origin/main
Static blur is mainly intended for laptop users who want longer battery life while still having blur everywhere.

Expand All @@ -42,11 +48,17 @@ Static blur is mainly intended for laptop users who want longer battery life whi
|-------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Convert simple config to window rules** | Whether to automatically convert simple configuration into window rules. Disabling this will cause most options in the simple configuration UI to not have an effect anymore. |

<<<<<<< HEAD
# Window rules
Configuration UI for window rules will be added in v2. The configuration file is located at ``~/.config/kwinbetterblurrc`` and isn't created automatically.
=======
### Image source
The image to use for static blur.
>>>>>>> origin/main
Simple configuration is converted into multiple rules with priorities lower than 0. They are not added into the configuration file. This behavior can be disabled in the configuration UI in the *Window Rules* tab.

<<<<<<< HEAD
An example is provided at the end.

## File structure
Expand Down Expand Up @@ -145,4 +157,8 @@ WindowType = Menu
[WindowRules][MenuCorners][Properties]
CornerRadius = 10
```
```
=======
### Blur image
Whether to blur the image used for static blur. This is only done once.
>>>>>>> origin/main
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "Fork of the KWin Blur effect for KDE Plasma 6 with additional features (including force blur) and bug fixes";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/88195a94f390381c6afcdaa933c2f6ff93959cb4";
utils.url = "github:numtide/flake-utils";
};

Expand Down
8 changes: 6 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ target_link_libraries(forceblur PRIVATE
KWin::kwin

KF6::ConfigGui

KDecoration2::KDecoration
)

target_compile_definitions(forceblur PRIVATE CONFIG_KWIN)
if (${KDecoration3_FOUND})
target_link_libraries(forceblur PRIVATE KDecoration3::KDecoration)
else()
target_link_libraries(forceblur PRIVATE KDecoration2::KDecoration)
endif()

install(TARGETS forceblur DESTINATION ${KDE_INSTALL_PLUGINDIR}/kwin/effects/plugins)
Loading

0 comments on commit b4954a0

Please sign in to comment.