Add Dialogs And Menus To Shell Scripts With Whiptail

  Рет қаралды 21,410

DistroTube

DistroTube

Күн бұрын

Пікірлер: 32
@driden1987
@driden1987 Жыл бұрын
Wow thought this was going to be about gum, thanks for sharing DT
@muddyexport5639
@muddyexport5639 Жыл бұрын
Food For Thought: Your spaces variable could be developed for each menu function taking the known screen length of 78 - scroll bar length including the hidden display attributes, and calculate the longest key variable length for each menu function selection list. Then, the known screen length - longest key length = the spaces variable for that menu selection function. Doing the spaces variable for each individual menu item would insure a uniform menu box. And as the menu choices expand or contract the value of spaces will not have to be jockeyed manually. I always try to leave code with the goal to not to have to rework for the changing, evolving work environment. Bullet Proof == always the goal though not always achieved. Again, just a thought (that may never be read ;~) .
@kev2020-z9s
@kev2020-z9s Жыл бұрын
Thank you I know what I will be play with for the next week or so keep up the good work.
@RAndrewNeal
@RAndrewNeal Жыл бұрын
For every package installation page, you could get the length of the longest string to be displayed, and subtract that from the total width you want them to occupy, and pad that many spaces, instead of padding a constant number. It'll be much cleaner and more visually consistent that way.
@miko007
@miko007 Жыл бұрын
its actually not really weird, that you have to switch stdout and stderr around, for dialog, you also have to do this. if you have user input, whiptail has no way to report it back, as it needs stdout to draw the actual dialog. it so chooses the stderr file descriptor to put the user input somewhere. the you go ahead and switch stdout and stderr after whiptail is done running, so you now have the user input in stdout and can further process it.
@anon_y_mousse
@anon_y_mousse Жыл бұрын
It's like the universe is pushing me to make my own distro, or at the very least to do LFS.
@minma02262
@minma02262 6 ай бұрын
I learned newt in university 10 plus years ago. I like it.
@darthcabs
@darthcabs Жыл бұрын
Awesome content!
@sumirandahal76
@sumirandahal76 Жыл бұрын
Just wanted to watch DT's videos, and got this in the feed. Thank you sir !!
@5HT2A292
@5HT2A292 Жыл бұрын
Hey DT, can you please make a video where you just say "sauerbraten" for 10 mins?
@jyvben1520
@jyvben1520 Жыл бұрын
you could make a youtube short, it repeats automatically, till you close it ...
@quarteratom
@quarteratom Жыл бұрын
Can you interact with these TUI dialogs with the mouse?
@Winnetou17
@Winnetou17 Жыл бұрын
Hey DT! Why don't you use printf for ensuring the right amount of spaces ? That for is actually ridiculous! In both the terminal and in C, you have printf. In terminal you would use this as printf "%78s " "text guaranteed to ocupy 78 characters, left padded" With 78 being the minimum width, s denoting that it's a string (and the default padding is a space for strings, a zero for numbers). This way (usually the norm with numbers) the padding is added to the left of the variable outputted, (aka right aligned) and that is kind of useless in your example. For that you have to add a minus to the width specifier, like this: printf "%-78s " "text left aligned but still 78 characters wide" Check the GNU documentation (you can check C documentation of the function too, but there's minor subtle differences between the C function and the shell program)
@007arek
@007arek Жыл бұрын
Maybe someone has a good recommendation for a library or binding for lua? I'd like to make such a script but I don't like bash. I've found IUP but IDK if it is a good solution.
@quarteratom
@quarteratom Жыл бұрын
BTW don't check and install programs this way. If the program is in path, but not installed with the package manager you use, the package manager will install it again. Either skip installing the programs you already marked as installed, or query the package manager whether they are installed, instead of looking for the executable in PATH.
@noferblatz
@noferblatz Жыл бұрын
If you use zenity instead, you don't need to be in a terminal for this to work. It runs natively in X Window, but its API is much like dialog and the rest.
@DistroTube
@DistroTube Жыл бұрын
This script needs to be able to run in a tty. After all, it is mainly an Arch Linux post-installation script.
@navarrodba
@navarrodba Жыл бұрын
oh.. this is really cool!!!
@linuxrant
@linuxrant Жыл бұрын
Hmm, that's pretty cool... I was looking for something like this and couldn't find nothing that would be relatively easy to make. Then Brodie made a video about Smenu, but then I realized I could just simply learn to make a python script using curses or urwid module... then you show this whiptail...and I get choice paralysis :) I think I'm gonna check everything one by one and get my hands a little dirty :)
@tylerdean980
@tylerdean980 Жыл бұрын
Even easier is bash simple curses, DT has a vid on that too
@jackelofnar
@jackelofnar Жыл бұрын
Isn't gum a better option for this than Whiptail?
@masterdoyen
@masterdoyen Жыл бұрын
You should make it so if the package is installed already, grey out the package and put (installed) after the name of the package
@squalazzo
@squalazzo Жыл бұрын
if i remember correctly, you can put 0 0 0 as numbers and get autosize
@HelmutFischer-thehefi
@HelmutFischer-thehefi Жыл бұрын
I think "Cancel" should cancel, so a third choice "Next" or "Skip" would be better for continuing on the next selection. Just my 2 cents.
@lonehayena
@lonehayena Жыл бұрын
When are you going to review SerenityOS?
@theodorealenas3171
@theodorealenas3171 Жыл бұрын
That's nuts! I've made fuzzy finding scripts that use fzf in the terminal, or dmenu if there's no terminal there (GUI key bindings) Btw I haven't watched the video, let me unpause the video and watch
@helgi2925
@helgi2925 Жыл бұрын
No Midori browser in the list? So bad :D
@-someone-.
@-someone-. Жыл бұрын
I love your vids. Would you do a showcase on the new Kali purple? It’s built specifically for a “defensive” setup, rather than the traditional offensive. 🙏👍
@stes1647
@stes1647 Жыл бұрын
Whiptill?
@anonytuser711
@anonytuser711 Жыл бұрын
Hey @DistroTube - @eBuzzCentral Troy reviewed a 2 year old release of InstantOS beta here: kzbin.info/www/bejne/n2SliqmfhqiEnZo even though the new beta came out 2 weeks ago. He didn't use rofi and used a mouse instead of keybindings in his "review". I would love to hear your take on this.
Xargs Should Be In Your Command Line Toolbag
16:24
DistroTube
Рет қаралды 101 М.
Do you love Blackpink?🖤🩷
00:23
Karina
Рет қаралды 23 МЛН
Муж внезапно вернулся домой @Oscar_elteacher
00:43
История одного вокалиста
Рет қаралды 7 МЛН
7 Apps Better Than The Defaults Your Distro Ships
12:43
DistroTube
Рет қаралды 106 М.
Write Your Own Bash Scripts for Automation [Tutorial]
16:35
Null Byte
Рет қаралды 774 М.
Transform Your Scripts With Bash Simple Curses
16:15
DistroTube
Рет қаралды 111 М.
12 GREAT command line programs YOU recommended!
16:25
The Linux Experiment
Рет қаралды 295 М.
Become a shell wizard in ~12 mins
12:25
CODE IS EVERYTHING
Рет қаралды 260 М.
Vim Tips And Tricks Some Of My Favorite Vim Commands
17:05
DistroTube
Рет қаралды 69 М.
Layin' down Pipes like a Unix Chad
10:55
Luke Smith
Рет қаралды 97 М.
Building Video Games For The Linux Terminal
18:09
RobertElderSoftware
Рет қаралды 19 М.
BASH scripting will change your life
14:18
NetworkChuck
Рет қаралды 1 МЛН