1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 13:32:50 -05:00

ipc: Add openWithQuery and toggleWithQuery to spotlight

This commit is contained in:
bbedward
2025-10-14 23:56:43 -04:00
parent d1383b5d1b
commit 54ef14e765
2 changed files with 44 additions and 0 deletions

View File

@@ -26,6 +26,26 @@ DankModal {
})
}
function showWithQuery(query) {
if (spotlightContent) {
if (spotlightContent.appLauncher) {
spotlightContent.appLauncher.searchQuery = query
}
if (spotlightContent.searchField) {
spotlightContent.searchField.text = query
}
}
spotlightOpen = true
open()
Qt.callLater(() => {
if (spotlightContent && spotlightContent.searchField) {
spotlightContent.searchField.forceActiveFocus()
}
})
}
function hide() {
spotlightOpen = false
close()
@@ -106,6 +126,20 @@ DankModal {
return "SPOTLIGHT_TOGGLE_SUCCESS"
}
function openQuery(query: string): string {
spotlightModal.showWithQuery(query)
return "SPOTLIGHT_OPEN_QUERY_SUCCESS"
}
function toggleQuery(query: string): string {
if (spotlightModal.spotlightOpen) {
spotlightModal.hide()
} else {
spotlightModal.showWithQuery(query)
}
return "SPOTLIGHT_TOGGLE_QUERY_SUCCESS"
}
target: "spotlight"
}

View File

@@ -418,6 +418,12 @@ Application launcher modal control.
- `open` - Show the spotlight launcher
- `close` - Hide the spotlight launcher
- `toggle` - Toggle spotlight launcher visibility
- `openQuery <query>` - Show the spotlight launcher with pre-filled search query
- Parameters: `query` - Search text to pre-fill in the search box
- Returns: Success confirmation
- `toggleQuery <query>` - Toggle spotlight launcher with pre-filled search query
- Parameters: `query` - Search text to pre-fill in the search box (only used when opening)
- Returns: Success confirmation
### Target: `clipboard`
Clipboard history modal control.
@@ -510,6 +516,10 @@ File browser controls for selecting wallpapers and profile images.
# Open application launcher
dms ipc call spotlight toggle
# Open spotlight with pre-filled search
dms ipc call spotlight openQuery browser
dms ipc call spotlight toggleQuery "!"
# Show clipboard history
dms ipc call clipboard open