All Projects → pedro-hs → checkbox.sh

pedro-hs / checkbox.sh

Licence: MIT License
Interactive checkboxes (menu) with pagination and vim keybinds for bash

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to checkbox.sh

Bootstrap Table
An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation, Vue.js)
Stars: ✭ 11,068 (+42469.23%)
Mutual labels:  pagination, checkbox
Bashmultitool
A library for bash shell program containing useful functions. Can be imported into scripts to create colourful and functional scripts and TUIs.
Stars: ✭ 27 (+3.85%)
Mutual labels:  tui, bash-script
sysz
An fzf terminal UI for systemctl
Stars: ✭ 1,258 (+4738.46%)
Mutual labels:  tui, bash-script
Vue Table Dynamic
🎉 A dynamic table with sorting, filtering, editing, pagination, multiple select, etc.
Stars: ✭ 106 (+307.69%)
Mutual labels:  pagination, checkbox
cylon-deb
TUI menu driven bash shell script to update and maintain a Debian based Linux distro.
Stars: ✭ 23 (-11.54%)
Mutual labels:  tui, bash-script
pagi
A better WordPress pagination.
Stars: ✭ 30 (+15.38%)
Mutual labels:  pagination
HackerRank-LinuxShell
HackerRank-LinuxShell Solutions 💻
Stars: ✭ 26 (+0%)
Mutual labels:  bash-script
TUI
Terminal user interface library. Works on *NIX and Windows systems
Stars: ✭ 32 (+23.08%)
Mutual labels:  tui
Pageable
An easy way to Pagination or Infinite scrolling for TableView/CollectionView
Stars: ✭ 44 (+69.23%)
Mutual labels:  pagination
BashClass
BashClass is an Object Oriented Programming language that compiles to BASH 4.4
Stars: ✭ 40 (+53.85%)
Mutual labels:  bash-script
Examples Gtkmm
Shows how to use Gtkmm controls by programming code (c++17).
Stars: ✭ 23 (-11.54%)
Mutual labels:  checkbox
uni-z-paging
【uni-app自动分页器】超简单!仅需两步轻松完成完整分页逻辑(下拉刷新、上拉加载更多),分页全自动处理。支持自定义加载更多的文字或整个view,自定义下拉刷新样式,自动管理空数据view等。
Stars: ✭ 91 (+250%)
Mutual labels:  pagination
pagination
No description or website provided.
Stars: ✭ 14 (-46.15%)
Mutual labels:  pagination
gorm-cursor-paginator
A paginator doing cursor-based pagination based on GORM
Stars: ✭ 92 (+253.85%)
Mutual labels:  pagination
azure-cdn-ips
List of Azure CDN IP Addresses
Stars: ✭ 14 (-46.15%)
Mutual labels:  bash-script
YouPlot
A command line tool that draw plots on the terminal.
Stars: ✭ 412 (+1484.62%)
Mutual labels:  tui
loopback-paginator
No description or website provided.
Stars: ✭ 13 (-50%)
Mutual labels:  pagination
circumflex
🌿 It's Hacker News in your terminal
Stars: ✭ 43 (+65.38%)
Mutual labels:  tui
dotfiles
Config files for i3, polybar, rofi, mpv, Xresources, kitty and some bash-things...
Stars: ✭ 52 (+100%)
Mutual labels:  bash-script
CCheckbox-iOS
CCheckbox is a custom UIView which represents custom checkbox component with custom images
Stars: ✭ 28 (+7.69%)
Mutual labels:  checkbox

⌨️ checkbox.sh

Bash GitHub license

Interactive checkboxes (menu) with pagination and vim keybinds for bash



Table of Contents



Features

  • Select only a option or multiple options
  • Select or unselect multiple options easily
  • Select all or unselect all
  • Pagination
  • Optional Vim keybinds
  • A .sh file with approximately 500 lines
  • Start with options selected
  • Show selected options counter for multiple options
  • Show custom message
  • Show current option index and options amount
  • Copy current option value to clipboard
  • Help tab when press h or wrongly call the script

Quick Start

Run the script (in bash shell) with source checkbox.sh


Promotion

If you like this software, give a star

📖 Contributions are welcome 📖


Arguments Usage

Checkbox options

Use the argument --options=""


You can add new options:

  • With the character |
  • With new line
  • Mixed


To start with options selected, put + before the option text (in first character)

  • If the argument --multiple is missing, just the first option marked with + will start selected


Any of this ASCII signs \a \b \f \n \r \t in any part of options will be removed.


If --options"" is missing. Sample options will be loaded with 30 options.



Show message on header

Use the argument --message=""

You can customize message

  • Using ANSI
    Example: --message="\033[2K\033[31mhello world"

  • Using ASCII \a \b \e \f \n \r \t \v
    Example: --message="hello\rworld"

  • Maybe the layout breaks, in this case, try to refresh (press r)



Select multiple options

Use the argument --multiple



Return index instead of values

Use the argument --index



How to use with another script

You can get the script response in the variable $checkbox_output after execute the script

  • Example:
#!/usr/bin/env bash
source checkbox.sh --multiple --index
clear
selected_options="$checkbox_output"
echo "$selected_options"


Keybinds Usage

Move arround

Press [UP ARROW] or 'k' to move cursor to option above

Press [UP DOWN] or 'j' to move cursor to option below

Press [PAGE UP] or 'd' to move cursor 5 options above

Press [PAGE DOWN] or 'u' to move cursor 5 options below

Press [HOME] or 'g' to move cursor to first option

Press [END] or 'G' to move cursor to last option



Select current option

Press [SPACE] or x


Close and return selected options

Press [ENTER] or 'o'


Copy current option

Press 'c' or 'y'


Select or Unselect All (only with --multiple)

Press 'a' to select all and 'A' to unselect all


Select or Unselect Mode (only with --multiple)

Press 'v' to turn on/off select mode 'V' to turn on/off unselect mode

  • If select mode is on. Cursor will be green and when you move up or down the options will be selected

  • If unselect mode is on. Cursor will be red and when you move up or down the options will be unselected



Refresh

Press 'r' to refresh renderization



Help

Press 'h' or call script with invalid argument, and a help page will appear



Limitations

  • Doesn't have a good compatibility with mac, I will work on this in future
  • Uses bash array, so bash or similars are needed to run this script
  • Terminal must have at least 8 lines for the script works. Maybe breaks in some cases with --message too. Resize terminal and press 'r'
  • Don't have unit test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].