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:
Shannon Booth 2020-05-02 21:28:26 +12:00 committed by Andreas Kling
parent 548ecceb75
commit 0e403a43a4
Notes: sideshowbarker 2024-07-19 07:02:48 +09:00
2 changed files with 8 additions and 2 deletions

View file

@ -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);

View file

@ -1,3 +1,5 @@
[Startup]
Command=
[Window]
Opacity=255
AudibleBeep=0