mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:47:37 +00:00
Taskbar: Open 'Assistant' with Super+Space
This commit is contained in:
parent
4f11138e8e
commit
cbe67ed665
1 changed files with 23 additions and 1 deletions
|
@ -329,7 +329,29 @@ void TaskbarWindow::wm_event(GUI::WMEvent& event)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GUI::Event::WM_SuperSpaceKeyPressed: {
|
case GUI::Event::WM_SuperSpaceKeyPressed: {
|
||||||
dbgln("super and space was pressed down");
|
auto af_path = String::formatted("{}/{}", Desktop::AppFile::APP_FILES_DIRECTORY, "Assistant.af");
|
||||||
|
auto af = Desktop::AppFile::open(af_path);
|
||||||
|
if (!af->is_valid()) {
|
||||||
|
warnln("invalid app file when trying to open Assistant");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
auto app_executable = af->executable();
|
||||||
|
|
||||||
|
pid_t pid = fork();
|
||||||
|
if (pid < 0) {
|
||||||
|
perror("fork");
|
||||||
|
} else if (pid == 0) {
|
||||||
|
if (chdir(Core::StandardPaths::home_directory().characters()) < 0) {
|
||||||
|
perror("chdir");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
execl(app_executable.characters(), app_executable.characters(), nullptr);
|
||||||
|
perror("execl");
|
||||||
|
VERIFY_NOT_REACHED();
|
||||||
|
} else {
|
||||||
|
if (disown(pid) < 0)
|
||||||
|
perror("disown");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue