1 Commits

Author SHA1 Message Date
amacocian c63d1dc6ce Theme quick reload (#1)
Tag and publish to AUR / tag (push) Successful in 14s
Tag and publish to AUR / publish (push) Successful in 48s
Co-authored-by: Alexandru Macocian <amacocian@yahoo.com>
Reviewed-on: #1
2026-06-09 13:00:54 +00:00
2 changed files with 46 additions and 11 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
# 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.3
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"
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=('48922f27a6cf06c7d78313ddc52c92cf5b1b434f80bfe6e1f7d0f41f631bea98')
+37 -2
View File
@@ -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();