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: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ omavm status radic --json

OmaVM é **Omarchy-first**. Integração com o host é feature central, não avançada. Tratar como capacidades de primeira classe (quando aplicável ao backend): clipboard, compartilhamento de diretórios, project folders, Wayland, áudio, microfone, notificações, resolução dinâmica, SSH, execução de comandos, transferência de arquivos, GPU acceleration. A UI expõe capacidades/intenções, não os mecanismos internos usados para implementá-las.

Implementado até agora: frontend Qt Quick/QML com toast in-app; entrada `.desktop` + ícone (`data/`) para o `omavm-gui` aparecer no launcher/taskbar com app-id próprio; sincronização direta com o tema Omarchy ativo (dark/light, background, foreground, accent e selection), acompanhando trocas em runtime. A aplicação apenas consome `colors.toml`; não mantém tema próprio. Consumir não significa repassar cegamente: texto precisa de 7:1 (WCAG 2.2 AAA 1.4.6) sobre as duas superfícies, então `Backend::loadTheme` ajusta `foreground`/`muted` (`readableTextColor`) e as cores de estado usadas como texto — verde, vermelho e `themeAccentText` — com `accessibleColor`, que mantém o tom e só clareia ou escurece o necessário; o accent cru fica para os controles do Material. `everyThemeTextMeetsAAA` confere isso em todos os temas instalados. A acessibilidade é auditada pela árvore que o Qt entrega ao AT-SPI (`tst_accessibility.qml`): controle visível sem nome ou inalcançável por teclado falha o teste. Com a acessibilidade ativa, o Qt ignora `Accessible.checked` escrito à mão e anuncia o estado do próprio controle — seleção tem que ser um controle `checkable` de verdade, e uma escolha exclusiva (as cores) leva `Accessible.role: Accessible.RadioButton`, sem o qual o Qt 6.4 não a declara marcável. Os testes consultam a `QAccessibleInterface` (`accessibilityProblems`, `accessibleState`), nunca a propriedade anexada do QML, que diverge entre versões; o CI roda o Qt 6.4 do Ubuntu 24.04 e o desenvolvimento o Qt do Arch, e os dois precisam passar.
Implementado até agora: frontend Qt Quick/QML com toast in-app; entrada `.desktop` + ícone (`data/`) para o `omavm-gui` aparecer no launcher/taskbar com app-id próprio; sincronização direta com o tema Omarchy ativo (dark/light, background, foreground, accent e selection), acompanhando trocas em runtime. A aplicação apenas consome `colors.toml`; não mantém tema próprio. Consumir não significa repassar cegamente: texto precisa de 7:1 (WCAG 2.2 AAA 1.4.6) sobre as duas superfícies, então `Backend::loadTheme` ajusta `foreground`/`muted` (`readableTextColor`) e as cores de estado usadas como texto — verde, vermelho e `themeAccentText` — com `accessibleColor`, que mantém o tom e só clareia ou escurece o necessário; o accent cru fica para os controles do Material. `everyThemeTextMeetsAAA` confere isso em todos os temas instalados. A acessibilidade é auditada pela árvore que o Qt entrega ao AT-SPI (`tst_accessibility.qml`): controle visível sem nome ou inalcançável por teclado falha o teste. Com a acessibilidade ativa, o Qt ignora `Accessible.checked` escrito à mão e anuncia o estado do próprio controle — seleção tem que ser um controle `checkable` de verdade, e uma escolha exclusiva (as cores) leva `Accessible.role: Accessible.RadioButton`, sem o qual o Qt 6.4 não a declara marcável. Os testes consultam a `QAccessibleInterface` (`accessibilityProblems`, `accessibleState`), nunca a propriedade anexada do QML, que diverge entre versões; o CI roda o Qt 6.4 do Ubuntu 24.04 e o desenvolvimento o Qt do Arch, e os dois precisam passar. Todo QML de nível superior que nenhum teste carrega entra em `tst_compile.qml`, que só o compila (com os tipos C++ reais registrados): foi assim que um `const long` (reservado no 6.4) passou despercebido até cair num arquivo de teste.

