Termkit is a lightweight and versatile C++ library for managing terminals. It provides functionalities such as text coloring, text centering, window title manipulation, getch functionality, and more. This library aims to simplify terminal interactions and enhance the user experience when working with console applications.
- Text Coloring: Easily add color to your terminal output with simple function calls.
- Text Center: Align your text to the center for a cleaner display.
- Window Title Manipulation: Change the title of the terminal window dynamically.
- getch Functionality: Capture single keypresses without the need for pressing Enter.
To use Termkit in your project, follow these steps:
-
Add Termkit as a submodule to your project:
git submodule add https://github.com/dev-du-bled/termkit.git libs/termkit
-
Initialize and update the submodule:
git submodule update --init --recursive
-
Include Termkit code
#include "libs/termkit/termkit.cpp"
-
You're done! You can now use Termkit in your project !
std::cout<<termkit::rgb_fg("Hello World", 142,34,34)<<std::endl;
std::cout<<termkit::center_line("This line is centered")<<std::endl;
termkit::set_term_title("My cool Termkit powered app");
std::cout<<"Is Termkit cool ? (y/n)"<<std::endl;
if ( getch() == 'y' ) {
std::cout<<"Please consider starring the repo on github ;)"<<std::endl
}
This library is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Feel free to contribute to the development of Termkit by opening issues or pull requests on the GitHub repository.
Happy coding!