Skip to content

Instantly share code, notes, and snippets.

@shirozatou
Last active December 26, 2025 18:04
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 -q '^prepare()' PKGBUILD; then
echo -e '\nprepare() {\n}' >> PKGBUILD
fi
sed -i '/^prepare()/a\ ( cd "${pkgname}-${pkgver}" ; sed -i "/addTouchpadSwipeGesture/s/4/3/g" src/plugins/overview/overvieweffect.cpp )' PKGBUILD
# 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