Skip to content

install.sh

Files / xps-14-webcam / install.sh

Files in xps-14-webcam/

DownloadRawShell script ยท 46 lines ยท 2.4 KB

From The webcam on a Dell XPS 14 (Panther Lake) under Kubuntu 26.04. MIT licence: LICENSE.

xps-14-webcam/install.sh
#!/usr/bin/env bash
# User part of the built-in camera setup: relay service, toggle, KDE launcher,
# WirePlumber rules, Edge launcher with PipeWire camera. Run setup-root.sh first.
# Safe to re-run. Usage: bash install.sh
set -uo pipefail
here=$(cd "$(dirname "$0")" && pwd)
ok() { echo "๐ŸŸข $*"; }
fail() { echo "๐Ÿ”ด $*"; echo; echo "๐Ÿ”ด FAILED"; exit 1; }
command -v gst-launch-1.0 >/dev/null || fail "gst-launch-1.0 missing: run setup-root.sh first"
gst-inspect-1.0 pipewiresink >/dev/null 2>&1 || fail "pipewiresink missing: run setup-root.sh first"
[ -e /sys/bus/i2c/drivers/ov08x40/i2c-OVTI08F4:00 ] || fail "ov08x40 sensor not bound: run setup-root.sh, then reboot"
echo "๐ŸŒฑ Installing files"
install -Dm644 "$here/camera-relay.service" ~/.config/systemd/user/camera-relay.service
install -Dm644 "$here/ov08x40.yaml" ~/.config/camera-relay/ov08x40.yaml
install -Dm644 "$here/51-camera-relay.conf" ~/.config/wireplumber/wireplumber.conf.d/51-camera-relay.conf
install -Dm755 "$here/camera-relay.sh" ~/.local/bin/camera-relay
mkdir -p ~/.local/share/applications
sed "s#^Exec=camera-relay#Exec=$HOME/.local/bin/camera-relay#" "$here/camera-relay.desktop" > ~/.local/share/applications/camera-relay.desktop
ok "Relay service, tuning file, WirePlumber rules, ~/.local/bin/camera-relay, KDE launcher"
edge=/usr/share/applications/microsoft-edge.desktop
if [ -f "$edge" ]; then
sed -E 's#^Exec=/usr/bin/microsoft-edge-stable#Exec=/usr/bin/microsoft-edge-stable --enable-features=WebRtcPipeWireCamera#' \
"$edge" > ~/.local/share/applications/microsoft-edge.desktop
ok "Edge launcher override with --enable-features=WebRtcPipeWireCamera"
else
echo "๐ŸŸ  Edge not installed, skipped its launcher override"
fi
systemctl --user daemon-reload || fail "systemctl --user daemon-reload failed"
kbuildsycoca6 >/dev/null 2>&1 || true
ok "systemd and KDE menu reloaded"
if wpctl status 2>/dev/null | grep -q '\[libcamera\]'; then
systemctl --user restart wireplumber && sleep 3
ok "WirePlumber restarted (libcamera camera removed from PipeWire)"
fi
wpctl status | grep -q '\[libcamera\]' && fail "PipeWire still has the libcamera camera (it crashes PipeWire)"
ok "PipeWire's libcamera camera is off"
echo
echo "๐ŸŸข SUCCESS"
echo "๐Ÿชต Turn the camera on with: camera-relay start (or KDE menu: Camera Relay (on/off))"
echo "๐Ÿชต Brave: enable brave://flags/#enable-webrtc-pipewire-camera by hand (no launcher override)"

Text, photos and drawings: CC BY 4.0. Code: MIT. Share and adapt them, crediting HomeLab Series (blog.jacq.cc). Licence and terms of use ยทPrivacy policy (no cookies, no tracking)