Files
omarchy-pkgs/pkgbuilds/edge/intel-ipu7-camera/intel-ipu7-camera.install
T
Spencer Bull b311f063ac fix(intel-ipu7-camera): fix service enable, remove broken PipeWire browser flags
- Replace su - with systemctl --global enable + runuser; su - fails silently
  in pacman install scripts, leaving camera-feed-watch.service disabled
- Remove _add_pipewire_camera(): adding PipeWireCamera/WebRtcPipeWireCamera
  to browser flags routes camera through PipeWire which is non-functional for
  this setup; V4L2 direct access to /dev/video50 works correctly
- Fix disable-libcamera.conf: replace broken /dev/null script override with
  correct WirePlumber 0.5 wireplumber.profiles syntax

Closes #56
2026-03-20 06:54:14 -05:00

56 lines
1.8 KiB
Plaintext

_install_sleep_hook() {
cp /usr/share/intel-ipu7-camera/camera-sleep-hook /usr/lib/systemd/system-sleep/camera-sleep-hook
chmod 755 /usr/lib/systemd/system-sleep/camera-sleep-hook
}
post_install() {
_install_sleep_hook
systemctl daemon-reload
systemctl enable camera-init.service
systemctl --global enable camera-feed-watch.service
udevadm control --reload-rules 2>/dev/null || true
if [ -n "$SUDO_USER" ]; then
usermod -aG video "$SUDO_USER" 2>/dev/null || true
# Start the service in the current user session if one is active
local uid
uid=$(id -u "$SUDO_USER" 2>/dev/null)
if [ -n "$uid" ] && [ -d "/run/user/$uid" ]; then
XDG_RUNTIME_DIR="/run/user/$uid" \
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$uid/bus" \
runuser -u "$SUDO_USER" -- \
systemctl --user start camera-feed-watch.service 2>/dev/null || true
fi
fi
}
post_upgrade() {
_install_sleep_hook
systemctl daemon-reload
udevadm control --reload-rules 2>/dev/null || true
}
pre_remove() {
systemctl --global disable camera-feed-watch.service 2>/dev/null || true
systemctl disable camera-init.service 2>/dev/null || true
systemctl stop camera-init.service 2>/dev/null || true
if [ -n "$SUDO_USER" ]; then
local uid
uid=$(id -u "$SUDO_USER" 2>/dev/null)
if [ -n "$uid" ] && [ -d "/run/user/$uid" ]; then
XDG_RUNTIME_DIR="/run/user/$uid" \
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$uid/bus" \
runuser -u "$SUDO_USER" -- \
systemctl --user stop camera-feed-watch.service 2>/dev/null || true
fi
fi
}
post_remove() {
rm -f /usr/lib/systemd/system-sleep/camera-sleep-hook
systemctl daemon-reload
udevadm control --reload-rules 2>/dev/null || true
}