A GUI roda ações de ambientes diferentes ao mesmo tempo (`Backend::busyEnvironments`, desde 2026-09-29): o Core já serializa cada ambiente pelo lock dele, então a GUI só recusa uma segunda ação no **mesmo** ambiente. Como OMAcut/OMAwrite, a janela principal é tiled por padrão; não adicione regra Hyprland para fazê-la flutuar. OMAcalc é uma exceção compacta explicitamente marcada como floating, não um precedente para a OmaVM.

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ DIST_NAME = omavm-$(VERSION)-x86_64-linux

dist: build-gui
@test -n "$(VERSION)" || { echo "set VERSION=x.y.z"; exit 1; }
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o bin/omavm ./cmd/omavm
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -X main.version=$(VERSION)" -o bin/omavm ./cmd/omavm
rm -rf build/dist && mkdir -p build/dist/$(DIST_NAME)
install -Dm755 bin/omavm build/dist/$(DIST_NAME)/bin/omavm
install -Dm755 bin/omavm-gui build/dist/$(DIST_NAME)/bin/omavm-gui
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</p>

<p align="center">
<a href="https://github.com/KitsuneSemCalda/OmaVM/actions/workflows/ci.yml"><img src="https://github.com/KitsuneSemCalda/OmaVM/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
<a href="https://github.com/KitsuneForgering/OmaVM/actions/workflows/ci.yml"><img src="https://github.com/KitsuneForgering/OmaVM/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT"></a>
<a href="go.mod"><img src="https://img.shields.io/badge/go-1.27.1%2B-00ADD8?logo=go" alt="Go 1.27.1+"></a>
</p>
Expand Down Expand Up @@ -143,7 +143,7 @@ into `omavm-gui`. See [Machines](#machines) below for what that gets you.
## Quick start

```bash
git clone https://github.com/KitsuneSemCalda/OmaVM.git
git clone https://github.com/KitsuneForgering/OmaVM.git
cd OmaVM
make check # build, vet, test everything
make install # omavm + omavm-gui on PATH, .desktop entry, no root needed
Expand Down Expand Up @@ -480,7 +480,7 @@ confirmation (`CONFIRM=1` skips the prompt for scripted use).
OmaVM is listed in OmaStore through [`omastore.toml`](omastore.toml):

```bash
omastore install KitsuneSemCalda/OmaVM
omastore install KitsuneForgering/OmaVM
```

The store installs the release tarball under your home directory and puts
Expand Down
2 changes: 1 addition & 1 deletion cmd/omavm/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"io"
"os/exec"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

// Exit codes are a contract with scripts and agents: they say what the
Expand Down
2 changes: 1 addition & 1 deletion cmd/omavm/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os/exec"
"testing"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

func TestErrorClassesHaveStableExitCodes(t *testing.T) {
Expand Down
38 changes: 31 additions & 7 deletions cmd/omavm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ import (
"os"
"os/exec"
"os/signal"
"runtime/debug"
"strings"
"syscall"
"time"

"github.com/KitsuneSemCalda/OmaVM/internal/applog"
"github.com/KitsuneSemCalda/OmaVM/internal/backend/box"
"github.com/KitsuneSemCalda/OmaVM/internal/backend/box/container"
"github.com/KitsuneSemCalda/OmaVM/internal/backend/box/distrobox"
"github.com/KitsuneSemCalda/OmaVM/internal/backend/machine/qemu"
"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneSemCalda/OmaVM/internal/desktop"
"github.com/KitsuneForgering/OmaVM/internal/applog"
"github.com/KitsuneForgering/OmaVM/internal/backend/box"
"github.com/KitsuneForgering/OmaVM/internal/backend/box/container"
"github.com/KitsuneForgering/OmaVM/internal/backend/box/distrobox"
"github.com/KitsuneForgering/OmaVM/internal/backend/machine/qemu"
"github.com/KitsuneForgering/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/desktop"
)

func main() {
Expand Down Expand Up @@ -65,11 +66,33 @@ func notifyError(err error) {
_ = exec.Command(path, "--app-name=OmaVM", "--icon=dev.omavm.app", "OmaVM", err.Error()).Run()
}

// version is set at release time (make dist, the PKGBUILD) with
// -ldflags "-X main.version=x.y.z".
var version string

// versionString is version, or what the Go toolchain recorded (go install
// ...@vX.Y.Z), or "dev" for a plain local build.
func versionString() string {
if version != "" {
return version
}
if info, ok := debug.ReadBuildInfo(); ok && info.Main.Version != "" && info.Main.Version != "(devel)" {
return strings.TrimPrefix(info.Main.Version, "v")
}
return "dev"
}

func run(args []string) error {
if len(args) == 0 {
printUsage()
return usagef("no command given")
}
// Before any backend or store is set up: answers even on a host where
// those fail.
if args[0] == "version" || args[0] == "--version" {
fmt.Println("omavm", versionString())
return nil
}

qemuBackend, err := qemu.New()
if err != nil {
Expand Down Expand Up @@ -825,6 +848,7 @@ commands:
update NAME [--progress] update a Box's installed software (distrobox upgrade)
rm NAME remove an environment
list [--status] [--json] list known environments, with their state
version print this omavm's version

exit codes: 0 ok, 1 failure, 2 invalid request, 3 not found, 4 name taken,
5 unsupported here, 6 busy; exec and ssh return their command's code.
Expand Down
14 changes: 14 additions & 0 deletions cmd/omavm/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,17 @@ func captureStdout(t *testing.T, fn func() error) []byte {
}
return out
}

// A release build reports the version it was stamped with, and version
// answers before the store or a backend is set up.
func TestVersion(t *testing.T) {
t.Setenv("XDG_STATE_HOME", "/nonexistent/omavm-version-test")
saved := version
version = "1.2.3"
t.Cleanup(func() { version = saved })
for _, arg := range []string{"version", "--version"} {
if out := string(captureStdout(t, func() error { return run([]string{arg}) })); out != "omavm 1.2.3\n" {
t.Errorf("%s printed %q", arg, out)
}
}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/KitsuneSemCalda/OmaVM
module github.com/KitsuneForgering/OmaVM

go 1.27.1
20 changes: 20 additions & 0 deletions gui/tests/qml/tst_compile.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import QtQuick
import QtTest

// Compiles the top-level QML files no other test loads, without creating
// them: CI runs Qt 6.4, development runs Arch's Qt, and a construct only
// the newer one accepts (a variable named long) must fail here, not on a
// user's machine. The dialogs and cards are compiled by their own tests.
TestCase {
name: "Compile"

function test_compiles_data() {
return ["Main.qml", "Viewer.qml", "TerminalViewer.qml", "ThemeScrim.qml", "Icon.qml"]
.map(file => ({ tag: file, file: file }))
}

function test_compiles(data) {
const component = Qt.createComponent("qrc:/" + data.file)
compare(component.status, Component.Ready, component.errorString())
}
}
6 changes: 6 additions & 0 deletions gui/tests/qml_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#include <QUrl>
#include <QtQuickTest>

#include "../displayview.h"
#include "../terminalview.h"

// Stand-in for the C++ Backend context property: the properties the
// components read, and the actions they call recorded in lastCall (name
// followed by the arguments) instead of running the CLI.
Expand Down Expand Up @@ -148,6 +151,9 @@ public slots:
QQuickStyle::setStyle(QStringLiteral("Material"));
// Builds the accessibility tree a screen reader would see.
QAccessible::setActive(true);
// Registered as gui/main.cpp does, for the viewers tst_compile.qml loads.
qmlRegisterType<DisplayView>("OmaVM", 1, 0, "DisplayView");
qmlRegisterType<TerminalView>("OmaVM", 1, 0, "TerminalView");
}

void qmlEngineAvailable(QQmlEngine *engine) {
Expand Down
10 changes: 7 additions & 3 deletions gui/tests/qml_test.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
QT += core gui qml quick quickcontrols2 qmltest
CONFIG += console testcase c++17
QT += core gui qml quick quickcontrols2 qmltest opengl
CONFIG += console testcase c++17 link_pkgconfig
# The C++ types the viewers import (OmaVM 1.0), so tst_compile.qml checks
# every property they use.
PKGCONFIG += gio-2.0 gio-unix-2.0 egl
TEMPLATE = app
TARGET = qml_test
SOURCES += qml_test.cpp
SOURCES += qml_test.cpp ../displayview.cpp ../displayclient.cpp ../terminal.cpp ../terminalview.cpp ../colorstoml.cpp
HEADERS += ../displayview.h ../displayclient.h ../keymap.h ../terminal.h ../terminalview.h ../colorstoml.h
RESOURCES += ../resources.qrc
DEFINES += QUICK_TEST_SOURCE_DIR=\\\"$$PWD/qml\\\"
2 changes: 1 addition & 1 deletion internal/applog/applog.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"os"
"path/filepath"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

// SystemLogDir is the standard location Open prefers when writable.
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/box/box.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package box
import (
"context"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

type Backend struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/box/box_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"
"testing"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

type fakeBackend struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/box/container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"sync"
"time"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

// containerPrefix namespaces containers this engine manages so it never
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/box/container/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"path/filepath"
"testing"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

func TestNewFallsBackToDockerWhenPodmanIsUnhealthy(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/box/distrobox/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path/filepath"
"strings"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

// listAppsScript enumerates .desktop launchers installed at the container
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/box/distrobox/apps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"path/filepath"
"testing"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

func TestListAppsParsesOutputAndDetectsExported(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/box/distrobox/distrobox.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"strings"
"unicode"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

type Backend struct{}
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/box/distrobox/distrobox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"testing"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

func TestCreateUsesStableUniqueDistroboxName(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/box/distrobox/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strconv"
"strings"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

// pullImage downloads a new Box's image before `distrobox create`, which
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/box/distrobox/pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"testing"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

func TestPullStagesFollowLayersWithoutPercentages(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions internal/backend/box/distrobox/travel.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"strconv"
"strings"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneSemCalda/OmaVM/internal/power"
"github.com/KitsuneForgering/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/power"
)

// hostCPUs is overridable in tests.
Expand Down
4 changes: 2 additions & 2 deletions internal/backend/box/distrobox/travel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strings"
"testing"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneSemCalda/OmaVM/internal/power"
"github.com/KitsuneForgering/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/power"
)

// travelHost fakes a host with 8 CPUs, the given power state and a podman
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/box/distrobox/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"testing"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

func fakeDistroboxUpgrade(t *testing.T, script string) {
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/machine/qemu/applied.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"
"strings"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

// applied is what a running QEMU was started with, read back from its
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/machine/qemu/applied_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"path/filepath"
"testing"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

func TestParseApplied(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/machine/qemu/clone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"testing"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

func TestCloneCopiesTheDiskOfAStoppedMachine(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/machine/qemu/disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os/exec"
"testing"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

func virtualSize(t *testing.T, disk string) int64 {
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/machine/qemu/display_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"syscall"
"testing"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

// fakeQMP accepts one session, answers the handshake and records each
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/machine/qemu/ephemeral_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"testing"

"github.com/KitsuneSemCalda/OmaVM/internal/core"
"github.com/KitsuneForgering/OmaVM/internal/core"
)

func TestEphemeralStartDiscardsWritesNextToTheDisk(t *testing.T) {
Expand Down
Loading
Loading