Programming :: BASH: Dialog Menu With Descriptions?
May 5, 2010
I am envisioning a dialog menu with 2 sections, the top 2/3 a menu, then the bottom 1/3 is a message box. When you highlight a menu item it gives you a description of what it does in the message box. However I am not sure it is possible. Can this be done in BASH?
I want to display an un-intrusive graphical dialog to notify the workstation user that a bash script has finished running. It should be "top level", so visible to the user when it appears but should not grab focus, so the user can continue working in the current window and dismiss the notification when convenient. Researching gdialog, xdialog, xmessage and zenity it seems none of them can do this; they all grab focus.
somewhere along the line I disabled the description that appears below icons in all gnome application menus. I don't know how I did it, and I cannot seem to find the way to undo it I would like full descriptions under the icons in my menus. I tried System -> Preferences -> Appearance but could not find what I was looking for. I also tried System -> Preferences -> File Management. Neither seems to help me out. This is not an urgent problem, but an annoying one.
I'm just messing around trying to create a script that will give me a menu driven method of selecting a file from a directory. After doing some searching around on the web, I found that the "dialog" command might be able to provide what I need, but I'm not sure exactly if what I want is possible.
I was messing around with the --menu option and am getting pretty close, but not exactly what I want. Here's a snip of what I've been working with:
Code:
This gets me the results I want for the first option in the list, but the rest comes out a bit weird, as it's taking the directory contents and applying to the "tag" field as well. In fact, if there wasn't a need for the tag field, it would probably be working exactly as I want it to.
I plan on messing around a bit more to see if there is a workaround, but figured I'd post this just in case someone else had accomplished something similar. Essentially, this will be embedded in a script where each file in my $DIR variable will show in the menu and the selected file will end up in a variable for later use.
I have a file called list.txt with on word on each line that changes in length. I'd like to make a menu, each line being its own choice. I pieced together most of it the only thing missing is a failsafe for typing a number out of range
Im wondering how to create a menu in c like bash's select. I imagine there is already something out but I don't know what it would be. Im a c newb but been scripting for a long time now and trying to pick up a little c.this would be what I am looking to display:
Code:
1) option 1 2) option 2 3) option 3
Make a selection:obviously 1,2,3 would be the only valid selection and anything else would say invalid or something like that.
Is it possible to create a text based menu layout in bash were it is possible to browse through. The menu list should look something like this:
---------------------------------------- user: root colour: blue number: 4 animal: dog ----------------------------------------
At the start the cursor should blink at the r from root so that text can be entered. When pressing the enter the cursor should go to the b from blue and so on. the imported thing is that all the text is visible also beyond the position from the cursor.
I was messing around with the opacity-brightness-saturation option in compiz and opcaity was set to 100%. Thus, everything that I click on is open, but invisible. I AM A GENIUS.
I would like to create a bash menu script for my home server For instance if i were to type ./script It would then bring up 3 options
a. Create a backup b. Restore files from a backup c. Quit
If you were to select a or b it should then ask you were you want to backup or restore from. And if i were to type in an incorrect letter i should get an error and take me back to menu. I have attepmted this a view time now and have magaged to get the menu up using parameters
I am attempting to put a SystemRecoveryCD ISO onto a USB drive by using a shell script that is bundled with the ISO file (usb_inst.sh). When I run this script, I am presenting with a dialog box with a blue background (see attachment) with two options: <OK> and <Cancel>. I am able to switch between the options by using the arrow keys and Tab, but if I try to select an option by pressing Enter, O, or C, a new terminal line appears (as in the attachment), preventing me from selecting anything in the dialog. I feel like I'm not doing something extremely obvious;
I am using Linux on my system. I don't have gui for my system, only console is there.
I have some task to create a menu box window using dialog in shell scripting.
I have to take input from user & save it in a file.
But this should like html form as e.g.
Name - ..................... email id - .................. phone - ...................... location - ...................
Submit Cancel
Such window should be displayed on console using dialog & then user will enter his information there as Name,email id, phone,etc & submit it, then it gets saved to a file. Here submit & cancle are buttons. I have to do it in bash shell scripting. Or give me some examples like the above with shell script code.
I tried Wubi, and all is fine, but when I choose Ubuntu on the boot menu, it shows some dialog, then just blank. its stays blank forever, so I had to shut the computer off.Then, I burned the Ubuntu iso to a CD and botted from it at startup. This at least showed the purpl-ish install screen. After I pressed enter over install, it went to the blank screen again. just black, nothing appeared.I'm not sure what the problem is. My laptop is fairly new, it shouldnt be having an issue to run it.I have 4Gb RAM, plenty of space on the hard drive, and a 1Gb video card...I have no clue what to do, as this is my first encounter with an Linux distro ever. help?
Is it possible to do the following in C/C++ in Linux:Without direct linking (my program should NOT depend on Qt or GTK), display a GTK or Qt based file dialog.The behaviour should be something like this when my program runs, when you want to open a file:The program scans whether you have Qt installed. If so, it somehow manages to link itself to Qt (e.g. dynamically loading the .so file) and display its file dialog and get the path from it. If Qt wasn't found, it tries the same with GTK. If that also wasn't found, it displays a less powerful replacement dialog instead (better than nothing).
Or is there any other simple way in Linux to get a standard file dialog somehow (similar to when compiling for Windows you can very easily get its standard file dialog, no matter what version of Windows, in your code, even if your program doesn't use any other Windows GUI at all).
Anyway, here is something that is puzzling me and cannot think up a good way around it: I call the constructor and show elements of LoginDialog in the constructor of my QMainWindow, like this:
LoginDialog is a QDialog and it does show up on application start... but... It is not active! The QMainWindow is the active window, even if I put lid->activateWindow();
So, the question is: how do I pop up this dialog on application start in such a way that it will show the LoginDialog on startup as active window?
I cannot seem to get if else statements to work. if $choice == Dog then i want it to say "you selected Dog" The variable choice has the value Dog in it as proved at the end by echo "yes $choice is $choice" following the error Code: ./test.sh: 37: [$choice: not found How do i get the conditional statement to work? What's wrong here? This is the full script:
I was wondering if anyone knew how to get long package descriptions which searching for packages with aptitude.my search results have package descriptions that are truncated even if the terminal is expanded to allow longer one-line package descriptions.
I have an Asus WL-500G Premium router with OpenWRT, with built in 4-port switch. There is one server connected to each switch port. Is it possible to give a description to every switch port in Asus WL-500G Premium? This description should survive reboot as well Is it possible?
I would like to know how do I print the line # in a script. My requirement is, I have a script which is about ~5000 lines long. If there are any errors happen I just exit. And I would like to add the line # of the script where the error happened.
Code: #!/bin/bash trap "echo 'you got me'" SIGINT SIGTERM # to trap ctrl+c echo "Press ctrl+c during 5 sec loop" for ((i=0;i<5;i++)); do
[Code]...
How come code behaves normally and stops when ctrl+c signal is caught and resumes, but after I use at least one timeout read in the code it looks like, if signal is caught again it doesn't pause the execution but skips the loop. If you remove -t (timeout) option from the read, both loops look the same!
Most of the time whenever I run dpkg -l I get cryptic output. For instance
[Code]...
Because I normally use it to see only one file (while multiple files are possible as well), was wondering if there was a way to tell dpkg to show couple of lines as output. I do see that there is a /etc/dpkg/dpkg.cfg file as well as /etc/dpkg/dpkg.cfg.d directory as well. Looking forward to info. on the same.
Now in my bash script, I want to get the output /home/user instead of $HOME once read. So far, I have managed to get the $HOME variable but I can't get it to echo the variable. All I get is the output $HOME.
I have written quite a few separate bash & scripts and php scripts that up to now I have run from cron jobs. However I have to estimate how long each takes to run, before running the next and so it probably takes much longer than necessary to run them all. They have to run in order.
Now there are so many I am thinking it would be better to have a master bash script that would run one after the other, but I am not sure how to get the master script to wait before starting to run the next script. Is this possible and is there a command that will make the script wait between bash and php scripts , for them to finish, before running the next?
I think it would be better to count the len and remove 3 chars to right to get the extension, but it can be macintosh filenames with have 4 chars for extensions.
Wrote a bash script that works fine when run in a terminal... Tried to make a shortcut from the application menu to it, but when I run it from there, I get "There was an error creating the child process for this terminal."
I've written a bash shell script (code provided below) that gives the user 4 options. However I'm having a little trouble with the code. Right now when they select option 3, to show the date.It loops over and over again.I have to close the terminal window to stop it because it's an infinite loop. How would I prevent this? Also quit doesn't seem to be working either.
#!/bin/bashe echo -n "Name please? " read name echo "Menu for $name[code]............
Im constructing a menu for a program using case. I have all my normal input options mapped out but i want to have a * ) option so that if something else is inputed, it displays "Incorrect input" and then resumes the normal menu function. How do I do this? Ideally, I'd like it to display "Incorrect Input" and then accept more input for the menu.