Skip to content

Instantly share code, notes, and snippets.

@shirozatou
Created November 26, 2025 16:05
Show Gist options
  • Select an option

  • Save shirozatou/6004922d84d95e6e8d63be852275c1fa to your computer and use it in GitHub Desktop.

Select an option

Save shirozatou/6004922d84d95e6e8d63be852275c1fa to your computer and use it in GitHub Desktop.
Rebuild archlinux kwin with 3-fingers gesture overview instead of 4
#!/bin/bash
REPO=https://gitlab.archlinux.org/archlinux/packaging/packages/kwin.git
set -euo pipefail
DIR=$(mktemp -d)
trap 'rm -rf "$DIR"' EXIT
git clone --depth=1 -b $(pacman -Q kwin | cut -d' ' -f2) "$REPO" "$DIR"
cd "$DIR"
# 3-fingers gesture for overview
if grep -vq '^prepare()' PKGBUILD; then
cat >> PKGBUILD <<'EOF'
prepare() {
cd "${pkgname}-${pkgver}"
sed -iE '/addTouchpadSwipeGesture/s/4/3/g' src/plugins/overview/overvieweffect.cpp
}
EOF
else
echo 'TODO: edit prepare'
exit 1
fi
# Remove kdoctools.
sed -i '/^\s*makedepends=(/,/)/{/kdoctools/d}' PKGBUILD
# PKGBUILD is edited, build now.
makepkg -si --skippgpcheck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment