Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
07-08-2014, 05:10 AM
|
#1
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,408
Rep: 
|
How-to compute the font size to get a given terminal size with fbterm?
I have installed fbterm and need to use in a shell script the output of the command "fbterm -v", which gives information about display settings.
Unfortunately, redirection of the output to a file like one of these commands:
Code:
fbterm -v > output.txt
fbterm -v 2>&1 | tee output.txt
doesn't work (output.txt is empty), probably linked to the fact that running fbterm (mandatorily from an interactive tty) opens a /dev/pts/something as you can see here
Code:
4477 tty2 Ss 0:00 -bash
5262 tty2 S+ 0:00 \_ fbterm -v
5263 pts/5 Ss+ 0:00 \_ /bin/bash
I also tried to run script before issuing the command, but then the output of "fbterm -v" is just
Code:
stdin isn't a interactive tty!
for a similar reason:
Code:
5331 tty2 Ss 0:00 -bash
5345 tty2 S+ 0:00 \_ script
5346 tty2 S+ 0:00 \_ script
5347 pts/5 Ss+ 0:00 \_ bash -i
I also thought about taking a "picture" of the screen after running "fbterm -v" but do not know an utility to do that (the ones I know work only under X).
Any help appreciated.
PS The initial title of this thread was :
How-to store the output of "fbterm -v"?
I have modified it to highlight the aim, as previous title was actually a way to reach it, and eventually another way will be used.
Last edited by Didier Spaier; 07-11-2014 at 03:37 PM.
|
|
|
07-08-2014, 05:46 AM
|
#2
|
Member
Registered: Sep 2012
Distribution: Slackware
Posts: 194
Rep: 
|
Maybe you could start screen or tmux first, then use their built-in copy mode to copy the info you need, then paste it into a text editor.
For the screenshot idea, I have used fbgrab in the past, but all the links to it seem dead now.
There is also fbshot http://www.sfires.net/fbshot/ which looks like it is from 2002... 
|
|
1 members found this post helpful.
|
07-08-2014, 06:44 AM
|
#3
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,408
Original Poster
Rep: 
|
@Loomx: thanks for the clue. Unfortunately, I can't use screen, because typing "Ctr+a h" would need an user input and all have to be done by a non interactive script.
Also, running fbterm inside screen also fails (running fbterm inside screen would be kind of running a terminal inside a terminal :-)
fbshot can take screenshots from a Linux frame buffer, but I need to get the output even when no frame buffer is used (i.e. with the "nomodeset" kernel parameter in the command line). Considering the name, I assume that the same applies to fbgrab.
Last edited by Didier Spaier; 07-08-2014 at 06:51 AM.
|
|
|
07-08-2014, 08:32 AM
|
#4
|
LQ 5k Club
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,311
Rep: 
|
Have you tried this?
Quote:
copy/paste selected text between windows with mouse when gpm server is running
|
From:
https://code.google.com/p/fbterm/
Never used fbterm, so might be a dumb question. 
Last edited by brianL; 07-08-2014 at 08:34 AM.
|
|
|
07-08-2014, 08:38 AM
|
#5
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,408
Original Poster
Rep: 
|
Quote:
Originally Posted by brianL
|
Not a dumb question, but this requires an interaction with the user (using a mouse), that is not acceptable in this case.
PS To clarify: this has to occur using Slint installer just before user is suggested to choose another keymap if need be (as in Slackware genuine installer). In the installers in http://slint.fr/testing we use fbterm but a test case has been found (using some specific hardware) where the "guess" of the display resolution set by fbterm fails, leading to a too big font size. To avoid that situation we need to know the resolution it actually sets, as reported by fbterm -v, then kill fbterm and re-launch it with the good font size set by the script (however that seems a bit convoluted, I admit. I'm open to simpler solutions that could be suggested :-)
Last edited by Didier Spaier; 07-08-2014 at 09:25 AM.
Reason: a test case s/have/has/ been found
|
|
|
07-08-2014, 09:21 AM
|
#6
|
LQ 5k Club
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,311
Rep: 
|
Ah, I see. Thanks for the clarification. No idea how to solve it, though.
Slightly on-and-off-topic.
I can't use the VESA framebuffer because I'm using the NVidia driver, and I seem to remember they interfere with each other. Or at least, that used to happen.
Last edited by brianL; 07-08-2014 at 09:27 AM.
|
|
|
07-08-2014, 12:01 PM
|
#7
|
Member
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 146
Rep: 
|
Maybe You can use resize:
Code:
resize
TERMCAP='lx|...
...
...:r3=\Ec:';
export TERMCAP;
COLUMNS=240;
LINES=75;
export COLUMNS LINES;
There You have width and hight
|
|
|
07-08-2014, 12:31 PM
|
#8
|
Member
Registered: Mar 2006
Distribution: Give me Slack or give me death.
Posts: 81
Rep:
|
I dont use fbterm either. I did a little searching but I fear I found nothing of real value.
I do have a suggestion, however. If I am understanding correctly, fbterm is actually programmed to make sure its output is not being redirected, which is somewhat appropriate when invoked normally, but wildly inappropriate when used with the switch in question. So I would suggest you use the source. Find the check, and neuter it. You could disable it entirely, probably the quickest and easiest solution, or for a cleaner solution just bypass the check when this particular switch is used.
|
|
|
07-08-2014, 12:42 PM
|
#9
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,408
Original Poster
Rep: 
|
@ml4711: thanks, but unfortunately we're not in an xterm during Slackware's installation.
@Arkerless: thanks for the suggestion, I'll try that and see what I come up with.
|
|
|
07-08-2014, 12:51 PM
|
#10
|
Member
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 146
Rep: 
|
Actually resize also works in a console and in fbterm!
|
|
|
07-08-2014, 01:25 PM
|
#11
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,408
Original Poster
Rep: 
|
Quote:
Originally Posted by ml4711
Actually resize also works in a console and in fbterm!
|
Yes, but to display then terminal size only, of course. But I need to know the current resolution to compute the "good" font size (i.e. the biggest font size that will allow to display, say, at least 30 lines and 85 columns).
Maybe someone could add to fbterm an option to set the terminal size and compute the font size accordingly, like this:
Code:
fbterm --terminal-size <COLUMNS>x<LINES>
Of course that should work with and without a frame buffer...
Any volunteer?
I could try... If only I was able to code in C++ and knew VESA, VBE, EDID and the like...
Last edited by Didier Spaier; 07-08-2014 at 01:55 PM.
|
|
|
07-08-2014, 01:51 PM
|
#12
|
Member
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 146
Rep: 
|
Quote:
Yes, but to display then terminal size only, of course. But I need to know the current resolution to compute the "good" font size (i.e. the biggest font size that will allows to display, say, at least 30 lines and 85 columns).
|
OK, I see.
Then use fbset to get the size in pixels, before You call fbterm
Code:
fbset
mode "1680x1050"
geometry 1680 1050 1680 1050 32
...
|
|
1 members found this post helpful.
|
07-08-2014, 05:22 PM
|
#13
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,408
Original Poster
Rep: 
|
Promising, but... fbset fails if there is no frame buffer device.
So, I am wondering: can I force usage of a frame buffer during installation?
One of the most generic drivers is vesafb, but it works only for devices compliant to at least VESA 2.0 (not VESA 1.2), so no luck for very old cards.
There is also vga16fb (but can we use only 16 colors?).
I tried a command line with "video=vga16fb nomodeset" appended, I'm not sure that the syntax be correct (I should better read modedb.txt in the kernel's documentation) but anyway I end up with a VESA VGA frame buffer device, maybe because vesafb is built in in the huge kernel's configuration (I have to check the generic's and the installer's configurations). I still can modprobe vga16fb and then end up with two frame buffer devices, but I could set the environment variable FRAMEBUFFER to tell fbterm which one it should use. Anyhow blacklisting all other frame buffer modules to prevent handovers would be an extreme measure, I think. I just hope that modprobing vga16fb when any other frame buffer module is loaded has no bad consequence...
It's late here, so I'll investigate further tomorrow (actually, later today :-).
Last edited by Didier Spaier; 07-08-2014 at 06:08 PM.
|
|
|
07-08-2014, 07:46 PM
|
#14
|
Member
Registered: Nov 2013
Posts: 748
Rep: 
|
just a thought
echo `fbterm -v` | tee yes_please.txt
doubt it will work thou
|
|
|
07-08-2014, 07:54 PM
|
#15
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,408
Original Poster
Rep: 
|
Alas, that doesn't work. Thanks anyway.
Last edited by Didier Spaier; 07-08-2014 at 07:57 PM.
|
|
|
All times are GMT -5. The time now is 11:19 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|