Camera Preview (mandavkarpranjal.cam-preview)

A live camera preview bar widget for Omarchy. The bar gets a camera icon; clicking it opens a popup with a live preview of your webcam, a device picker, a mirror toggle, and a snapshot button.

Features

  • Live preview rendered as a fast "slideshow" of still captures (works around Qt's FFmpeg camera backend, which neither paints late-mounted VideoOutputs nor releases the sensor on Camera.active = false)
  • Sensor fully released when the popup closes — no /dev/video0 left open
  • Camera device picker (persisted in shell.json), default "Auto"
  • Mirror toggle (default on, like a front-facing camera; snapshots are always saved unmirrored)
  • Snapshot capture: click the bar icon with the right mouse button, or the Snapshot button in the popup — saves ~/Pictures/camera-preview-<timestamp>.jpg
  • IPC: omarchy-shell mandavkarpranjal.cam-preview toggle|takeSnapshot|setMirror <true|false>

Requirements

  • Omarchy shell (Quickshell-based) with the bar plugin
  • A working v4l2 webcam
  • A Nerd Font for the icon glyphs (JetBrainsMono Nerd Font ships with Omarchy)

Installation

Install with the Omarchy CLI (recommended):

omarchy plugin add https://github.com/MandavkarPranjal/cam-preview.git --enable --yes
omarchy restart shell

--enable adds the widget to the bar and enables it; --yes skips the confirmation prompt. Then add the widget from the Omarchy settings panel (bar layout editor, category System) if you prefer the GUI route.

The plugin directory name must match the plugin id (mandavkarpranjal.cam-preview); omarchy plugin add handles this for you.

Updates

omarchy plugin update mandavkarpranjal.cam-preview --yes
omarchy restart shell

Removal

omarchy plugin remove mandavkarpranjal.cam-preview --yes

Manual / development install

Clone straight into the Omarchy user plugin dir, or use the helper script:

git clone https://github.com/MandavkarPranjal/cam-preview.git ~/.config/omarchy/plugins/mandavkarpranjal.cam-preview
./install.sh            # copies into ~/.config/omarchy/plugins/mandavkarpranjal.cam-preview
./install.sh --link     # symlinks instead (handy for development)
./install.sh --remove   # removes the installed copy

Usage

ActionHow
Open / close previewLeft-click the camera icon in the bar
Take a snapshotRight-click the bar icon, or the Snapshot button
Pick a cameraDropdown in the popup header
Mirror / unmirrorMirror button in the popup header (or setMirror IPC)

Snapshots land in ~/Pictures/camera-preview-*.jpg.

Settings

Stored as flat keys on the widget's entry in ~/.config/omarchy/shell.json (e.g. "mirror": true); editable there or via the settings panel.

KeyDefaultDescription
deviceautoCamera device id, or auto for the system default
previewWidth480Preview width in the popup (240-960, 16:9)
mirrortrueFlip the preview horizontally; snapshots unaffected

Troubleshooting

  • Stale behavior after editing QML: the shell hot-reload reuses the old compiled component — run omarchy restart shell after any change.
  • No camera found: check v4l2-ctl --list-devices and that your user can open /dev/video0 (video group / loginctl).
  • FPS: the sensor self-limits to ~15-30 fps per still capture; that is normal for this architecture.

License

MIT — see LICENSE.