• Stars
    star
    635
  • Rank 70,214 (Top 2 %)
  • Language
    Shell
  • License
    BSD 3-Clause "New...
  • Created about 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple curses library made in bash to draw terminal interfaces

Bash Simple Curses

Documentation Status FOSSA Status

Bash Simple Curses gives you some basic functions to quickly create windows on your terminal.

An example is given: bashbar. Bashbar is a monitoring bar that you can integrate into tiling window managers.

The (unfinished) goal of Bash Simple Curses is to create windows. It is only intended to create colored windows and display information into. But, with a little tips, you can also make it interactive.

To use this library, you have to import simple_curses.sh into your bash script, like so:

#!/bin/bash

# import library, please check path
#source /usr/lib/simple_curses.sh
source /usr/local/lib/simple_curses.sh

# You must create a "main" function:
main () {
    # Your code here, here we add some windows and text
    window "title" "color"
    append "Text..."
    endwin
}

# Then, execute the loop every second ( -t 1 => 1s)
main_loop -t 1

That's all.

Example

#!/bin/bash
source simple_curses.sh

main(){
    # create a window
    window "Example" "blue" "50%"
        append "Hello world"
        addsep
        append "The date command"
        append_command "date"
    endwin

    # move on the next column
    col_right

    # and create another window
    window "Example 2" "red" "50%"
        append "Hello world"
        addsep
        append "The date command"
        append_command "date"
    endwin
}
main_loop

Simple example

Install

There are several possibilities to use the library. We recommend to copy simple_curses.sh inside your project and to "source" it.

But, if you want to make it available for the entire system, or for local user, you can use the make install command:

# install inside the system
# in /usr/local/lib
sudo make install

# for local user, no need to use sudo, but change the PREFIX
make install PREFIX=~/.local/lib

You can then uninstall the library file:

sudo make uninstall
make uninstall PREFIX=~/.loca/bin

License

FOSSA Status

More Repositories

1

keras-video-generators

Keras generators to generate sequences from videos as input
Jupyter Notebook
94
star
2

katenary

Convert docker-compose to a configurable helm chart
Go
77
star
3

idok

A simple command line to stream media to kodi (aka xbmc). Stream youtube, gstreamer output, livestreamer output, and many other media stream.
Go
62
star
4

docker-xmrig

Xmrig dockerized to mine monero cryptocurrency
Shell
54
star
5

kurento-go

Go package to communicate with Kurento
Go
25
star
6

vymad

Vymad - Vym to markdown generator
Go
23
star
7

Baboosh

Simple bash include to create pseudo object oriented scrip with Bash
Shell
20
star
8

python-libquvi

LibQuvi wrapper for python
Python
14
star
9

docker-auto-dnsmasq

Automatically add DNS entries in dnsmasq over NetworkManager for your Docker containers - compatible with systemd-resolved
Python
12
star
10

redis-ellison

Ellison, Master of sentinel for client that cannot use them
Go
12
star
11

docker-domains

Have docker containers responding to any domain name
Go
12
star
12

CameraCalib

Camera calibration tool
Python
10
star
13

docker-ng

Dockerized Angular 2+ (4, 5, 6, 7...) client, known as angular-cli and providing "ng" command
Dockerfile
9
star
14

docker-xvfb

A simple XVFB display server
Shell
9
star
15

pandoc-server

A WSGI service that allow you to create pdf from markdown
Python
7
star
16

kurento-go-generator

Generate Golang package to communicate with kurento media server
Go
6
star
17

go-slugify

A simple slugify function for Golang
Go
6
star
18

goswitch

Golang version switcher, local project creator, and recommended packages installation
Shell
5
star
19

cors-proxy

A simple proxy to add CORS for other service
Go
5
star
20

goreorder

Reorder methods, constructors and structs in Go files
Go
4
star
21

docker-confd

A simple and tiny confd docker image
Go
4
star
22

team-urgence

Team urgence - temporary install rocket-chat and meet jitsi
Shell
4
star
23

docker-glusterfs

GlusterFS in a Docker container
3
star
24

docker-snips

Snips with pulseaudio to make it running on Linux
Shell
3
star
25

tinybackup

Tiny backup scripts - full and incremental
Shell
2
star
26

cajada

Canvas Javascript Library
JavaScript
2
star
27

titanium-template

Titanium template system using webViews
JavaScript
2
star
28

xmonad-config

My Xmonad Configuration - xmobar - startup - etc... made for azerty keyboard
Vim Script
2
star
29

docker-pandoc-server

Dockerized pandocserver
2
star
30

docker-nginx-letsencrypt

Nginx container with certbot from let's encrypt service
2
star
31

wikipdfizer

Transform Wiki wyntax to PDF file
PHP
2
star
32

thatsall.js

ThatsAll.js - a tiny javascript library
JavaScript
2
star
33

angular-webinar

Angular overview
TypeScript
1
star
34

drone-plugin-rancher

Update Rancher app resource from Drone.io CI/CD tool
Python
1
star
35

docker-onlyoffice-documentserver

OnlyOffice Document server on Centos - usable on OpenShift
Shell
1
star
36

pantoc

Parse a table of content to build a splitted document in mardown. Nice tool for pandoc
Go
1
star
37

docker-angular-yeoman

Dockerized yeoman to use Angular
1
star
38

fedora-helm

Helm package for Fedora - standalone and LV2 plugin
1
star
39

rst-booker

RST Booker ease book creation from RestructuredText format via LaTeX
Python
1
star
40

knotter

knot module is a nodejs middleware to create websites
JavaScript
1
star
41

flask-hello

An example app template
Python
1
star
42

nginx-unprivileged

Unprivileged Nginx Docker for OpenShift or others PaaS
1
star
43

openshift-tutorial

Tutorial to use OpenShift
Go
1
star
44

rethinkmodel

Rethink:Model - use Python annotation to describe RethinkDB Models - ORM
Python
1
star