Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/keithdhedger/cursesdialogs

Some simple utility dialogs using CursesToolKit
https://github.com/keithdhedger/cursesdialogs

cli cpp curses cursestoolkit dialog linux utility

Last synced: about 2 months ago
JSON representation

Some simple utility dialogs using CursesToolKit

Awesome Lists containing this project

README

        

Convenience wrappers for Curses toolkit library.

Select a file:

ctkopenfile

Usage: ctkopenfile [OPTION]

-w, --window-name Window Name

-s, --start-folder Start Folder

-v, --version Version

-h, -?, --help Help



Example:

To get the results of the dialog into a bash varable Use:

{ result=$(ctkopenfile -w MyWindow -s /etc 2>&1 >&3 3>&-); } 3>&1

echo $result

![Alt text](screenshots/openfile.png?raw=true "ctkopenfile")

Select a folder:

ctkopenfolder

Usage: ctkopenfolder [OPTION]

-w, --window-name Window Name

-s, --start-folder Start Folder

-v, --version Version

-h, -?, --help Help



Example:

To get the results of the dialog into a bash varable Use:

{ result=$(ctkopenfolder -w MyWindow -s /etc 2>&1 >&3 3>&-); } 3>&1

echo $result

![Alt text](screenshots/openfolder.png?raw=true "ctkopenfolder")

Save a file:

ctksavefile

Usage: ctksavefile [OPTION]

-w, --window-name Window Name

-s, --start-folder Start Folder

-n, --default-name Default file name

-v, --version Version

-h, -?, --help Help



Example:

To get the results of the dialog into a bash varable Use:

{ result=$(ctksavefile -w MyWindow -s /etc -n SaveFileName 2>&1 >&3 3>&-); } 3>&1

echo $result

![Alt text](screenshots/savefile.png?raw=true "ctksavefile")

Get input:

ctkinput

Usage: ctkinput [OPTION]

-w, --window-name Window Name

-b, --body Body text

-t, --title Dialog title

-i, --input Default input

-c, --cancel Show cancel

-v, --version Version

-h, -?, --help Help



Example:

To get the results of the dialog into a bash varable Use:

{ result=$(ctkinput -w MyWindow -b 'Say somthing?' -t 'Input ...' -i 'Some input ...' -c 2>&1 >&3 3>&-); } 3>&1

echo $result

The return code from the app also reflects the button seelected like so:

ctkinput -w MyWindow -b 'Say somthing?' -t 'Input ...' -i 'Some input ...' -c 2>/dev/null;echo "Button pressed $?"

![Alt text](screenshots/input.png?raw=true "ctkinput")

Simple query:

ctkquery

Usage: ctkquery [OPTION]

-w, --window-name Window Name

-q, --query Query text

-t, --title Dialog title

-b, --buttons Buttons

-v, --version Version

-h, -?, --help Help



Example:

The return code from the app reflects the button selected like so:

ctkquery -w MyWindow -q 'Do What?' -t 'Question?' -b 7 2>/dev/null;echo "Button pressed $?"

![Alt text](screenshots/query.png?raw=true "ctkquery")




BUGS etc.

[email protected]




Please donate
If you have a PayPal account you can donate any amount you like by logging into your account and click the 'Send Money' tab, enter my email address and then send it
Thank you for helping to support Free software.