Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b480cfec3f | |||
| 58823cb24a | |||
| c63d1dc6ce |
@@ -1,25 +1,31 @@
|
|||||||
# Maintainer: Radu Macocian <radu@macocian.com>
|
# Maintainer: Radu Macocian <radu@macocian.com>
|
||||||
pkgname=omni-launcher
|
pkgname=omni-launcher
|
||||||
pkgver=0.0.2
|
pkgver=0.0.4
|
||||||
pkgrel=1
|
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')
|
arch=('any')
|
||||||
url="https://git.estatecloud.org/radumaco/omni-launcher"
|
url="https://git.estatecloud.org/radumaco/omni-launcher"
|
||||||
license=('GPL-3.0-or-later')
|
license=('GPL-3.0-or-later')
|
||||||
depends=('quickshell' 'qt6-declarative' 'wl-clipboard' 'curl' 'python' 'glib2')
|
depends=('quickshell' 'qt6-declarative' 'wl-clipboard' 'curl' 'python' 'glib2' 'inotify-tools')
|
||||||
optdepends=('hyprland: close-on-workspace-change and focus-grab integration')
|
optdepends=('hyprland: close-on-workspace-change and focus-grab integration')
|
||||||
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
|
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
|
||||||
sha256sums=('48922f27a6cf06c7d78313ddc52c92cf5b1b434f80bfe6e1f7d0f41f631bea98')
|
sha256sums=('9c87f6afa1a1f242709df435931d1cde61fcb22def6f0f59899fd7333c376ee0')
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cd "$srcdir/$pkgname"
|
cd "$srcdir/$pkgname"
|
||||||
|
|
||||||
install -dm755 "$pkgdir/usr/share/$pkgname"
|
# QML module — installed on the Qt6 import path so both the standalone
|
||||||
install -m644 qml/* "$pkgdir/usr/share/$pkgname/"
|
# 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/"
|
||||||
|
|
||||||
install -Dm755 bin/omni-launcher "$pkgdir/usr/bin/omni-launcher"
|
# Standalone entry point + launcher scripts.
|
||||||
install -Dm755 bin/omni-launcher-toggle "$pkgdir/usr/bin/omni-launcher-toggle"
|
install -dm755 "$pkgdir/usr/share/$pkgname"
|
||||||
|
install -m644 shell.qml "$pkgdir/usr/share/$pkgname/"
|
||||||
|
|
||||||
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
install -Dm755 bin/omni-launcher "$pkgdir/usr/bin/omni-launcher"
|
||||||
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
|
install -Dm755 bin/omni-launcher-toggle "$pkgdir/usr/bin/omni-launcher-toggle"
|
||||||
|
|
||||||
|
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||||
|
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ makepkg -si
|
|||||||
|
|
||||||
## Usage
|
## 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`):
|
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).
|
`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
|
## Configuration
|
||||||
|
|
||||||
`~/.config/omni-launcher/config.json` — any missing key falls back to a built-in default, so the file can be omitted entirely:
|
`~/.config/omni-launcher/config.json` — any missing key falls back to a built-in default, so the file can be omitted entirely:
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ QtObject {
|
|||||||
property string borderColor: ""
|
property string borderColor: ""
|
||||||
|
|
||||||
property bool loaded: false
|
property bool loaded: false
|
||||||
|
readonly property string configPath: (Quickshell.env("XDG_CONFIG_HOME") || (Quickshell.env("HOME") + "/.config")) + "/omni-launcher/config.json"
|
||||||
|
|
||||||
function _apply(obj) {
|
function _apply(obj) {
|
||||||
if (typeof obj.fontFamily === "string" && obj.fontFamily.length > 0) fontFamily = obj.fontFamily;
|
if (typeof obj.fontFamily === "string" && obj.fontFamily.length > 0) fontFamily = obj.fontFamily;
|
||||||
@@ -46,9 +47,43 @@ QtObject {
|
|||||||
if (typeof colors.border === "string" && colors.border.length > 0) borderColor = colors.border;
|
if (typeof colors.border === "string" && colors.border.length > 0) borderColor = colors.border;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
_load();
|
||||||
|
_startWatcher();
|
||||||
|
}
|
||||||
|
|
||||||
|
function _load() {
|
||||||
|
_loader.running = false;
|
||||||
|
_loader.command = ["cat", configPath];
|
||||||
|
_loader.running = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _startWatcher() {
|
||||||
|
_watcher.running = false;
|
||||||
|
_watcher.command = [
|
||||||
|
"sh", "-c",
|
||||||
|
"while inotifywait -q -e close_write " + JSON.stringify(configPath) + " 2>/dev/null; do echo CHANGED; done"
|
||||||
|
];
|
||||||
|
_watcher.running = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
property Process _watcher: Process {
|
||||||
|
running: false
|
||||||
|
stdout: SplitParser {
|
||||||
|
splitMarker: "\n"
|
||||||
|
onRead: line => {
|
||||||
|
if (line.indexOf("CHANGED") >= 0) {
|
||||||
|
console.log("omni-launcher: config changed, reloading");
|
||||||
|
root._load();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onExited: root._startWatcher()
|
||||||
|
}
|
||||||
|
|
||||||
property Process _loader: Process {
|
property Process _loader: Process {
|
||||||
running: true
|
running: false
|
||||||
command: ["sh", "-c", "cat \"${XDG_CONFIG_HOME:-$HOME/.config}/omni-launcher/config.json\" 2>/dev/null"]
|
|
||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
onStreamFinished: {
|
onStreamFinished: {
|
||||||
const text = (this.text || "").trim();
|
const text = (this.text || "").trim();
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
|
import OmniLauncher
|
||||||
|
|
||||||
ShellRoot {
|
ShellRoot {
|
||||||
IpcHandler {
|
IpcHandler {
|
||||||
Reference in New Issue
Block a user