diff --git a/app-carousel/AppConfig.qml b/app-carousel/AppConfig.qml index 08c0b3a..8802e92 100644 --- a/app-carousel/AppConfig.qml +++ b/app-carousel/AppConfig.qml @@ -8,6 +8,7 @@ Item { readonly property string appConfigPath: Quickshell.env("SKYG_APP_CAROUSEL") property list appConfig: [] property bool enableCacheFolder: false + property bool backgroundMode: false FileView { id: configFile @@ -48,7 +49,9 @@ Item { } isBoolean('autoStart', parsed.autoStart, true) isBoolean('enableCacheFolder', parsed.enableCacheFolder, true) + isBoolean('backgroundMode', parsed.backgroundMode, true) root.enableCacheFolder = !!parsed.enableCacheFolder + root.backgroundMode = !!parsed.backgroundMode for (const elm of apps) { isString('name', elm.name) isString('image', elm.image) diff --git a/app-carousel/LauncherWindow.qml b/app-carousel/LauncherWindow.qml index 6d0431e..fafcf6c 100644 --- a/app-carousel/LauncherWindow.qml +++ b/app-carousel/LauncherWindow.qml @@ -8,18 +8,19 @@ PanelWindow { id: root required property bool shellOpen + required property bool backgroundMode required property list apps required property bool enableCacheFolder signal requestClose - visible: root.shellOpen + visible: root.backgroundMode || root.shellOpen color: "transparent" + exclusionMode: ExclusionMode.Ignore WlrLayershell.namespace: "quickshell:launcher" - WlrLayershell.layer: WlrLayer.Overlay - WlrLayershell.exclusiveZone: -1 + WlrLayershell.layer: root.backgroundMode ? WlrLayer.Bottom : WlrLayer.Overlay WlrLayershell.keyboardFocus: root.visible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None anchors { @@ -53,7 +54,8 @@ PanelWindow { function activateSelection() { const app = root.apps[root.selectedIndex]; if (!app) { - root.requestClose(); + if (!root.backgroundMode) + root.requestClose(); return; } if (app.hyprlandDispatch) { @@ -63,7 +65,8 @@ PanelWindow { launcher.command = app.exec; launcher.running = true; } - root.requestClose(); + if (!root.backgroundMode) + root.requestClose(); } Process { @@ -86,9 +89,9 @@ PanelWindow { HyprlandFocusGrab { windows: [root] - active: root.visible + active: root.visible && !root.backgroundMode onCleared: { - if (root.visible) + if (root.visible && !root.backgroundMode) root.requestClose(); } } @@ -99,7 +102,10 @@ PanelWindow { MouseArea { anchors.fill: parent - onClicked: root.requestClose() + onClicked: { + if (!root.backgroundMode) + root.requestClose() + } } } @@ -121,7 +127,8 @@ PanelWindow { root.activateSelection(); break; case Qt.Key_Escape: - root.requestClose(); + if (!root.backgroundMode) + root.requestClose(); break; default: return; diff --git a/app-carousel/shell.qml b/app-carousel/shell.qml index 95573da..e7c90e8 100644 --- a/app-carousel/shell.qml +++ b/app-carousel/shell.qml @@ -1,6 +1,7 @@ import Quickshell import QtQuick import Quickshell.Io +import Quickshell.Hyprland ShellRoot { id: shell @@ -8,23 +9,38 @@ ShellRoot { property bool launcherOpen: true property AppConfig config: AppConfig {} + function goToEmptyWorkspace(): void { + Hyprland.dispatch("workspace empty"); + } + IpcHandler { target: "launcher" function toggle(): void { - shell.launcherOpen = !shell.launcherOpen; + if (shell.config.backgroundMode) + shell.goToEmptyWorkspace(); + else + shell.launcherOpen = !shell.launcherOpen; } function open(): void { - shell.launcherOpen = true; + if (shell.config.backgroundMode) + shell.goToEmptyWorkspace(); + else + shell.launcherOpen = true; } function close(): void { - shell.launcherOpen = false; + if (!shell.config.backgroundMode) + shell.launcherOpen = false; } } LauncherWindow { shellOpen: shell.launcherOpen - onRequestClose: shell.launcherOpen = false + backgroundMode: shell.config.backgroundMode + onRequestClose: { + if (!shell.config.backgroundMode) + shell.launcherOpen = false + } apps: shell.config.appConfig enableCacheFolder: shell.config.enableCacheFolder } diff --git a/example.json b/example.json index d23e369..43b4108 100644 --- a/example.json +++ b/example.json @@ -1,6 +1,7 @@ { "autoStart": true, - "enableCacheFolder": true, + "enableCacheFolder": false, + "backgroundMode": true, "apps": [ { "name": "Chromium",