0 Usuarios y 1 Visitante están viendo este tema.
« anterior próximo »
Páginas: [1]
|
 |
|
Autor
|
Tema: Menu con shellscript (Leído 1176 veces)
|
|
Glifux
|
Hola amigos, me surgio una duda (si, otra vez :p) sobre shellscript y no encontre nada en google.
Viendo un archivo del GRUB (el startup manager de ubuntu) me di cuenta de que se trata de un script que se ejecuta al iniciar la compu. Lo que quiero saber es como hacer ese tipo de menu que ofrece GRUB (muestra las opciones y uno elige con las flechas la que desea y presiona enter) en vez del clasico menu 1.Archivar 2.Editar etc
En google solo encontre como hacer menus del segundo tipo, y me interesa saber como se haran los otros.
Desde ya gracias!
Salu2, Martin
|
|
|
|
|
En línea
|
|
|
|
|
snf
|
Grub es un boot manager, por lo tanto no usa las mismas librerias que un programa normal, pero si queres ese estilo tendrias que mirar la libreria (n)curses.
|
|
|
|
|
En línea
|
|
|
|
|
Glifux
|
No encuentro por ningun lado como usar librerias en shellscript, por ahi soy medio inutil para google o no es como creo :S me podrias dar una mano con esto?
Salu2, Martin
|
|
|
|
|
En línea
|
|
|
|
|
snf
|
Para poder usar ncurses en bash tenes que usar la aplicacion dialog, sino la tenes instalala, podes crear todos los controles, ventanas, etc.
seba@laptop-snf:~$ dialog cdialog (ComeOn Dialog!) version 1.1-20100428 Copyright 2000-2007,2008 Thomas E. Dickey This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* Display dialog boxes from shell scripts *
Usage: dialog <options> { --and-widget <options> } where options are "common" options, followed by "box" options
Special options: [--create-rc "file"] Common options: [--ascii-lines] [--aspect <ratio>] [--backtitle <backtitle>] [--begin <y> <x>] [--cancel-label <str>] [--clear] [--colors] [--column-separator <str>] [--cr-wrap] [--date-format <str>] [--default-item <str>] [--defaultno] [--exit-label <str>] [--extra-button] [--extra-label <str>] [--help-button] [--help-label <str>] [--help-status] [--ignore] [--input-fd <fd>] [--insecure] [--item-help] [--keep-tite] [--keep-window] [--max-input <n>] [--no-cancel] [--no-collapse] [--no-kill] [--no-label <str>] [--no-lines] [--no-ok] [--no-shadow] [--nook] [--ok-label <str>] [--output-fd <fd>] [--output-separator <str>] [--print-maxsize] [--print-size] [--print-version] [--quoted] [--scrollbar] [--separate-output] [--separate-widget <str>] [--shadow] [--single-quoted] [--size-err] [--sleep <secs>] [--stderr] [--stdout] [--tab-correct] [--tab-len <n>] [--time-format <str>] [--timeout <secs>] [--title <title>] [--trace <file>] [--trim] [--version] [--visit-items] [--yes-label <str>] Box options: --calendar <text> <height> <width> <day> <month> <year> --checklist <text> <height> <width> <list height> <tag1> <item1> <status1>... --dselect <directory> <height> <width> --editbox <file> <height> <width> --form <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1>... --fselect <filepath> <height> <width> --gauge <text> <height> <width> [<percent>] --infobox <text> <height> <width> --inputbox <text> <height> <width> [<init>] --inputmenu <text> <height> <width> <menu height> <tag1> <item1>... --menu <text> <height> <width> <menu height> <tag1> <item1>... --mixedform <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1> <itype>... --mixedgauge <text> <height> <width> <percent> <tag1> <item1>... --msgbox <text> <height> <width> --passwordbox <text> <height> <width> [<init>] --passwordform <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1>... --pause <text> <height> <width> <seconds> --progressbox <height> <width> --radiolist <text> <height> <width> <list height> <tag1> <item1> <status1>... --tailbox <file> <height> <width> --tailboxbg <file> <height> <width> --textbox <file> <height> <width> --timebox <text> <height> <width> <hour> <minute> <second> --yesno <text> <height> <width>
Auto-size with height and width = 0. Maximize with height and width = -1. Global-auto-size if also menu_height/list_height = 0.
|
|
|
|
|
En línea
|
|
|
|
|
Glifux
|
Genial! Muchas gracias de nuevo.. ando hasta las manos mal con la facu hasta el viernes, pero despues me pongo con esto a ver q puedo hacer  Salu2, Martin
|
|
|
|
|
En línea
|
|
|
|
|
 |