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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ A simple webcam recorder for Omarchy. Choose your camera and microphone once, th
- Automatically selects the camera's maximum advertised video resolution, preferring 30 fps at that resolution. A mode slower than 15 fps is skipped when a smoother one exists, so a still-size listing cannot outrank the video mode. Preview preserves the whole frame.
- Live microphone meter with peak hold and clipping indication, including while paused. No microphone playback through your speakers.
- Explicit No audio option for silent recordings.
- Mirrors the live preview, the way Zoom and FaceTime do, so you move as in a mirror; the recording keeps the camera's true picture, so text reads correctly. The toggle sits at the bottom right (or press M) and is remembered.
- Live Omarchy accent syncing, including theme symlink switches. Controls and dialogs follow Hyprland's active corner rounding, including personal overrides. The chrome is light or dark with the theme, while the camera picture stays framed in black; a yellow fallback follows Omacut, and button foregrounds adapt for contrast.
- Follows the language picked under Omarchy's Setup > Language, live, including right-to-left layout. Every visible string goes through `qsTr()` or `tr()`; a translation is a flat JSON catalog from English text to the translation, `src/i18n/<code>.json`, listed in `src/resources.qrc`.
- Built-in editing: split the take into clips on an Omacut-style filmstrip, trim each clip with its handles, see where you paused, and undo. Edits never touch the original.
Expand All @@ -31,6 +32,7 @@ Monologue is packaged in [omarchy-pkgs](https://github.com/omacom/omarchy-pkgs/t
| Space | Record / pause / resume; play / pause while editing |
| Enter or Ctrl+Enter | Stop the take and edit it |
| Esc | Confirm discarding the clip and start over |
| M | Mirror the preview, or stop (the recording is never mirrored) |
| Q, Ctrl+Q, or Ctrl+W | Quit (asks first if the take is still recording or unsaved) |
| ? or F1 | Keyboard help |

Expand Down
33 changes: 31 additions & 2 deletions src/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ ApplicationWindow {
Shortcut { sequence: "Z"; context: Qt.WindowShortcut; autoRepeat: false; enabled: win.editing; onActivated: editBar.toggleZoom() }
Shortcut { sequence: "Ctrl+Z"; context: Qt.WindowShortcut; enabled: win.editing && backend.canUndo; onActivated: backend.undo() }
Shortcut { sequences: ["Ctrl+Shift+Z", "Ctrl+Y"]; context: Qt.WindowShortcut; enabled: win.editing && backend.canRedo; onActivated: backend.redo() }
Shortcut { sequence: "M"; context: Qt.WindowShortcut; autoRepeat: false; enabled: !win.finished && !win.overlayOpen; onActivated: backend.setMirror(!backend.mirror) }
Shortcut { sequences: ["Q", "Ctrl+Q", "Ctrl+W"]; context: Qt.WindowShortcut; autoRepeat: false; enabled: !win.overlayOpen; onActivated: win.closeSafely() }
Shortcut { sequences: ["?", "F1", "Ctrl+?"]; context: Qt.WindowShortcut; enabled: !win.overlayOpen; onActivated: helpDialog.open() }

Expand All @@ -176,6 +177,7 @@ ApplicationWindow {
camera: "M4.5 6h9a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-9a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z M15.5 10.5l6-3.5v10l-6-3.5z",
microphone: "M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3z M5.5 11a6.5 6.5 0 0 0 13 0 M12 17.5V21",
chevron: "M6 9l6 6 6-6",
mirror: "M3 7l5 5-5 5z M21 7l-5 5 5 5z M12 20v2 M12 14v2 M12 8v2 M12 2v2",
back: "M4 12a8 8 0 1 0 2.4-5.7 M4 4v4.5h4.5",
play: "M8 4.5v15l12.5-7.5z",
pause: "M7 4.5h2a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-13a1 1 0 0 1 1-1z M15 4.5h2a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-13a1 1 0 0 1 1-1z"
Expand Down Expand Up @@ -369,7 +371,7 @@ ApplicationWindow {
Rectangle {
Layout.fillWidth: true; Layout.fillHeight: true; Layout.minimumHeight: 120
color: "black"; clip: true
VideoOutput { id: liveVideo; anchors.fill: parent; visible: !win.finished; fillMode: VideoOutput.PreserveAspectFit; focus: true }
VideoOutput { id: liveVideo; objectName: "liveVideo"; anchors.fill: parent; visible: !win.finished; fillMode: VideoOutput.PreserveAspectFit; focus: true; mirrored: backend.mirror }
// Hold the last frame at the end of the file rather than clearing to black.
VideoOutput { id: clipVideo; objectName: "clipVideo"; endOfStreamPolicy: VideoOutput.KeepLastFrame; anchors.fill: parent; visible: win.finished; fillMode: VideoOutput.PreserveAspectFit }
MouseArea { anchors.fill: parent; onClicked: { liveVideo.forceActiveFocus(); if (win.finished) win.togglePlayback() } }
Expand Down Expand Up @@ -527,6 +529,33 @@ ApplicationWindow {
RowLayout {
Layout.fillWidth: true; Layout.preferredWidth: 1; spacing: 8
Item { Layout.fillWidth: true }
// Quiet on purpose: a preference, not part of recording. Brighter while mirrored.
RoundButton {
id: mirrorButton; objectName: "mirrorButton"
visible: !win.finished
// Implicit size, since the row layout ignores width and height.
implicitWidth: 36; implicitHeight: 36; padding: 0; flat: true
focusPolicy: Qt.TabFocus; hoverEnabled: true
Accessible.name: backend.mirror ? qsTr("Stop mirroring the preview") : qsTr("Mirror the preview")
// The glyph's right edge lines up with where the camera and microphone icons start on the left.
Layout.rightMargin: -2
ToolTip {
objectName: "mirrorTip"; visible: mirrorButton.hovered
text: (backend.mirror ? qsTr("Stop mirroring the preview") : qsTr("Mirror the preview")) + " (M)"
}
background: Rectangle {
radius: width / 2; color: mirrorButton.hovered ? win.roundHoverColor : "transparent"
border.width: mirrorButton.activeFocus ? 2 : 0; border.color: win.accent
}
contentItem: Item {
Icon {
anchors.centerIn: parent; width: 20; height: 20; path: win.icons.mirror
color: mirrorButton.hovered ? win.strongColor : backend.mirror ? win.dimColor : win.faintColor
}
}
onClicked: { backend.setMirror(!backend.mirror); liveVideo.forceActiveFocus() }
HoverHandler { cursorShape: Qt.PointingHandCursor }
}
ActionButton {
objectName: "saveButton"
readonly property bool saving: backend.state === "saving"
Expand Down Expand Up @@ -651,7 +680,7 @@ ApplicationWindow {
spacing: 40
ShortcutList {
Layout.alignment: Qt.AlignTop; heading: qsTr("Recording")
rows: [["Space", qsTr("Record / pause / resume")], ["Enter", qsTr("Stop and edit")], ["Esc", qsTr("Discard and start over")], ["Q", qsTr("Quit (Ctrl+Q, Ctrl+W)")], ["?", qsTr("Show shortcuts (F1)")]]
rows: [["Space", qsTr("Record / pause / resume")], ["Enter", qsTr("Stop and edit")], ["Esc", qsTr("Discard and start over")], ["M", qsTr("Mirror the preview")], ["Q", qsTr("Quit (Ctrl+Q, Ctrl+W)")], ["?", qsTr("Show shortcuts (F1)")]]
}
ShortcutList {
Layout.alignment: Qt.AlignTop; heading: qsTr("Editing")
Expand Down
8 changes: 8 additions & 0 deletions src/backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Backend::Backend(FilePicker *picker, bool activateHardware, QObject *parent)
m_root = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/recordings";
m_cameraId=m_settings.value("camera/id").toString();
m_audioId=m_settings.value("microphone/id").toString();
// Mirrored like Zoom and FaceTime unless turned off; only the preview flips.
m_mirror=m_settings.value("camera/mirror",true).toBool();
m_capture.setVideoSink(&m_sink);
connect(&m_sink,&QVideoSink::videoFrameChanged,this,&Backend::receiveVideo);
if(m_activateHardware) {
Expand Down Expand Up @@ -252,6 +254,12 @@ void Backend::selectMicrophone(int index) {
if(m_writer || index<0 || index>=m_microphones.size() || m_state=="saving" || m_probing) return;
m_audioId=m_microphones[index].toMap()["id"].toString(); activateSources();
}
void Backend::setMirror(bool value) {
if (m_mirror == value) return;
m_mirror = value;
m_settings.setValue("camera/mirror", value);
emit mirrorChanged();
}
void Backend::retry() { if(!m_writer && m_state!="finished") activateSources(); }
void Backend::toggleRecording() {
if(m_dialogOpen) return;
Expand Down
5 changes: 5 additions & 0 deletions src/backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Backend : public QObject {
Q_PROPERTY(int cameraIndex READ cameraIndex NOTIFY devicesChanged)
Q_PROPERTY(int microphoneIndex READ microphoneIndex NOTIFY devicesChanged)
Q_PROPERTY(bool ready READ ready NOTIFY changed)
Q_PROPERTY(bool mirror READ mirror NOTIFY mirrorChanged)
Q_PROPERTY(bool audioEnabled READ audioEnabled NOTIFY changed)
Q_PROPERTY(bool takeActive READ takeActive NOTIFY changed)
Q_PROPERTY(bool dialogOpen READ dialogOpen NOTIFY changed)
Expand Down Expand Up @@ -59,6 +60,7 @@ class Backend : public QObject {
int cameraIndex() const;
int microphoneIndex() const;
bool ready() const;
bool mirror() const { return m_mirror; }
bool audioEnabled() const { return m_audioId != "none"; }
bool takeActive() const { return m_writer != nullptr; }
bool dialogOpen() const { return m_dialogOpen; }
Expand All @@ -80,6 +82,7 @@ class Backend : public QObject {
Q_INVOKABLE void setPreview(QObject *sink);
Q_INVOKABLE void selectCamera(int index);
Q_INVOKABLE void selectMicrophone(int index);
Q_INVOKABLE void setMirror(bool value);
Q_INVOKABLE void retry();
Q_INVOKABLE void toggleRecording();
Q_INVOKABLE void finish();
Expand All @@ -105,6 +108,7 @@ class Backend : public QObject {
signals:
void changed();
void devicesChanged();
void mirrorChanged();
void meterChanged();
void editChanged();
void safeToClose();
Expand Down Expand Up @@ -177,5 +181,6 @@ class Backend : public QObject {
qint64 m_clipUntil = 0, m_peakUntil = 0, m_signalAt = 0;
double m_duration = 0, m_level = -60, m_peak = -60, m_pendingPeak = 0, m_fps = 30;
bool m_cameraHealthy = false, m_audioHealthy = false, m_dialogOpen = false;
bool m_mirror = true;
bool m_hasSaved = false, m_discardAfter = false, m_restartAfter = false, m_probing = false;
};
16 changes: 16 additions & 0 deletions tests/backend_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,22 @@ private slots:
backend.closeTake(); QVERIFY(!QDir(directory).exists()); QVERIFY(QFile::exists(saved));
QVERIFY(backend.clip().isEmpty()); QVERIFY(!backend.unsaved());
}
void mirrorIsOnUntilTurnedOff() {
{
Backend backend(new FakePicker,false);
QVERIFY(backend.mirror());
QSignalSpy changed(&backend,&Backend::mirrorChanged);
backend.setMirror(false); backend.setMirror(false);
QVERIFY(!backend.mirror()); QCOMPARE(changed.count(),1);
}
{
Backend backend(new FakePicker,false);
QVERIFY(!backend.mirror());
backend.setMirror(true);
}
Backend backend(new FakePicker,false);
QVERIFY(backend.mirror());
}
void leavingDeletesTake() {
auto directory=leaveTake("00000000-0000-0000-0000-000000000003",fixture.filePath("fixture.mp4"));
{
Expand Down
15 changes: 15 additions & 0 deletions tests/ui_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ QtObject {
property real peakLevel: -6
property bool clipping: false
property string meterText: "−9 dBFS"
property bool mirror: true
property url clip: ""
property string clipName: "Monologue-2026-09-17.mp4"
property real saveProgress: 0
Expand All @@ -63,6 +64,7 @@ QtObject {
function setPreview(sink) {}
function toggleRecording() { toggles++; state = state === "ready" || state === "paused" ? "recording" : "paused"; changed() }
function finish() { state = "finished"; changed() }
function setMirror(value) { mirror = value; changed() }
function selectCamera(i) {}
function selectMicrophone(i) {}
function newRecording() { newRecordings++; state = "ready"; changed() }
Expand Down Expand Up @@ -112,6 +114,19 @@ QtObject {
const auto picture=window->grabWindow(); QVERIFY(picture.pixelColor(picture.width()/2,40).lightness()<20);
QVERIFY(write(themeDir.filePath("theme/colors.toml"),"accent = \"#FFD60A\"\n"));
QTRY_VERIFY(window->color().lightness()<40);
// The preview is mirrored by default; the button and M turn it off and on again.
auto *live=window->findChild<QQuickItem*>("liveVideo"); QVERIFY(live);
auto *mirror=window->findChild<QQuickItem*>("mirrorButton"); QVERIFY(mirror);
QVERIFY(live->property("mirrored").toBool()); QVERIFY(mirror->isVisible());
// Hovering explains it.
QTest::mouseMove(window,mirror->mapToScene(QPointF(mirror->width()/2,mirror->height()/2)).toPoint());
auto *tip=window->findChild<QObject*>("mirrorTip"); QVERIFY(tip);
QTRY_VERIFY(tip->property("visible").toBool());
QCOMPARE(tip->property("text").toString(),QString("Stop mirroring the preview (M)"));
QTest::mouseClick(window,Qt::LeftButton,Qt::NoModifier,mirror->mapToScene(QPointF(mirror->width()/2,mirror->height()/2)).toPoint());
QVERIFY(!backend->property("mirror").toBool()); QVERIFY(!live->property("mirrored").toBool());
QTRY_VERIFY(live->hasActiveFocus());
QTest::keyClick(window,Qt::Key_M); QVERIFY(backend->property("mirror").toBool()); QVERIFY(live->property("mirrored").toBool());
QTest::keyClick(window,Qt::Key_Space); QCOMPARE(backend->property("state").toString(),QString("recording"));
QTest::keyClick(window,Qt::Key_Space); QCOMPARE(backend->property("state").toString(),QString("paused"));
QTest::keyClick(window,Qt::Key_Space); QCOMPARE(backend->property("state").toString(),QString("recording"));
Expand Down
Loading