Skip to content

Commit

Permalink
Terminal: Add config for startup command
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shannonbooth authored and awesomekling committed May 2, 2020
1 parent 548ecce commit 0e403a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Applications/Terminal/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions Base/home/anon/Terminal.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[Startup]
Command=
[Window]
Opacity=255
AudibleBeep=0

0 comments on commit 0e403a4

Please sign in to comment.