mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 02:03:06 -05:00
Terminal: Add config for startup command
This is useful when working on a program as you can put the command into the config file, instead of having to type it up each time on boot.
This commit is contained in:
parent
548ecceb75
commit
0e403a43a4
Notes:
sideshowbarker
2024-07-19 07:02:48 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/0e403a43a47 Pull-request: https://github.com/SerenityOS/serenity/pull/2058
2 changed files with 8 additions and 2 deletions
|
@ -216,14 +216,18 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
run_command(ptm_fd, command_to_execute);
|
||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::get_for_app("Terminal");
|
||||
|
||||
if (command_to_execute)
|
||||
run_command(ptm_fd, command_to_execute);
|
||||
else
|
||||
run_command(ptm_fd, config->read_entry("Startup", "Command"));
|
||||
|
||||
auto window = GUI::Window::construct();
|
||||
window->set_title("Terminal");
|
||||
window->set_background_color(Color::Black);
|
||||
window->set_double_buffering_enabled(false);
|
||||
|
||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::get_for_app("Terminal");
|
||||
auto& terminal = window->set_main_widget<TerminalWidget>(ptm_fd, true, config);
|
||||
terminal.on_command_exit = [&] {
|
||||
app.quit(0);
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
[Startup]
|
||||
Command=
|
||||
[Window]
|
||||
Opacity=255
|
||||
AudibleBeep=0
|
||||
|
|
Loading…
Add table
Reference in a new issue