An open API service indexing awesome lists of open source software.

https://github.com/aharabara/habarnam

Easy to use TUI framework based on ncurses.
https://github.com/aharabara/habarnam

framework ncurses php terminal tui xml

Last synced: 2 months ago
JSON representation

Easy to use TUI framework based on ncurses.

Awesome Lists containing this project

README

          

### :zap: Habarnam

>**Warning!** :warning:
>
> This package is in early development, so don't use it until you know your risks.

Framework/wrapper for `ext-ncurses` that will allows you to write simple CLI
applications using a little bit of XML and PHP.

Give a :star: if like it and write me if you don't and we will make it better.

Made with `habarnam`:
- [HTodo](https://github.com/aharabara/htodo)

Soon could be implemented:
- Chat (WIP)
- Redis or MySQL browser
- Reddit browser
- Ascii drawing tool

If you have some ideas, then create an issue and we will discuss it :metal:

Usage:
```bash
#go to you project directory and require it into your project
composer require aharabara/habarnam

# then install ext-ncurses with its patches, so it will work for php 7.*
# and add 'extension=ncurses.so' to your php.ini
./vendor/aharabara/habarnam/install.sh

touch ./index.php
mkdir ./src/
mkdir ./logs/
mkdir ./views/
mkdir ./assets/
touch ./views/surfaces.xml
touch ./views/main.xml
touch ./assets/styles.css
```

**index.php** content
```php
'; // will be used to create a folder inside ~/.config
$workspace = new Workspace("habarnam-{$projectName}");
$installer = new Installer($workspace);

$installer->checkCompatibility();

if (!$installer->isInstalled()) {
$installer->run();
}

/* folder with surfaces.xml and other view files */
$render = new ViewRender(__DIR__. '/views/');

(new Application($workspace, $render->prepare(), 'main'))
->debug(true)
->handle();
```

**surface.xml** content
```xml











```

**main.xml** content
```xml









  1. User








Send

```
#### Tips
- To navigate through components use `Tab` and `Shift + Tab` or keyboard arrows.
- Call `Application->debug(true)` and then press F1 and you will be able
to see components surfaces. Surface calculation is still glitchy, but you can use it.
- Press `F3` to toggle resize mode
- Press `F5` to refresh styles from css files. (:cool:)
- Press `Ctrl+X` to exit application. Be careful and save everything before doing it.
- more coming...