LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-04-2018, 12:15 PM   #1
Jim232
Member
 
Registered: Apr 2018
Posts: 53

Rep: Reputation: Disabled
whiptail bash command poor man GUI interface


I do not know how the title got to "bash" and cannot cnange / edit it

I there a way to modify whiptail menu display to show second parameter on two ( at least) lines?
In attached file the second menu parameter "falls off" and is not visble.
Attached Files
File Type: pdf Menu.pdf (147.1 KB, 76 views)

Last edited by Jim232; 10-04-2018 at 12:25 PM.
 
Old 10-04-2018, 12:34 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
it is probably a root owned file, try using sudo nano, or your favorite terminal text editor using sudo to do so. I do not see any bash, just the path to its location.
 
Old 10-04-2018, 01:45 PM   #3
Jim232
Member
 
Registered: Apr 2018
Posts: 53

Original Poster
Rep: Reputation: Disabled
I am using this command in bash script already "running in " sudo nano editor. The "menu" output layout is pretty temperamental and as fas as I can tell there is no provision to "roll the text of the second parameter over" to new new line.
 
Old 10-04-2018, 01:50 PM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
There should be a "Thread Tools" option that will allow you to edit the title.
 
Old 10-05-2018, 10:53 AM   #5
Jim232
Member
 
Registered: Apr 2018
Posts: 53

Original Poster
Rep: Reputation: Disabled
Update
I can option the display width to partially show both parameters - the display gets centered ( ?) in window .
The obvious solution then is to have "horizontal scroll ".
My best "solution" is to ask owner of whiptail to add such feature or somehow hack it in.

PS "Thread tools" do not have an option to edit title.

Last edited by Jim232; 10-05-2018 at 10:55 AM.
 
Old 10-05-2018, 12:01 PM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
I believe if you edit your first post, and change the title, this controls the thread title.

Either case, what title would you prefer? I can change it for you.
 
Old 10-06-2018, 06:19 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Jim232, i am sorry that apparently nobody knows how to answer your question.
neither do I, unfortunately.
maybe you could explain what whiptail actually is, how you are using it and where it fails (code, not narrative)?
whiptail is not in the software repositories of my distro.
 
1 members found this post helpful.
Old 10-06-2018, 02:07 PM   #8
Jim232
Member
 
Registered: Apr 2018
Posts: 53

Original Poster
Rep: Reputation: Disabled
whiptail bash command poor man GUI interface

I am not sure how to respond.
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.
Not surprised about lack of responses. By rough estimate only about 80% of my posts actually help me to resolve an issue.
So - take a look at "raspi-config" , but not sure if you can actually get it without loading Raspi flavour of Linux.
"whiptail" is a bash command , sort of poor man GUI used to poorly navigate Raspberry Pi configuration / setting.
I am not knowledgeable how "copyrighted " this configuration file is, and I really do not care. I am building my own using bash script.
You can of course ask Mrs Google about "whiptail bash Linux", if you are interested.
Cheers
 
Old 10-06-2018, 02:36 PM   #9
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,725

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by Jim232 View Post
I am using this command in bash script already "running in " sudo nano editor. The "menu" output layout is pretty temperamental and as fas as I can tell there is no provision to "roll the text of the second parameter over" to new new line.
I'm guessing that this is the meat of your question, yes?
Try imbedding a newline in the text:
Code:
"line one\nline 2"
 
Old 10-06-2018, 03:33 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,680

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Whiptail is a replacement for dialog and similar to zenity. A way to create dialog boxes in bash.

Can you post your script or at least the whiptail command the creates the dialog box?

Last edited by michaelk; 10-06-2018 at 09:08 PM.
 
Old 10-06-2018, 07:08 PM   #11
Jim232
Member
 
Registered: Apr 2018
Posts: 53

Original Poster
Rep: Reputation: Disabled
That is part of the "problem" - each menu item has two parameters in sequence, separated by "standard" Linux " extended line \ ". There cannot be anything "between" the parameters.

Yes, I did added "\n" to the parameter itself and it did not have desired effect.

Here is an example , part of it, of the initial whiptail test (non working) menu:

TEST=$(whiptail \
--title "DEBUG Raspberry Pi Software Configuration Tool (raspi-config)" \
--backtitle "Current work in progress file $0 " \
--menu "Setup Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT \
--default-item "10 DEBUG Enable debug " \
--cancel-button Finish --ok-button Select \
"${TESTarray[@]}" \
"$menuFull" "$menuFull" \
"1 Change User Password" "Change password for the current user" \
"2 Network Options" "Configure network settings" \
"3 Boot Options" "Configure options for start-up" \

I would like to add more text to the parameters and still be able to display it.

Last edited by Jim232; 10-06-2018 at 07:10 PM.
 
Old 10-06-2018, 09:47 PM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,680

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
I tried the usual ways of embedding a line feed but nothing worked and would guess it is probably a limitation of whiptail.

By the way the first "parameter" is the tag and the second is a description. The tag is the return value which is assigned to TEST variable in your script.
 
Old 10-07-2018, 02:44 AM   #13
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Jim232 View Post
By rough estimate only about 80% of my posts actually help me to resolve an issue.
that would be an incredibly high succes rate.
congratulations!

Quote:
Originally Posted by Jim232 View Post
That is part of the "problem" - each menu item has two parameters in sequence, separated by "standard" Linux " extended line \ ". There cannot be anything "between" the parameters.

Yes, I did added "\n" to the parameter itself and it did not have desired effect.
i do not see any "\n" in your example.

it's also possible that the TEST="$(whipatil ......)" construct expands the \n to an actual newline; have you tried adding \\n or \\\n instead, or maybe '\n' (single quotes)?
 
1 members found this post helpful.
Old 10-07-2018, 07:49 AM   #14
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Please use code tags and post your complete script.
 
Old 10-07-2018, 08:23 AM   #15
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,986

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Instead of using whiptail for your bash dialog boxes, I would try using yad instead:

https://www.thelinuxrain.com/article...buttons-of-yad

https://smokey01.com/yad/

Yad is actively maintained and more flexible than whiptail.
 
  


Reply



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
Help with bash/whiptail script capthookb Programming 15 10-14-2021 12:39 PM
Whiptail “Command not Found” keyxmakerx Linux - Newbie 3 03-16-2016 10:49 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 05:30 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
Open Source Consulting | Domain Registration