LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-07-2018, 08:24 AM   #16
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,049

Rep: Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895

I think the issue is how whiptail parses its command line options and posting the entire script would not add anything to the thread. While you can increase the size of the window to accommodate more text I don't know how to create a multi line option.

Code:
#!/bin/bash

line1="hello
world"

  res=$(whiptail --title "test menu" --menu "Chose option" 20 80 10 \
    "$line1" "$line1" \
    "Line 2" "Description \\n 2" \
    "Line 3" "Description 3" \
    3>&1 1>&2 2>&3)

echo "$res"
 
Old 10-07-2018, 09:13 AM   #17
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 2,724

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
yad is a gtk based program whiptail is dialog replacement using curses, the two are not compatable, yad needs a graphical environment dialog does not.
 
Old 10-07-2018, 09:23 AM   #18
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,706

Rep: Reputation: 245Reputation: 245Reputation: 245
Quote:
yad needs a graphical environment dialog does not
Check the pdf download in the original post - he's in a graphical environment
 
Old 10-07-2018, 09:31 AM   #19
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 2,724

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Quote:
Originally Posted by kilgoretrout View Post
Check the pdf download in the original post - he's in a graphical environment
YOU CHECK IT!
The OP is running in a terminal!
 
Old 10-07-2018, 09:59 AM   #20
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,049

Rep: Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895
There isn't enough information to know either way.

We see a virtual terminal window and a Ubuntu desktop.

The OP mentions raspi-config which is a raspbian configuration script and does run Ubuntu but I don't think it is installed on the Pi.

While the posted PDF in the original post is a Ubuntu desktop I can't tell if it is running on the Pi. In fact the OP could be using ssh to connect to the Pi from a Ubuntu computer.

dialog uses curses but whiptail uses newt.

Last edited by michaelk; 10-07-2018 at 10:10 AM.
 
Old 10-07-2018, 01:45 PM   #21
Jim232
Member
 
Registered: Apr 2018
Posts: 53

Original Poster
Rep: Reputation: Disabled
Sorry , I was asleep at the wheel - the success percentage is OPPOSITE! Very next post is in the 80% category! Why do people who have no intention to help waste their time editorializing ? NO you cannot see 5000 plus lines under construction code !

I did ask Cisco company to see if they can add "horizontal scroll " control.
The whiptail "control" has vertical scroll bar when needed.

I did posted a non working code ,an example of the usage. I had a hard time putting backslash n in as a text.

I just broke my OS and cannot try adding \\n on '\n' at this point.
 
Old 10-07-2018, 02:00 PM   #22
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,049

Rep: Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895
Whiptail the company that was bought out by Cisco has nothing to do with whiptail the program.

I have not been successful either and as stated is a limitation of the program.

https://pagure.io/newt/blob/master/f/AUTHORS

Last edited by michaelk; 10-07-2018 at 02:06 PM.
 
Old 10-07-2018, 04:17 PM   #23
Jim232
Member
 
Registered: Apr 2018
Posts: 53

Original Poster
Rep: Reputation: Disabled
I am not that good in bash and changing horses in the middle of the race does not help much.
But thanks for the suggestion.
 
Old 10-07-2018, 07:11 PM   #24
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,049

Rep: Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895
Are you trying to modify the existing raspi-config script or create a new script using its code as a model?

Why do you need two lines for the description? I have posted that you can enlarge the window.
 
Old 10-08-2018, 12:49 AM   #25
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 12,533
Blog Entries: 9

Rep: Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393
Quote:
Originally Posted by Jim232 View Post
Why do people who have no intention to help waste their time editorializing ?
i had intentions to help, and i wasn't editorializing, how should i know you misphrased it?

however, you succesfully changed my intentions with that comment.

i'm beginning to see the truth in this statement:
Quote:
Originally Posted by Jim232 View Post
I am having rough time "participating" in forums. Usually after few "responses" I either get banned for being too open or get sidetracked by editors.
 
1 members found this post helpful.
Old 10-08-2018, 09:37 AM   #26
Jim232
Member
 
Registered: Apr 2018
Posts: 53

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
Are you trying to modify the existing raspi-config script or create a new script using its code as a model?

YES I am making a new , debug type , script using its code as a model.

Why do you need two lines for the description? I have posted that you can enlarge the window.
From my (short) experience with whiptail - I call it "temperamental" mainly for unpredictable display which depends on overall dimensions.
As an example - setting numbers of vertical lines makes --menu option text disappear.

I was actually trying to figure out how to add "tooltip" or "F1" type of help access.

Yes, I do agree there are many ways "to skin a cat" and I was concentrating on common "scroll bar control" - in horizontal way. Changing overall "window" dimensions is doable indeed.

And reason for multi line - some of the "commands" I use - first parameter - are pretty long , hence I run out of displayable text in description parameter.
 
Old 10-08-2018, 10:47 AM   #27
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,049

Rep: Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895
Quote:
From my (short) experience with whiptail - I call it "temperamental" mainly for unpredictable display which depends on overall dimensions. As an example - setting numbers of vertical lines makes --menu option text disappear.
It also depends on the size of the virtual terminal window. whiptail is only a bash command which is defined by its options. The only way I see adding help access would be to add the option and use a msgbox.
 
Old 10-08-2018, 11:31 AM   #28
Jim232
Member
 
Registered: Apr 2018
Posts: 53

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
It also depends on the size of the virtual terminal window. whiptail is only a bash command which is defined by its options. The only way I see adding help access would be to add the option and use a msgbox.
I just checked "yad" and it is not available in Raspian. It would probably be overkill anyway. I need to keep focus on the script purpose - to make RPi debugging easier, not a fancy GUI.
I have another project running in parallel with this debugging script project and I am NOT is favour to change OS.


I could add msgbox before I run the menu command.
 
Old 10-08-2018, 05:00 PM   #29
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,706

Rep: Reputation: 245Reputation: 245Reputation: 245
Quote:
I just checked "yad" and it is not available in Raspian.
Don't know which version you are running, but I saw yad here:

https://archive.raspbian.org/raspbian/pool/main/y/yad/

which is why I suggested it. I get not wanting to delve into a whole new application to create dialog boxes but instead focus on the bash script itself. However, in my personal experience, after struggling with whiptail and other applications for creating bash dialog boxes, I found yad to be pretty easy to pick up and the most flexible of the bunch. It all depends on your use case and priorities which only you can judge.
 
Old 10-08-2018, 05:12 PM   #30
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,831

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Quote:
Originally Posted by Jim232 View Post
And reason for multi line - some of the "commands" I use - first parameter - are pretty long , hence I run out of displayable text in description parameter.
Could you shorten the first param?
Code:
"1" "Change password for the current user"
I guess I don't see why the repeated text...I'm tinkering, but haven't got it to work yet...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Whiptail “Command not Found” keyxmakerx Linux - Newbie 3 03-16-2016 10:49 AM
Help with bash/whiptail script capthookb Programming 12 01-06-2016 06:25 AM
bash: man: command not found Boleng Linux - Newbie 6 06-25-2008 02:44 AM
poor man alaios Linux - Laptop and Netbook 3 04-17-2004 10:11 AM
Can't get from command line interface to GUI dphildebrand Linux - Newbie 3 12-03-2003 01:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration