Skip to content

Your Android phone and your Windows PC, working as one. Local-first, end-to-end encrypted, no account.

Linux: one command installs NectarLink with everything it needs

Bee04309eb6f816
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ad0a615..011a1ae 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -186,6 +186,22 @@ jobs:
- name: Release build
run: cargo build --locked --release -p nectarlink-desktop -p nectarlink-vcam
+ linux-install:
+ name: Linux packages and install.sh
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v7
+ - name: Install the packaging tools
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y --no-install-recommends rpm shellcheck
+ - name: Check the scripts
+ run: |
+ shellcheck -s sh desktop/packaging/linux/install.sh
+ shellcheck desktop/packaging/linux/build-rpm.sh desktop/packaging/linux/test-install.sh
+ - name: Install and remove each package with install.sh
+ run: desktop/packaging/linux/test-install.sh
+
android:
name: Android app
runs-on: ubuntu-latest
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index b5932e2..d422127 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -111,7 +111,7 @@ jobs:
sudo apt-get install -y --no-install-recommends \
build-essential pkg-config libgl1-mesa-dev libx11-dev libxcb1-dev \
libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev libfontconfig1-dev \
- libfreetype-dev libdbus-1-dev libxtst-dev file desktop-file-utils appstream
+ libfreetype-dev libdbus-1-dev libxtst-dev file desktop-file-utils appstream rpm shellcheck
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
@@ -139,14 +139,18 @@ jobs:
run: |
desktop-file-validate desktop/packaging/linux/nectarlink.desktop
appstreamcli validate --no-net desktop/packaging/linux/org.nectarlink.desktop.metainfo.xml
- - name: Build and package (.deb, AppImage, tarball)
+ - name: Check the install script
+ run: shellcheck -s sh desktop/packaging/linux/install.sh
+ - name: Build and package (.deb, .rpm, AppImage, tarball)
env:
APPIMAGE_EXTRACT_AND_RUN: "1"
run: |
cargo build --release -p nectarlink-desktop
./desktop/packaging/linux/build-deb.sh
+ ./desktop/packaging/linux/build-rpm.sh
./desktop/packaging/linux/build-appimage.sh
./desktop/packaging/linux/build-tarball.sh
+ cp desktop/packaging/linux/install.sh dist/install.sh
- name: Check that each package starts
# A package that doesn't start must not reach a release. The .deb goes
# into a clean Ubuntu 24.04, the oldest system the build supports.
@@ -155,16 +159,37 @@ jobs:
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends /dist/*.deb >/dev/null
nectarlink-desktop --version'
+ docker run --rm -v "$PWD/dist:/dist:ro" fedora:40 bash -euc '
+ dnf install -y -q --nogpgcheck /dist/*.rpm >/dev/null
+ nectarlink-desktop --version'
APPIMAGE_EXTRACT_AND_RUN=1 ./dist/*.AppImage --version
mkdir -p /tmp/tarball && tar -xzf dist/*.tar.gz -C /tmp/tarball
/tmp/tarball/*/nectarlink-desktop --version
+ - name: Check that install.sh installs and removes each package
+ # The one-line install, from these files instead of GitHub: the .deb on
+ # Ubuntu, the .rpm on Fedora, and the tarball in a home folder.
+ run: |
+ (cd dist && sha256sum *.deb *.rpm *.tar.gz > SHA256SUMS.txt)
+ for image in ubuntu:24.04 fedora:40; do
+ docker run --rm -v "$PWD/dist:/dist:ro" -e NECTARLINK_ASSETS_DIR=/dist "$image" sh -euc '
+ sh /dist/install.sh
+ nectarlink-desktop --version
+ sh /dist/install.sh --uninstall
+ ! command -v nectarlink-desktop'
+ done
+ docker run --rm -v "$PWD/dist:/dist:ro" ubuntu:24.04 sh -euc '
+ useradd -m user
+ su user -c "NECTARLINK_ASSETS_DIR=/dist sh /dist/install.sh && ~/.local/bin/nectarlink-desktop --version"'
+ rm dist/SHA256SUMS.txt
- uses: actions/upload-artifact@v7
with:
name: linux
path: |
dist/*.deb
+ dist/*.rpm
dist/*.AppImage
dist/*.tar.gz
+ dist/install.sh
android:
name: Android app (signed)
@@ -238,7 +263,7 @@ jobs:
name=$(awk '/^\[workspace.metadata.release\]/{f=1;next} /^\[/{f=0} f && /^name = /{print $3}' source/Cargo.toml | tr -d '"')
title="NectarLink ${GITHUB_REF_NAME#v}${name:+ $name}"
cd files
- sha256sum *.exe *.deb *.AppImage *.tar.gz *.apk > SHA256SUMS.txt
+ sha256sum *.exe *.deb *.rpm *.AppImage *.tar.gz *.apk install.sh > SHA256SUMS.txt
cat SHA256SUMS.txt
# The notes: this version's section of CHANGELOG.md ("## <version> ..."),
# with its wrapped lines joined, or GitHub's generated notes when
@@ -246,5 +271,5 @@ jobs:
awk -v v="${GITHUB_REF_NAME#v}" '$1=="##" && $2==v {f=1; next} f && /^## / {exit} f' \
../source/CHANGELOG.md | awk -f ../source/.github/scripts/unwrap-notes.awk > notes.md || true
if [ -s notes.md ]; then notes=(--notes-file notes.md); else notes=(--generate-notes); fi
- gh release create "${{ github.ref_name }}" *.exe *.deb *.AppImage *.tar.gz *.apk SHA256SUMS.txt \
+ gh release create "${{ github.ref_name }}" *.exe *.deb *.rpm *.AppImage *.tar.gz *.apk install.sh SHA256SUMS.txt \
--repo "${{ github.repository }}" --draft "${notes[@]}" --title "$title"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0792c11..5dc75d7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,8 +9,8 @@ change things that need a step from you, and its notes say so.
### New
- **The PC app on Linux**, for Ubuntu 24.04 or newer, Debian 13, Fedora 40
- or newer and other distributions from 2024 on, as a `.deb`, an AppImage
- or a tarball. It does what the Windows app does: notifications with
+ or newer and other distributions from 2024 on, as a `.deb`, an `.rpm`,
+ an AppImage or a tarball. It does what the Windows app does: notifications with
replies, messages and calls, the clipboard, files, your phone's storage
in the file manager, photos, media controls, mirroring and phone apps in
windows, your PC's screen on the phone, the phone as webcam and
@@ -24,6 +24,13 @@ change things that need a step from you, and its notes say so.
[#42](https://github.com/thtbee/nectarlink/pull/42),
[#43](https://github.com/thtbee/nectarlink/pull/43),
[#44](https://github.com/thtbee/nectarlink/pull/44)).
+- **One command installs NectarLink on Linux** with everything it needs,
+ showing each step:
+ `curl -fsSL https://github.com/thtbee/nectarlink/releases/latest/download/install.sh | sh`.
+ It picks the package for your system, checks it against the release's
+ sums, installs it with its dependencies, and sets up the phone as webcam,
+ the phone as keyboard and mouse, and the firewall for your local network.
+ `--uninstall` removes it all again.
- **The PC app on macOS, as a preview.** It builds and runs on macOS 14
and later with pairing, files and folders, the photos browser,
Continuity Camera, calls and SMS, the phone's toggles and volume,
diff --git a/README.md b/README.md
index 279499a..17b2108 100644
--- a/README.md
+++ b/README.md
@@ -40,12 +40,29 @@ of new features I wanted that I think you'll enjoy having too.
|---|---|---|
| **Windows (x64)** | [Installer (.exe)](https://github.com/thtbee/nectarlink/releases/download/v0.1.4/Nectarlink-0.1.4-x64-setup.exe) | Windows 11, 64-bit Intel or AMD |
| **Windows (ARM64)** | From the next release | Windows 11 on ARM (Snapdragon) |
-| **Linux (x86_64)** | From the next release (.deb, AppImage and .tar.gz) | Ubuntu 24.04 or newer, Debian 13, Fedora 40 or newer, 64-bit Intel or AMD |
+| **Linux (x86_64)** | From the next release: [one command](#on-linux), or a .deb, .rpm, AppImage or .tar.gz | Ubuntu 24.04 or newer, Debian 13, Fedora 40 or newer, 64-bit Intel or AMD |
| **Android** | [App (.apk)](https://github.com/thtbee/nectarlink/releases/download/v0.1.4/Nectarlink-0.1.4-android.apk) | Android 8.0 or newer |
The apps update themselves from GitHub Releases and check every download
against its SHA-256 sums.
+### On Linux
+
+From the next release, one command installs NectarLink with everything it
+needs, and shows each step as it goes:
+
+```bash
+curl -fsSL https://github.com/thtbee/nectarlink/releases/latest/download/install.sh | sh
+```
+
+It picks the package for your system (.deb with apt, .rpm with dnf or zypper,
+the tarball elsewhere), checks it against the release's SHA-256 sums and
+installs it with its dependencies. Then it sets up the phone as a webcam, the
+phone as a keyboard and mouse, and the firewall for your local network only.
+To remove it all again, end the same command with `sh -s -- --uninstall`
+instead of `sh`. See [Installing on Linux](docs/guide/getting-started.md#on-linux)
+for the details.
+
> [!NOTE]
> SmartScreen may warn about the Windows installer the first time, because it
> isn't code-signed yet: choose **More info**, then **Run anyway**. On Android,
diff --git a/desktop/packaging/linux/build-rpm.sh b/desktop/packaging/linux/build-rpm.sh
index b570a0c..7a84042 100755
--- a/desktop/packaging/linux/build-rpm.sh
+++ b/desktop/packaging/linux/build-rpm.sh
@@ -115,8 +115,10 @@ update-desktop-database -q /usr/share/applications >/dev/null 2>&1 || :
gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor >/dev/null 2>&1 || :
EOF
-rpmbuild -bb \
+# Its own database: a Debian or Ubuntu host has no system one.
+rpmbuild -bb --quiet \
--define "_topdir ${STAGE_DIR}/rpmbuild" \
+ --define "_dbpath ${STAGE_DIR}/rpmdb" \
--define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \
"${STAGE_DIR}/rpmbuild/SPECS/nectarlink.spec"
diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md
index 32b33c8..de43c2c 100644
--- a/docs/guide/getting-started.md
+++ b/docs/guide/getting-started.md
@@ -1,12 +1,13 @@
# Getting Started
-This guide walks you through installing NectarLink on Windows 11 and Android, completing the first-run setup walkthrough, pairing your devices, and choosing the Android power level that fits how you work.
+This guide walks you through installing NectarLink on Windows 11, Linux and Android, completing the first-run setup walkthrough, pairing your devices, and choosing the Android power level that fits how you work.
## System Requirements
| Platform | Minimum Version | Notes |
| :--- | :--- | :--- |
| **Windows PC** | Windows 11 (build 22000 or newer, 64-bit) | Required for Mica backdrop, Windows Cloud Files (`cfapi`) storage mounting, and the `MFCreateVirtualCamera` webcam add-on. |
+| **Linux PC** | Ubuntu 24.04 or newer, Debian 13, Fedora 40 or newer, or another distribution from 2024 on (glibc 2.39 or newer), 64-bit Intel or AMD | X11 or Wayland. The phone as a webcam needs the `v4l2loopback` driver, which the install command sets up. |
| **Android Phone or Tablet** | Android 8.0 (API 26) or newer | Android 10+ required for internal audio capture during mirroring; Android 11+ required for on-device Wireless Debugging (`Elevated`) and `app window` streaming; Android 12+ required for `Elevated` in-call mute/hold/speaker controls. |
| **Network** | Shared Wi-Fi / LAN, USB cable, or **Connect over mobile data** | By default, all device-to-device traffic travels directly over your local network or a USB data cable without leaving your LAN (installed copies only contact GitHub Releases over HTTPS to check for app updates; see [Privacy and Security](privacy-and-security.md)). |
@@ -19,6 +20,29 @@ This guide walks you through installing NectarLink on Windows 11 and Android, co
3. Click **Install** and allow the administrator prompt. Setup installs NectarLink, registers the required Windows Firewall rule for local QUIC discovery and connections, adds Start Menu and desktop shortcuts, and sets NectarLink to start in the system tray when you sign in (turn this off with **Start with Windows** in **Settings › General**). **What this installs** on the first screen lists everything it adds.
4. The last screen shows a QR code for the Android app's download page. Scan it with your phone's camera, then click **Open NectarLink**.
+### On Linux
+
+Open a terminal and run:
+
+```bash
+curl -fsSL https://github.com/thtbee/nectarlink/releases/latest/download/install.sh | sh
+```
+
+It shows each step as it runs, and `sudo` asks for your password once. It:
+
+1. Checks that your system can run NectarLink.
+2. Downloads the package for your system (a `.deb` with apt on Ubuntu and Debian, an `.rpm` with dnf on Fedora or zypper on openSUSE, the tarball elsewhere) and checks it against the release's `SHA256SUMS.txt`. If it doesn't match, nothing is installed.
+3. Installs it with the libraries and tools it needs, and adds NectarLink to your app menu.
+4. Sets up the phone as a webcam: installs the `v4l2loopback` driver and loads it as **NectarLink Webcam**, now and at every start. On Fedora the driver comes from RPM Fusion, which the installer doesn't add for you; it tells you how. With Secure Boot on, it also tells you how to enroll the driver's key.
+5. Lets the phone type and move the pointer: a udev rule gives the signed-in user access to `/dev/uinput`, as game controller drivers do.
+6. Opens NectarLink's ports (7718, mDNS on 5353, and LocalSend on 53317) in ufw or firewalld, to your local network only.
+
+To install only the app, end the command with `sh -s -- --no-extras` instead of `sh`. Without `sudo` or `doas`, it installs the tarball in your home folder and skips steps 4 to 6.
+
+You can also download a package from the GitHub Releases page yourself: `nectarlink_<version>_amd64.deb`, `nectarlink-<version>-1.x86_64.rpm`, `Nectarlink-<version>-x86_64.AppImage`, or `Nectarlink-<version>-linux-x86_64.tar.gz` (run its `install.sh`). The AppImage adds itself to your app menu the first time it runs. **Connection Doctor** in NectarLink's **Settings › Connection & About** finds anything still missing for the webcam, input or firewall and says how to fix it.
+
+Each kind of install updates itself the same way it was installed.
+
### On Android
1. Download `Nectarlink-<version>-android.apk` from the GitHub Releases page (or scan the QR code shown when Windows setup finishes, or in the PC walkthrough).
@@ -30,6 +54,7 @@ This guide walks you through installing NectarLink on Windows 11 and Android, co
### Uninstalling
- **Windows:** open **Settings › Apps › Installed apps**, choose **NectarLink**, then **Uninstall**. This removes the app, its firewall rule, update task, shortcuts and Share sheet entry, and deletes its settings and pairings on this PC. Files you received and voice recordings stay where they were saved.
+- **Linux:** run `curl -fsSL https://github.com/thtbee/nectarlink/releases/latest/download/install.sh | sh -s -- --uninstall`. This removes the app however it was installed, its webcam, input and firewall settings, its menu entry and starting with your computer. Your settings and pairings stay in `~/.local/share/Nectarlink`; delete that folder to remove them too. An AppImage is removed by deleting the file.
- **Android:** uninstall it like any other app.
## First-Run Setup Walkthrough