Skip to content

Instantly share code, notes, and snippets.

@FennyFatal
Created March 14, 2026 17:55
Show Gist options
  • Select an option

  • Save FennyFatal/456e8a95e2319bddee5018c0622196f8 to your computer and use it in GitHub Desktop.

Select an option

Save FennyFatal/456e8a95e2319bddee5018c0622196f8 to your computer and use it in GitHub Desktop.
#!/usr/bin/bash
set -e
# Rebuilds and reinstalls wallpaper-engine-kde-plugin after a Bazzite rebase.
# Safe to run multiple times.
PLUGIN_DEST="$HOME/.local/lib64/qt6/qml/com/github/catsout/wallpaperEngineKde"
ENV_FILE="$HOME/.config/environment.d/qt-qml-path.conf"
CONTAINER="wallpaper-engine-build"
BUILD_DIR="/tmp/wallpaper-engine-kde-plugin"
echo "==> Layering host packages..."
rpm-ostree install --apply-live --idempotent \
qt6-qtwebsockets-devel \
python3-websockets \
mpv-libs
echo "==> Setting up QML import path..."
mkdir -p "$(dirname "$ENV_FILE")"
echo "QML2_IMPORT_PATH=$HOME/.local/lib64/qt6/qml" > "$ENV_FILE"
systemctl --user set-environment QML2_IMPORT_PATH="$HOME/.local/lib64/qt6/qml"
echo "==> Creating build container..."
if ! distrobox list | grep -q "^.*$CONTAINER"; then
distrobox create --name "$CONTAINER" \
--image registry.fedoraproject.org/fedora-toolbox:latest \
--yes
fi
echo "==> Installing build dependencies..."
distrobox enter "$CONTAINER" -- sudo dnf install -y \
cmake gcc-c++ git \
qt6-qtbase-devel qt6-qtdeclarative-devel qt6-qtwebsockets-devel \
mpv-devel lz4-devel glm-devel zlib-devel \
extra-cmake-modules kf6-kpackage-devel libplasma-devel \
kf6-kcoreaddons-devel kf6-ki18n-devel kf6-kconfig-devel
echo "==> Cloning wallpaper-engine-kde-plugin..."
distrobox enter "$CONTAINER" -- bash -c "
rm -rf '$BUILD_DIR'
git clone https://github.com/catsout/wallpaper-engine-kde-plugin.git \
--recurse-submodules --shallow-submodules '$BUILD_DIR'
"
echo "==> Building..."
distrobox enter "$CONTAINER" -- bash -c "
mkdir -p '$BUILD_DIR/build'
cd '$BUILD_DIR/build'
cmake .. -DUSE_PLASMAPKG=OFF -DCMAKE_BUILD_TYPE=Release
make -j\$(nproc)
"
echo "==> Installing plugin..."
mkdir -p "$PLUGIN_DEST"
cp "$BUILD_DIR/build/src/libWallpaperEngineKde.so" "$PLUGIN_DEST/"
cp "$BUILD_DIR/src/qmldir" "$PLUGIN_DEST/"
echo "==> Restarting plasmashell..."
systemctl --user restart plasma-plasmashell || true
echo "Done. Wallpaper Engine plugin installed to $PLUGIN_DEST"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment