bg mode
This commit is contained in:
1 parent
70a6437c7f
commit
ed75fa0db9
4 files changed
+41
-14
No files matched your search
@@ -8,6 +8,7 @@ Item {
|
|||||||
readonly property string appConfigPath: Quickshell.env("SKYG_APP_CAROUSEL")
|
readonly property string appConfigPath: Quickshell.env("SKYG_APP_CAROUSEL")
|
||||||
property list<var> appConfig: []
|
property list<var> appConfig: []
|
||||||
property bool enableCacheFolder: false
|
property bool enableCacheFolder: false
|
||||||
|
property bool backgroundMode: false
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
id: configFile
|
id: configFile
|
||||||
@@ -48,7 +49,9 @@ Item {
|
|||||||
}
|
}
|
||||||
isBoolean('autoStart', parsed.autoStart, true)
|
isBoolean('autoStart', parsed.autoStart, true)
|
||||||
isBoolean('enableCacheFolder', parsed.enableCacheFolder, true)
|
isBoolean('enableCacheFolder', parsed.enableCacheFolder, true)
|
||||||
|
isBoolean('backgroundMode', parsed.backgroundMode, true)
|
||||||
root.enableCacheFolder = !!parsed.enableCacheFolder
|
root.enableCacheFolder = !!parsed.enableCacheFolder
|
||||||
|
root.backgroundMode = !!parsed.backgroundMode
|
||||||
for (const elm of apps) {
|
for (const elm of apps) {
|
||||||
isString('name', elm.name)
|
isString('name', elm.name)
|
||||||
isString('image', elm.image)
|
isString('image', elm.image)
|
||||||
|
|||||||
@@ -8,18 +8,19 @@ PanelWindow {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property bool shellOpen
|
required property bool shellOpen
|
||||||
|
required property bool backgroundMode
|
||||||
required property list<var> apps
|
required property list<var> apps
|
||||||
required property bool enableCacheFolder
|
required property bool enableCacheFolder
|
||||||
|
|
||||||
signal requestClose
|
signal requestClose
|
||||||
|
|
||||||
visible: root.shellOpen
|
visible: root.backgroundMode || root.shellOpen
|
||||||
|
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
|
exclusionMode: ExclusionMode.Ignore
|
||||||
WlrLayershell.namespace: "quickshell:launcher"
|
WlrLayershell.namespace: "quickshell:launcher"
|
||||||
WlrLayershell.layer: WlrLayer.Overlay
|
WlrLayershell.layer: root.backgroundMode ? WlrLayer.Bottom : WlrLayer.Overlay
|
||||||
WlrLayershell.exclusiveZone: -1
|
|
||||||
WlrLayershell.keyboardFocus: root.visible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus: root.visible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
@@ -53,7 +54,8 @@ PanelWindow {
|
|||||||
function activateSelection() {
|
function activateSelection() {
|
||||||
const app = root.apps[root.selectedIndex];
|
const app = root.apps[root.selectedIndex];
|
||||||
if (!app) {
|
if (!app) {
|
||||||
root.requestClose();
|
if (!root.backgroundMode)
|
||||||
|
root.requestClose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (app.hyprlandDispatch) {
|
if (app.hyprlandDispatch) {
|
||||||
@@ -63,7 +65,8 @@ PanelWindow {
|
|||||||
launcher.command = app.exec;
|
launcher.command = app.exec;
|
||||||
launcher.running = true;
|
launcher.running = true;
|
||||||
}
|
}
|
||||||
root.requestClose();
|
if (!root.backgroundMode)
|
||||||
|
root.requestClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
@@ -86,9 +89,9 @@ PanelWindow {
|
|||||||
|
|
||||||
HyprlandFocusGrab {
|
HyprlandFocusGrab {
|
||||||
windows: [root]
|
windows: [root]
|
||||||
active: root.visible
|
active: root.visible && !root.backgroundMode
|
||||||
onCleared: {
|
onCleared: {
|
||||||
if (root.visible)
|
if (root.visible && !root.backgroundMode)
|
||||||
root.requestClose();
|
root.requestClose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,7 +102,10 @@ PanelWindow {
|
|||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: root.requestClose()
|
onClicked: {
|
||||||
|
if (!root.backgroundMode)
|
||||||
|
root.requestClose()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +127,8 @@ PanelWindow {
|
|||||||
root.activateSelection();
|
root.activateSelection();
|
||||||
break;
|
break;
|
||||||
case Qt.Key_Escape:
|
case Qt.Key_Escape:
|
||||||
root.requestClose();
|
if (!root.backgroundMode)
|
||||||
|
root.requestClose();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
|
|||||||
+20
-4
@@ -1,6 +1,7 @@
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
|
import Quickshell.Hyprland
|
||||||
|
|
||||||
ShellRoot {
|
ShellRoot {
|
||||||
id: shell
|
id: shell
|
||||||
@@ -8,23 +9,38 @@ ShellRoot {
|
|||||||
property bool launcherOpen: true
|
property bool launcherOpen: true
|
||||||
property AppConfig config: AppConfig {}
|
property AppConfig config: AppConfig {}
|
||||||
|
|
||||||
|
function goToEmptyWorkspace(): void {
|
||||||
|
Hyprland.dispatch("workspace empty");
|
||||||
|
}
|
||||||
|
|
||||||
IpcHandler {
|
IpcHandler {
|
||||||
target: "launcher"
|
target: "launcher"
|
||||||
|
|
||||||
function toggle(): void {
|
function toggle(): void {
|
||||||
shell.launcherOpen = !shell.launcherOpen;
|
if (shell.config.backgroundMode)
|
||||||
|
shell.goToEmptyWorkspace();
|
||||||
|
else
|
||||||
|
shell.launcherOpen = !shell.launcherOpen;
|
||||||
}
|
}
|
||||||
function open(): void {
|
function open(): void {
|
||||||
shell.launcherOpen = true;
|
if (shell.config.backgroundMode)
|
||||||
|
shell.goToEmptyWorkspace();
|
||||||
|
else
|
||||||
|
shell.launcherOpen = true;
|
||||||
}
|
}
|
||||||
function close(): void {
|
function close(): void {
|
||||||
shell.launcherOpen = false;
|
if (!shell.config.backgroundMode)
|
||||||
|
shell.launcherOpen = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LauncherWindow {
|
LauncherWindow {
|
||||||
shellOpen: shell.launcherOpen
|
shellOpen: shell.launcherOpen
|
||||||
onRequestClose: shell.launcherOpen = false
|
backgroundMode: shell.config.backgroundMode
|
||||||
|
onRequestClose: {
|
||||||
|
if (!shell.config.backgroundMode)
|
||||||
|
shell.launcherOpen = false
|
||||||
|
}
|
||||||
apps: shell.config.appConfig
|
apps: shell.config.appConfig
|
||||||
enableCacheFolder: shell.config.enableCacheFolder
|
enableCacheFolder: shell.config.enableCacheFolder
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"autoStart": true,
|
"autoStart": true,
|
||||||
"enableCacheFolder": true,
|
"enableCacheFolder": false,
|
||||||
|
"backgroundMode": true,
|
||||||
"apps": [
|
"apps": [
|
||||||
{
|
{
|
||||||
"name": "Chromium",
|
"name": "Chromium",
|
||||||
|
|||||||
Reference in new issue
Block a user