diff --git a/bin/omacast b/bin/omacast index f6ab97e..5979342 100755 --- a/bin/omacast +++ b/bin/omacast @@ -260,6 +260,9 @@ cmd_setup_hyprland() { -- Alt+Space reaches the plugin's global shortcut directly, so no process -- starts per keypress. Omarchy's own menu stays on Super+Space. o.bind("ALT + SPACE", "omacast launcher", hl.dsp.global("omacast:toggle")) +-- Blur behind the launcher; it only shows under Omarchy's Glassy windows, +-- where the card is see-through. +hl.layer_rule({ match = { namespace = "^omacast$" }, blur = true, ignore_alpha = 0.3 }) LUA echo "wrote $file" fi diff --git a/ui/LauncherWindow.qml b/ui/LauncherWindow.qml index 618a8ad..ae1d65b 100644 --- a/ui/LauncherWindow.qml +++ b/ui/LauncherWindow.qml @@ -1,5 +1,6 @@ import QtQuick import Quickshell +import Quickshell.Io import Quickshell.Wayland import qs.Commons import qs.Commons as Commons @@ -58,6 +59,24 @@ PanelWindow { }) readonly property var borderSpec: Border.surfaceSpec("menu", "border", Commons.Color.menu.border, Math.max(1, Style.space(2))) + // Omarchy's Glassy windows (`omarchy hyprland window transparency glassy`): + // the card turns see-through and Hyprland blurs what is behind it, through + // the blur rule on the omacast layer in omacast.lua. Panels drawn over the + // card stay solid. Checked on every show, so switching modes needs no restart. + property bool glassy: false + readonly property color cardBackground: window.glassy + ? Qt.rgba(window.look.background.r, window.look.background.g, window.look.background.b, Math.min(window.look.background.a, 0.65)) + : window.look.background + FileView { + id: glassToggle + path: (Quickshell.env("XDG_STATE_HOME") || Quickshell.env("HOME") + "/.local/state") + "/omarchy/toggles/hypr/window-glassy.lua" + // A few bytes on local disk: read in place so the first frame already has the right card. + blockLoading: true + printErrors: false + onLoaded: window.glassy = true + onLoadFailed: window.glassy = false + } + property var stack: [{ kind: "root", title: "omacast", query: "" }] readonly property var view: window.stack[window.stack.length - 1] property string query: "" @@ -131,6 +150,7 @@ PanelWindow { } onShownChanged: { + if (window.shown) glassToggle.reload() if (window.shown) return window.searchSerial++ window.backend.cancelSearch() @@ -667,7 +687,7 @@ PanelWindow { radius: Math.max(Style.cornerRadius, window.px(8)) anchors.horizontalCenter: parent.horizontalCenter y: Math.max(Style.gapsOut, Math.min(Math.round(window.height / 4), window.height - window.fullHeight - Style.gapsOut)) - color: window.look.background + color: window.cardBackground borderSpec: window.borderSpec clip: true