mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Merge pull request #1508 from Jasdeep-Dhillon/command-toggle
ipc: Implement shell command toggle
This commit is contained in:
@@ -158,6 +158,26 @@ Item {
|
||||
}
|
||||
});
|
||||
}
|
||||
function command() {
|
||||
root.screenDetector.withCurrentScreen(screen => {
|
||||
var launcherPanel = PanelService.getPanel("launcherPanel", screen);
|
||||
if (!launcherPanel)
|
||||
return;
|
||||
var searchText = launcherPanel.searchText || "";
|
||||
var isInClipMode = searchText.startsWith(">cmd");
|
||||
if (!launcherPanel.isPanelOpen) {
|
||||
// Closed -> open in clipboard mode
|
||||
launcherPanel.open();
|
||||
launcherPanel.setSearchText(">cmd ");
|
||||
} else if (isInClipMode) {
|
||||
// Already in clipboard mode -> close
|
||||
launcherPanel.close();
|
||||
} else {
|
||||
// In another mode -> switch to clipboard mode
|
||||
launcherPanel.setSearchText(">cmd ");
|
||||
}
|
||||
});
|
||||
}
|
||||
function emoji() {
|
||||
root.screenDetector.withCurrentScreen(screen => {
|
||||
var launcherPanel = PanelService.getPanel("launcherPanel", screen);
|
||||
|
||||
Reference in New Issue
Block a user