mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
Taskbar: Open 'Assistant' with Super+Space
This commit is contained in:
parent
4f11138e8e
commit
cbe67ed665
Notes:
sideshowbarker
2024-07-18 11:24:44 +09:00
Author: https://github.com/SpencerCDixon Commit: https://github.com/SerenityOS/serenity/commit/cbe67ed6658 Pull-request: https://github.com/SerenityOS/serenity/pull/8266 Reviewed-by: https://github.com/Mandar12 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/linusg
1 changed files with 23 additions and 1 deletions
|
@ -329,7 +329,29 @@ void TaskbarWindow::wm_event(GUI::WMEvent& event)
|
|||
break;
|
||||
}
|
||||
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;
|
||||
}
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue