Bamboost

TUI

Terminal user interface

Introduction

You can use the terminal user interface(TUI) to explore all your databases and its simulations.

Configuration

The TUI can be configured using the configuration file at ~/.config/bamboost/tui.toml.This is mainly to customize the keybindings.

The TUI has different views(pages).Currently, only the keybindings in the database view are customizable.You can view the keymaps in the TUI by pressing ?. Edit the [keybinds.database] table in the config file to your liking.The functions are named(also seeable in the TUI).You can simply assign a new key to a function.

Example configuration file
theme = "default" # or "highlight"
 
# Maximum column widths (default: 30)
[table]
no-cutoff-columns = [
"some column name",
...
]
 
# Keybindings
[keybinds]
custom_files = [
"/home/florez/.config/bamboost/functions.py",
]
 
[keybinds.database]
command = ":"
search = ","
jump = "/"
help = "?"
copy = "y"
open-paraview = "ctrl o"
open-xdmf-file = ["o", "x"]
open-output-file = ["o", "o"]
open-submission-file = ["o", "e"]
open-dir = ["o", "d"]
submit = [" ", "s"]
delete = "d"
note = ["o", "n"]
links = "L"
stdout = "ctrl t"
reload = "R"
page-down = "ctrl d"
page-up = "ctrl u"
next-search = "n"
 
# custom functions: table with key and function name
# the functions must take 2 arguments: size, key
plot = { key = "ctrl k", func = "show_plot" }
myjobs = { key = ["o", "m"], func = "show_job" }
cancel-job = { key = "C", func = "cancel_slurm_job" }
dummy = { key = ["m", "m"], func = "dummy_function" }

Custom functions

You can find a few example functions here for inspiration.

You can extend the application with your own custom functions.

  1. Include the file in which you define your function(s) in thecustom_files list of the [keybinds] table.
  2. Add a keymap in the table [keybinds.database] by giving your functionality a name and assigning to it a dictionary with an entry key and func, which needs to be the exact function name of a function defined in one of the custom files.
  3. The custom function must take two arguments: size & key.You can ignore these if you don't need them. size is the size of the widget on which the keypress is recorded. key is the key that was pressed.

To interact with the table itself, e.g.to get the simulation in focus, there is a minimal API available.

from bamboostcli import api
sim = api.get_entry_in_focus()
database_widget = api.Database()
database_widget.container.footer.set_text("new footer text")

On this page