Intelligently inverts windows by applying a shader that preserves colors other than black and white By Default. Exactly like the default invert plugin provided by KDE except it allows custom shaders.
Shader files can be set in /usr/share/kwin/shaders/1.40
. The file with name invert.frag
will be selected. Turning the plugin off then back on within KWin effects will apply the new shader.
Application comes with a few well selected shaders. The default being data/1.40/invert.frag.log69.cpp since it looks the best.
- Inverting the entire screen
SHIFT + CTRL + META + Z
- Inverting the current window
CTRL + META + Z
You can change the shortcuts via System Settings -> Global Keyboard Shortcuts -> KWin Or directly from the kwin effects settings menu.
- Newly Created [2021-09-26 Sun 00:33:31]
- Hot Swap
-
- change shader file by following Custom shaders
- invert a window to try out shader without affecting all windows.
- invert the entire screen to apply new shader to all windows.
- Block list
-
- window classes added to blocklist in kde system settings effect configuration are not inverted.
- Use `xprop WM_CLASS` or `wmctrl -lx` and take the second string to get window class. For example
xprop WM_ClASS
returns =M_CLASS(STRING) = “systemsettings5”, “systemsettings”= for a system settings window. Take the second string, =”systemsettings”= and place in blocklist. - Case insensitive.
- If class has space, insert it with its spaces verbatum. E.g:
first class,second,name with space,last
- Separate window classes with comma. E.g: =discord,code - insider,emacs,=.
I haven’t tested these dependencies. refer to this and this repos.
- Arch based
sudo pacman -S extra-cmake-modules kwin kf5
- Debian based (Ubuntu, Kubuntu, KDE Neon)
sudo apt install git cmake g++ gettext extra-cmake-modules qttools5-dev libqt5x11extras5-dev libkf5configwidgets-dev libkf5crash-dev libkf5globalaccel-dev libkf5kio-dev libkf5notifications-dev kinit-dev kwin-dev
- Fedora based
sudo dnf install git cmake gcc-c++ extra-cmake-modules qt5-qttools-devel qt5-qttools-static qt5-qtx11extras-devel kf5-kconfigwidgets-devel kf5-kcrash-devel kf5-kguiaddons-devel kf5-kglobalaccel-devel kf5-kio-devel kf5-ki18n-devel kf5-knotifications-devel kf5-kinit-devel kwin-devel qt5-qtbase-devel libepoxy-devel
git clone https://github.com/natask/kwin-effect-smart-invert.git
cd kwin-effect-smart-invert
mkdir -p build && cd build
cmake .. && make && sudo make install && (kwin_x11 --replace &)
- Plugin
- Shaders
- State “TODO” from [2021-10-21 Thu 10:57:31 PDT]
- Newly Created [2021-10-21 Thu 10:57:19 PDT]
What is the point of duplicated declarations for keybindings in invert.cpp and invert_config.cpp.
- State “DONE” from “NEXT” [2021-09-25 Sat 20:53:42]
- State “DONE” from “NEXT” [2021-09-25 Sat 20:54:16]
- State “DONE” from “NEXT” [2021-09-25 Sat 21:00:30]
- State “DONE” from “NEXT” [2021-10-21 Thu 10:57:17 PDT]
- State “DONE” from “NEXT” [2021-10-21 Thu 10:57:45 PDT]