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:
@@ -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() {
|
function hide() {
|
||||||
spotlightOpen = false
|
spotlightOpen = false
|
||||||
close()
|
close()
|
||||||
@@ -106,6 +126,20 @@ DankModal {
|
|||||||
return "SPOTLIGHT_TOGGLE_SUCCESS"
|
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"
|
target: "spotlight"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
docs/IPC.md
10
docs/IPC.md
@@ -418,6 +418,12 @@ Application launcher modal control.
|
|||||||
- `open` - Show the spotlight launcher
|
- `open` - Show the spotlight launcher
|
||||||
- `close` - Hide the spotlight launcher
|
- `close` - Hide the spotlight launcher
|
||||||
- `toggle` - Toggle spotlight launcher visibility
|
- `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`
|
### Target: `clipboard`
|
||||||
Clipboard history modal control.
|
Clipboard history modal control.
|
||||||
@@ -510,6 +516,10 @@ File browser controls for selecting wallpapers and profile images.
|
|||||||
# Open application launcher
|
# Open application launcher
|
||||||
dms ipc call spotlight toggle
|
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
|
# Show clipboard history
|
||||||
dms ipc call clipboard open
|
dms ipc call clipboard open
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user