Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,26 @@ jobs:
- name: Build and unit test
working-directory: CursorFollowLinux
run: make -j"$(nproc)" && make test

# Builds the Arch package from this commit (not the tag tarball the PKGBUILD pins),
# so a packaging break shows up on the PR that caused it.
linux-arch:
runs-on: ubuntu-24.04
container: archlinux:latest
steps:
- name: Install build tools
run: pacman -Syu --noconfirm --needed base-devel git namcap
- uses: actions/checkout@v7
- name: Build package (makepkg refuses to run as root)
run: |
useradd -m builder
echo 'builder ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/builder
chown -R builder "$GITHUB_WORKSPACE"
sudo -u builder ./CursorFollowLinux/scripts/package-arch.sh --syncdeps
- name: namcap
run: |
namcap CursorFollowLinux/packaging/arch/PKGBUILD CursorFollowLinux/build/arch/cursorfollow-[0-9]*.pkg.tar.zst | tee namcap.txt
if grep -q ' E: ' namcap.txt; then echo "::error::namcap reported errors"; exit 1; fi
- name: .SRCINFO is current
working-directory: CursorFollowLinux/packaging/arch
run: sudo -u builder makepkg --printsrcinfo | diff -u .SRCINFO -
36 changes: 32 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Release

# Push a v* tag (matching the app versions) to build the macOS DMG and Windows MSI and
# attach them to a draft GitHub release. Review the draft, then publish it.
# Push a v* tag (matching the app versions) to build the macOS DMG, Windows MSI and Arch
# package + install tarball, and attach them to a draft GitHub release. Review the draft,
# then publish it.
# Run manually (Actions -> Release -> Run workflow) to build the installers as workflow
# artifacts without touching releases; pass an existing tag to (re)build its draft release.

