From 0e403a43a474923f233d522da3f272588203e9af Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sat, 2 May 2020 21:28:26 +1200 Subject: 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. --- Applications/Terminal/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Applications/Terminal/main.cpp') diff --git a/Applications/Terminal/main.cpp b/Applications/Terminal/main.cpp index cfdb9d68f5..eb3b290a86 100644 --- a/Applications/Terminal/main.cpp +++ b/Applications/Terminal/main.cpp @@ -216,14 +216,18 @@ int main(int argc, char** argv) return 1; } - run_command(ptm_fd, command_to_execute); + RefPtr 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 config = Core::ConfigFile::get_for_app("Terminal"); auto& terminal = window->set_main_widget(ptm_fd, true, config); terminal.on_command_exit = [&] { app.quit(0); -- cgit v1.2.3