From 58823cb24aba461e6d9bfd8ae085753d60bbc791 Mon Sep 17 00:00:00 2001 From: Radu Macocian Date: Wed, 15 Jul 2026 15:25:33 +0200 Subject: [PATCH] Moved to module structure to work in embeded qs processes --- PKGBUILD | 12 ++++++--- README.md | 36 +++++++++++++++++++++++++ {qml => module}/Config.qml | 0 {qml => module}/HyprlandIntegration.qml | 0 {qml => module}/IconOrFallback.qml | 0 {qml => module}/Launcher.qml | 0 {qml => module}/LauncherService.qml | 0 {qml => module}/Theme.qml | 0 {qml => module}/UnitConverter.js | 0 {qml => module}/qmldir | 0 qml/shell.qml => shell.qml | 1 + 11 files changed, 46 insertions(+), 3 deletions(-) rename {qml => module}/Config.qml (100%) rename {qml => module}/HyprlandIntegration.qml (100%) rename {qml => module}/IconOrFallback.qml (100%) rename {qml => module}/Launcher.qml (100%) rename {qml => module}/LauncherService.qml (100%) rename {qml => module}/Theme.qml (100%) rename {qml => module}/UnitConverter.js (100%) rename {qml => module}/qmldir (100%) rename qml/shell.qml => shell.qml (93%) diff --git a/PKGBUILD b/PKGBUILD index 80f4524..812ef3c 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,8 +1,8 @@ # Maintainer: Radu Macocian pkgname=omni-launcher -pkgver=0.0.3 +pkgver=0.0.4 pkgrel=1 -pkgdesc="Application launcher overlay built on Quickshell, with calculator, unit/currency conversion, unicode search and Giphy search" +pkgdesc="Application launcher overlay built on Quickshell, with calculator, unit/currency conversion, unicode search and Giphy search. Installable as a Quickshell QML module (OmniLauncher) for embedded use or standalone via omni-launcher." arch=('any') url="https://git.estatecloud.org/radumaco/omni-launcher" license=('GPL-3.0-or-later') @@ -14,8 +14,14 @@ sha256sums=('48922f27a6cf06c7d78313ddc52c92cf5b1b434f80bfe6e1f7d0f41f631bea98') package() { cd "$srcdir/$pkgname" + # QML module — installed on the Qt6 import path so both the standalone + # shell.qml and any host quickshell config can `import OmniLauncher`. + install -dm755 "$pkgdir/usr/lib/qt6/qml/OmniLauncher" + install -m644 module/* "$pkgdir/usr/lib/qt6/qml/OmniLauncher/" + + # Standalone entry point + launcher scripts. install -dm755 "$pkgdir/usr/share/$pkgname" - install -m644 qml/* "$pkgdir/usr/share/$pkgname/" + install -m644 shell.qml "$pkgdir/usr/share/$pkgname/" install -Dm755 bin/omni-launcher "$pkgdir/usr/bin/omni-launcher" install -Dm755 bin/omni-launcher-toggle "$pkgdir/usr/bin/omni-launcher-toggle" diff --git a/README.md b/README.md index 922ffa9..31acbdd 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,10 @@ makepkg -si ## Usage +omni-launcher can run in two modes: **standalone** (its own quickshell process) or **embedded** (imported as a QML module inside an existing quickshell config, saving a process). + +### Standalone mode + Start the daemon once per session (e.g. in `~/.config/hypr/hyprland.conf`): ``` @@ -42,6 +46,38 @@ bind = SUPER, SPACE, exec, omni-launcher-toggle `omni-launcher-toggle` calls the running instance over Quickshell IPC. The launcher closes on `Esc`, click-outside, or workspace switch (Hyprland). +### Embedded mode + +Instead of running a separate quickshell process, you can import `OmniLauncher` directly inside your existing quickshell config. The module ships its own `Theme`, `Config`, and `LauncherService` singletons (module-scoped — they won't collide with your config's own singletons). + +1. Install `omni-launcher` from the AUR (this places the module on the Qt6 import path at `/usr/lib/qt6/qml/OmniLauncher/`). +2. In your `shell.qml`, import the module and instantiate `Launcher {}`: + +```qml +import Quickshell +import Quickshell.Io +import OmniLauncher + +ShellRoot { + IpcHandler { + target: "launcher" + function toggle(): void { LauncherService.toggle(); } + function open(): void { LauncherService.open(); } + function close(): void { LauncherService.close(); } + } + + Launcher {} +} +``` + +3. Bind a key to toggle it via your host config's IPC socket: + +``` +bind = SUPER, SPACE, exec, quickshell ipc call launcher toggle +``` + +Do **not** run `omni-launcher` (the daemon) in embedded mode — the host quickshell process already owns the launcher. + ## Configuration `~/.config/omni-launcher/config.json` — any missing key falls back to a built-in default, so the file can be omitted entirely: diff --git a/qml/Config.qml b/module/Config.qml similarity index 100% rename from qml/Config.qml rename to module/Config.qml diff --git a/qml/HyprlandIntegration.qml b/module/HyprlandIntegration.qml similarity index 100% rename from qml/HyprlandIntegration.qml rename to module/HyprlandIntegration.qml diff --git a/qml/IconOrFallback.qml b/module/IconOrFallback.qml similarity index 100% rename from qml/IconOrFallback.qml rename to module/IconOrFallback.qml diff --git a/qml/Launcher.qml b/module/Launcher.qml similarity index 100% rename from qml/Launcher.qml rename to module/Launcher.qml diff --git a/qml/LauncherService.qml b/module/LauncherService.qml similarity index 100% rename from qml/LauncherService.qml rename to module/LauncherService.qml diff --git a/qml/Theme.qml b/module/Theme.qml similarity index 100% rename from qml/Theme.qml rename to module/Theme.qml diff --git a/qml/UnitConverter.js b/module/UnitConverter.js similarity index 100% rename from qml/UnitConverter.js rename to module/UnitConverter.js diff --git a/qml/qmldir b/module/qmldir similarity index 100% rename from qml/qmldir rename to module/qmldir diff --git a/qml/shell.qml b/shell.qml similarity index 93% rename from qml/shell.qml rename to shell.qml index 24f3083..f0a50aa 100644 --- a/qml/shell.qml +++ b/shell.qml @@ -1,5 +1,6 @@ import Quickshell import Quickshell.Io +import OmniLauncher ShellRoot { IpcHandler {