From 951342e9171f8c3cf054340145be43ba8fe15bb6 Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Sat, 15 Feb 2025 20:51:16 +0100 Subject: [PATCH] :wrench: Port Team Rocket effect to KDE --- kwin/build.sh | 1 + kwin/team-rocket/config.ui | 178 ++++++++++++++++++++++++++ kwin/team-rocket/main.xml | 33 +++++ kwin/team-rocket/onAnimationBegin.js | 8 ++ kwin/team-rocket/onSettingsChanged.js | 13 ++ 5 files changed, 233 insertions(+) create mode 100755 kwin/team-rocket/config.ui create mode 100755 kwin/team-rocket/main.xml create mode 100644 kwin/team-rocket/onAnimationBegin.js create mode 100644 kwin/team-rocket/onSettingsChanged.js diff --git a/kwin/build.sh b/kwin/build.sh index fbe0f18..533e753 100755 --- a/kwin/build.sh +++ b/kwin/build.sh @@ -168,6 +168,7 @@ generate "pixel-wheel" "Pixel Wheel [Burn-My-Windows]" "Pixelate the window and generate "pixel-wipe" "Pixel Wipe [Burn-My-Windows]" "Pixelate the window and hide the pixels radially, starting from the pointer position" generate "portal" "Portal [Burn-My-Windows]" "Transfer your windows to other locations in space and time" generate "rgbwarp" "RGB Warp [Burn-My-Windows]" "Red Blue and Green go bye bye" +generate "team-rocket" "Team Rocket [Burn-My-Windows]" "... is blasting off again!" generate "tv" "TV Effect [Burn-My-Windows]" "Make windows close like turning off a TV" generate "tv-glitch" "TV Glitch [Burn-My-Windows]" "Make your windows close like a very glitchy old-school TV" generate "wisps" "Wisps [Burn-My-Windows]" "Let your windows be carried away to the realm of dreams by these little fairies" diff --git a/kwin/team-rocket/config.ui b/kwin/team-rocket/config.ui new file mode 100755 index 0000000..31b4bf0 --- /dev/null +++ b/kwin/team-rocket/config.ui @@ -0,0 +1,178 @@ + + + BMWConfigForm + + + + 0 + 0 + 562 + 365 + + + + + + + Animation Time [ms] + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + + + + 100 + + + 9999 + + + 100 + + + + + + + Animation Split + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + + + + 0.200000000000000 + + + 8.000000000000000 + + + 0.100000000000000 + + + 0.500000000000000 + + + + + + + Rotate Window + + + + + + + Horizontal Sparkle Position + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + + + + -1.000000000000000 + + + 1.000000000000000 + + + 0.100000000000000 + + + 1.000000000000000 + + + + + + + Vertical Sparkle Position + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + + + + -1.000000000000000 + + + 1.000000000000000 + + + 0.100000000000000 + + + 1.000000000000000 + + + + + + + Sparkle Size + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + + + + 0.500000000000000 + + + 1.000000000000000 + + + 0.100000000000000 + + + 1.000000000000000 + + + + + + + Sparkle Rotation + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + + + + -1.000000000000000 + + + 1.000000000000000 + + + 0.100000000000000 + + + 1.000000000000000 + + + + + + + + diff --git a/kwin/team-rocket/main.xml b/kwin/team-rocket/main.xml new file mode 100755 index 0000000..3ac1fac --- /dev/null +++ b/kwin/team-rocket/main.xml @@ -0,0 +1,33 @@ + + + + + + + + + 1500 + + + 0.5 + + + true + + + 0.0 + + + 0.5 + + + 0.75 + + + 0.33 + + + \ No newline at end of file diff --git a/kwin/team-rocket/onAnimationBegin.js b/kwin/team-rocket/onAnimationBegin.js new file mode 100644 index 0000000..462658c --- /dev/null +++ b/kwin/team-rocket/onAnimationBegin.js @@ -0,0 +1,8 @@ +// SPDX-FileCopyrightText: Simon Schneegans +// SPDX-License-Identifier: GPL-3.0-or-later + +// This part is automatically included in the effect's source during the build process. +// The code below is called whenever a window is closed or opened. + +let seed = [Math.random(), Math.random()]; +effect.setUniform(this.shader, 'uSeed', seed); diff --git a/kwin/team-rocket/onSettingsChanged.js b/kwin/team-rocket/onSettingsChanged.js new file mode 100644 index 0000000..b5334dc --- /dev/null +++ b/kwin/team-rocket/onSettingsChanged.js @@ -0,0 +1,13 @@ +// SPDX-FileCopyrightText: Simon Schneegans +// SPDX-License-Identifier: GPL-3.0-or-later + +// This part is automatically included in the effect's source during the build process. +// The code below is called whenever the user changes something in the configuration of +// the effect. + +effect.setUniform(this.shader, 'uWT', effect.readConfig('AnimationSplit', 1.0)); +effect.setUniform(this.shader, 'uWinRot', effect.readConfig('RotateWindow', true) ? 1.0 : 0.0); +effect.setUniform(this.shader, 'uXpos', effect.readConfig('HorizontalSparklePosition', 1.0)); +effect.setUniform(this.shader, 'uYpos', effect.readConfig('VerticalSparklePosition', 1.0)); +effect.setUniform(this.shader, 'uSparkleRot', effect.readConfig('SparkleRotation', 1.0)); +effect.setUniform(this.shader, 'uSparkleSize', effect.readConfig('SparkleSize', 1.0));