Language selection tool

New features which should be implemented in Porteus; suggestions are welcome. All questions or problems with testing releases (alpha, beta, or rc) should go in their relevant thread here, rather than the Bug Reports section.

Re: Language selection tool

Postby brokenman » 13 Dec 2016, 16:37

But I know of no trick for any bash script to be able to read $COLUMNS

Code: Select all
#!/bin/bash

columns=$(tput cols)
echo "Columns: " $columns
How do i become super user?
Wear your underpants on the outside and put on a cape.
brokenman
Site Admin
Site Admin
 
Posts: 5343
Joined: 27 Dec 2010, 04:50
Location: Brazil
Distribution: Porteus v3.2rcX all desktops

Re: Language selection tool

Postby Rava » 22 Dec 2016, 20:55

tput, yes, I tend to forget about tput...

Also, this might be helpful as well:
Code: Select all
shopt -s checkwinsize

https://www.gnu.org/software/bash/manua ... iltin.html
checkwinsize

If set, Bash checks the window size after each command and, if necessary, updates the values of LINES and COLUMNS.



And then we have this:
Code: Select all
stty size
:D

Useful code: http://pastebin.com/uu9MaVbX
(I just read over it but I have not tested every line)
Cheers!
Yours Rava
User avatar
Rava
Contributor
Contributor
 
Posts: 1269
Joined: 11 Jan 2011, 03:46
Location: Germany
Distribution: Porteus 3.1.0 x86-64 XFCe

Previous

Return to Development



Who is online

Users browsing this forum: Bing [Bot] and 1 guest