Expand All @@ -16,6 +17,9 @@ on:
- CursorFollowWin/scripts/**
- CursorFollowWin/installer/**
- CursorFollowWin/CursorFollowWin.csproj
- CursorFollowLinux/Makefile
- CursorFollowLinux/packaging/**
- CursorFollowLinux/scripts/**
workflow_dispatch:
inputs:
tag:
Expand Down Expand Up @@ -89,9 +93,32 @@ jobs:
path: CursorFollowWin/installer/dist/*.msi
if-no-files-found: error

linux:
runs-on: ubuntu-latest
container: archlinux:latest
steps:
- name: Install build tools
run: pacman -Syu --noconfirm --needed base-devel git
- uses: actions/checkout@v7
with:
ref: ${{ env.TAG || github.ref }}
- name: Build Arch package and install tarball
run: |
useradd -m builder
echo 'builder ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/builder
chown -R builder "$GITHUB_WORKSPACE"
sudo -u builder ./CursorFollowLinux/scripts/package-arch.sh --syncdeps
- uses: actions/upload-artifact@v7
with:
name: linux-arch
path: |
CursorFollowLinux/build/arch/cursorfollow-[0-9]*-x86_64.pkg.tar.zst
CursorFollowLinux/build/arch/cursorfollow-[0-9]*-x86_64.tar.gz
if-no-files-found: error

release:
if: ${{ github.event_name == 'push' || inputs.tag != '' }}
needs: [macos, windows]
needs: [macos, windows, linux]
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -107,7 +134,8 @@ jobs:
run: |
v="${TAG#v}"
ls dist
ls dist/CursorFollowMac-"$v".dmg dist/CursorFollowWin-"$v"-win-x64.msi
ls dist/CursorFollowMac-"$v".dmg dist/CursorFollowWin-"$v"-win-x64.msi \
dist/cursorfollow-"$v"-*-x86_64.pkg.tar.zst dist/cursorfollow-"$v"-x86_64.tar.gz
- name: Release notes from CHANGELOG.md
run: |
v="${TAG#v}"
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- **Linux packages for Arch and Omarchy**: install with `yay -S cursorfollow` from the AUR, or grab the `.pkg.tar.zst` (for `sudo pacman -U`) or the `x86_64` install tarball from the release. The Makefile now honours `LDFLAGS` and no longer writes the desktop and icon caches during staged (`DESTDIR`) installs.

## 0.5.2

- **Windows dependencies**: Microsoft.Extensions.Logging 10.0.13. Package versions for the Windows projects now live in one place, so they can't drift apart.
Expand Down
12 changes: 8 additions & 4 deletions CursorFollowLinux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ all: $(BIN)

$(BIN): $(APP_OBJ) $(PROTO_OBJ)
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) -o $@ $^ $(PKG_LIBS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(PKG_LIBS)

$(BUILD)/obj/%.o: src/%.cpp $(PROTO_HDR)
@mkdir -p $(dir $@)
Expand All @@ -59,7 +59,7 @@ $(BUILD)/protocols/%.o: $(BUILD)/protocols/%.c $(PROTO_HDR)
# Tests link the app objects minus main so they can exercise the real code.
$(BUILD)/tests/%: tests/%.cpp $(LIB_OBJ) $(PROTO_OBJ)
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) -Itests -o $@ $< $(LIB_OBJ) $(PROTO_OBJ) $(PKG_LIBS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -Itests -o $@ $< $(LIB_OBJ) $(PROTO_OBJ) $(PKG_LIBS)

test: $(TEST_BIN)
@set -e; for t in $(TEST_BIN); do echo "== $$t"; $$t; done
Expand All @@ -71,8 +71,12 @@ install: $(BIN)
install -Dm755 $(BIN) $(DESTDIR)$(PREFIX)/bin/cursorfollow
install -Dm644 data/io.github.loganrupe.CursorFollowLinux.desktop $(DESTDIR)$(PREFIX)/share/applications/io.github.loganrupe.CursorFollowLinux.desktop
install -Dm644 data/io.github.loganrupe.CursorFollowLinux.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/512x512/apps/io.github.loganrupe.CursorFollowLinux.png
-update-desktop-database $(DESTDIR)$(PREFIX)/share/applications 2>/dev/null
-gtk-update-icon-cache -q -t $(DESTDIR)$(PREFIX)/share/icons/hicolor 2>/dev/null
# Staged installs (DESTDIR, i.e. packages) leave the caches to the package manager's hooks;
# writing them here would ship files that clash with the system's own caches.
ifeq ($(DESTDIR),)
-update-desktop-database $(PREFIX)/share/applications 2>/dev/null
-gtk-update-icon-cache -q -t $(PREFIX)/share/icons/hicolor 2>/dev/null
endif

uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/cursorfollow \
Expand Down
35 changes: 34 additions & 1 deletion CursorFollowLinux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ What is not in yet:
- **dmabuf transport.** The compositor offers it; the engine uses `wl_shm` for now.
- **System tray icon.** Hyprland setups vary too much (waybar, omarchy-shell, none);
the panel is a normal window and the CLI covers key bindings.
- Packaging (PKGBUILD / Flatpak) and a global-shortcuts portal integration.
- Flatpak and other distro packages, and a global-shortcuts portal integration.

---

Expand All @@ -73,6 +73,39 @@ No permissions dialog: Hyprland's export protocol does not go through the portal

---

## Install

Arch and Omarchy, from the AUR:

```sh
yay -S cursorfollow
```

Or take `cursorfollow-<version>-1-x86_64.pkg.tar.zst` from
[GitHub Releases](https://github.com/LoganRupe/CursorFollow/releases/latest) and install it
with pacman, which pulls in the dependencies:

```sh
sudo pacman -U cursorfollow-<version>-1-x86_64.pkg.tar.zst
```

Other x86_64 distros: the release also has `cursorfollow-<version>-x86_64.tar.gz`, the same
files laid out under `usr/`. Install the runtime libraries from [Requirements](#requirements),
then unpack it into a prefix:

```sh
sudo tar -xzf cursorfollow-<version>-x86_64.tar.gz -C /usr/local --strip-components=1
```

That binary is built on Arch, so it needs a glibc and GTK at least as new as Arch's at
release time. If it won't start, build from source instead.

From source, see [Build, test, run](#build-test-run) below; `make install` puts it under
`~/.local`. The PKGBUILD lives in `packaging/arch/`; `scripts/package-arch.sh` builds it from
your checkout instead of the release tarball.

---

## Build, test, run

From this directory:
Expand Down
16 changes: 16 additions & 0 deletions CursorFollowLinux/packaging/arch/.SRCINFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pkgbase = cursorfollow
pkgdesc = Share one window that follows the window you are working in (Hyprland)
pkgver = 0.5.2
pkgrel = 1
url = https://github.com/LoganRupe/CursorFollow
arch = x86_64
arch = aarch64
license = MIT
makedepends = pkgconf
depends = gtk4
depends = json-glib
depends = wayland
source = cursorfollow-0.5.2.tar.gz::https://github.com/LoganRupe/CursorFollow/archive/refs/tags/v0.5.2.tar.gz
sha256sums = a2028d5dcf805e410ad79cc7aac0b89f52b1fec0e831fc23c1f5363b679c43ae

pkgname = cursorfollow
33 changes: 33 additions & 0 deletions CursorFollowLinux/packaging/arch/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Maintainer: Logan Rupe <logan@coldtap.io>

pkgname=cursorfollow
pkgver=0.5.2
pkgrel=1
pkgdesc='Share one window that follows the window you are working in (Hyprland)'
arch=('x86_64' 'aarch64')
url='https://github.com/LoganRupe/CursorFollow'
license=('MIT')
depends=('gtk4' 'json-glib' 'wayland')
# wayland-scanner ships in the wayland package, already a runtime dependency.
makedepends=('pkgconf')
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('a2028d5dcf805e410ad79cc7aac0b89f52b1fec0e831fc23c1f5363b679c43ae')

build() {
cd "CursorFollow-$pkgver/CursorFollowLinux"
make VERSION="$pkgver"
}

check() {
cd "CursorFollow-$pkgver/CursorFollowLinux"
make VERSION="$pkgver" test
}

package() {
cd "CursorFollow-$pkgver"
make -C CursorFollowLinux VERSION="$pkgver" PREFIX=/usr DESTDIR="$pkgdir" install
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# 0.5.2's Makefile still writes these caches under DESTDIR; pacman's hooks own them.
rm -f "$pkgdir/usr/share/applications/mimeinfo.cache" \
"$pkgdir/usr/share/icons/hicolor/icon-theme.cache"
}
36 changes: 36 additions & 0 deletions CursorFollowLinux/scripts/package-arch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
#
# package-arch.sh — build the Arch package from this checkout, not the tag tarball.
#
# Packs HEAD into the tarball name the PKGBUILD expects and runs makepkg with checksums
# skipped (the PKGBUILD pins the published tag's hash, which HEAD won't match), so a
# packaging break shows up on the PR that caused it. Produces, in build/arch/:
# cursorfollow-<ver>-<rel>-<arch>.pkg.tar.zst
# cursorfollow-<ver>-<arch>.tar.gz (the install tree, usr/...)
#
# Run as a non-root user on Arch with base-devel. Extra args go to makepkg (e.g. -s).
# Usage: ./CursorFollowLinux/scripts/package-arch.sh [makepkg args...]

set -euo pipefail

ROOT="$(git -C "$(dirname "${BASH_SOURCE[0]}")" rev-parse --show-toplevel)"
OUT="$ROOT/CursorFollowLinux/build/arch"

rm -rf "$OUT"
mkdir -p "$OUT"
cp "$ROOT/CursorFollowLinux/packaging/arch/PKGBUILD" "$OUT/"
cd "$OUT"

eval "$(makepkg --printsrcinfo | awk -F' = ' '/^\tpkgver/ {print "VER=" $2} /^pkgname/ {print "NAME=" $2}')"
ARCH="$(uname -m)"

git -C "$ROOT" archive --prefix="CursorFollow-$VER/" -o "$OUT/$NAME-$VER.tar.gz" HEAD
makepkg -f --skipchecksums --noconfirm "$@"

PKG="$(ls "$NAME-$VER"-*-"$ARCH".pkg.tar.zst)"
mkdir tree
bsdtar -xf "$PKG" -C tree --exclude '.*'
tar -czf "$NAME-$VER-$ARCH.tar.gz" --owner=0 --group=0 --numeric-owner -C tree usr

echo "Built $OUT/$PKG"
echo "Built $OUT/$NAME-$VER-$ARCH.tar.gz"
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Download the latest build from **[GitHub Releases](https://github.com/LoganRupe/

- **macOS** — open the `.dmg` and drag **CursorFollowMac** into **Applications**. Releases are not notarized, so approve the first launch in **System Settings → Privacy & Security → Open Anyway**, then grant **Screen Recording** when prompted. See [macOS install](CursorFollowMac/README.md#install).
- **Windows** — run the `.msi` (no admin required). See [Windows setup](CursorFollowWin/README.md#installer).
- **Linux** — no packaged build yet; build from source with `make` and `make install`. See [Linux build](CursorFollowLinux/README.md#build-test-run).
- **Linux (Arch / Omarchy)** — `yay -S cursorfollow` from the AUR, or `sudo pacman -U` the release `.pkg.tar.zst`. Other distros: the release tarball or a source build. See [Linux install](CursorFollowLinux/README.md#install).

Then point your meeting app's **window** picker at **CursorFollow Output**: pick a target window (or set **Target Mode** to **Auto**), make sure output isn't paused, and share it.

Expand Down Expand Up @@ -95,9 +95,10 @@ The general reset is the same everywhere — quit your meeting app and CursorFol

GitHub Actions builds the installers ([.github/workflows/release.yml](.github/workflows/release.yml)):

1. Bump the version on every platform (`MARKETING_VERSION` in the Xcode project, `Version`/`FileVersion`/`AssemblyVersion` in `CursorFollowWin.csproj`, `VERSION` in `CursorFollowLinux/Makefile`) and move the **Unreleased** notes in `CHANGELOG.md` under a `## <version>` heading.
1. Bump the version on every platform (`MARKETING_VERSION` in the Xcode project, `Version`/`FileVersion`/`AssemblyVersion` in `CursorFollowWin.csproj`, `VERSION` in `CursorFollowLinux/Makefile`, `pkgver` in `CursorFollowLinux/packaging/arch/PKGBUILD`) and move the **Unreleased** notes in `CHANGELOG.md` under a `## <version>` heading.
2. Merge to `main`, then tag and push: `git tag -a v0.5.2 -m "CursorFollow 0.5.2" && git push origin v0.5.2`.
3. The workflow builds the signed macOS DMG and the Windows MSI and attaches both to a **draft** release, with the changelog section as notes. Review it, then publish.
3. The workflow builds the signed macOS DMG, the Windows MSI and the Arch package plus install tarball, and attaches them to a **draft** release, with the changelog section as notes. Review it, then publish.
4. Update the AUR: set `sha256sums` in the PKGBUILD to the new tag tarball's hash (`curl -sL https://github.com/LoganRupe/CursorFollow/archive/refs/tags/v<version>.tar.gz | sha256sum`), regenerate `.SRCINFO` with `makepkg --printsrcinfo > .SRCINFO`, commit both here, and push them to `aur.archlinux.org/cursorfollow.git`.

macOS signing in CI uses the self-signed identity from two repository secrets, `MAC_SIGNING_P12` (base64 of the `.p12`) and `MAC_SIGNING_P12_PASSWORD`. See [Docs/Distribution/Packaging.md](Docs/Distribution/Packaging.md). Local builds still work: `./CursorFollowMac/scripts/package.sh` and `./CursorFollowWin/scripts/package.ps1`.

Expand Down
Loading