LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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, 48 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: FreeBSD/Slackware-14.2+/ArcoLinux
Posts: 9,141

Rep: Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939
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: 9,150

Rep: Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982
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: MA, USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,051
Blog Entries: 13

Rep: Reputation: 3499Reputation: 3499Reputation: 3499Reputation: 3499Reputation: 3499Reputation: 3499Reputation: 3499Reputation: 3499Reputation: 3499Reputation: 3499Reputation: 3499
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: 12,501
Blog Entries: 9

Rep: Reputation: 3388Reputation: 3388Reputation: 3388Reputation: 3388Reputation: 3388Reputation: 3388Reputation: 3388Reputation: 3388Reputation: 3388Reputation: 3388Reputation: 3388
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
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,796

Rep: Reputation: 1278Reputation: 1278Reputation: 1278Reputation: 1278Reputation: 1278Reputation: 1278Reputation: 1278Reputation: 1278Reputation: 1278
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: 19,034

Rep: Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892
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: 19,034

Rep: Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892
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: 12,501
Blog Entries: 9

Rep: Reputation: 3388Reputation: 3388Reputation: 3388Reputation: 3388Reputation: 3388Reputation: 3388Reputation: 3388Reputation: 3388Reputation: 3388Reputation: 3388Reputation: 3388
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: Linux From Scratch, Slackware64, Partedmagic
Posts: 2,717

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
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,705

Rep: Reputation: 245Reputation: 245Reputation: 245
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


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 06:15 AM.

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