How to change the font size in terminal from terminal without the use of a mouse
The configuration file for lxterminal is: $HOME/.config/lxterminal/lxterminal.conf
with the default font and size showing as:
fontname=Monospace 12
Simply alter this with your favourite command line editor such as vim and your changes are made. However it would be far cooler to use sed to accomplish with something like the following one-liner:
sed -i_bak '/^fontname/s/[0-9][0-9]$/22/' $HOME/.config/lxterminal/lxterminal.conf
This works by:
-
sed -i_bak
: Make the changes inline and save a backup of the original file with the suffix_bak
-
'/^fontname/
: Match the line with 'fontname' at the beginning. -
s/[0-9][0-9]$/22/'
Substitute the last 2 numbers with '22' or the number for the size of the font that you require.
How cool is the command line!
References:
Related videos on Youtube
Admin
Updated on September 18, 2022Comments
-
Admin over 1 year
I am working with LXTerminal 0.2.0 and want to know how to change the font size to make it easier in my eyes and for general knowledge so that I can do it in the absence of a mouse since that is what normally exists. I am trying to learn to be self sufficient working by myself with no mouse in a normal terminal environment. I am working with ubuntu 16.04lts. Please don't refer to gui as I know how that works.
-
guiverc almost 6 yearsalt-E pulls up the EDIT menu, <up> arrow then <enter> selects preferences, then I could tab to 'terminal font' & alter font size with <arrow>, <tab> & <enter> keys. I do realize you want a quick key way - but it works (I don't use lxterminal so haven't looked for better)
-
sudodus almost 6 yearsWhen you press (and hold) the
alt
key, the hotkeys for the pulldown menu items are underlined. UseE
(while still holding thealt
key) in English, and some other letter in other languages, for exampleR
in Swedish, which stands for 'Redigera'. -
DK Bose almost 6 yearsWhat does
Ctrl
plusShift
plus theequals
key do when all three keys are pressed together? In LXTerminal 0.3, that increases the font size (and window size) andCtrl
plusshift
plus theminus
sign decreases the font size (and the window size). -
sudodus almost 6 yearsFor me in Lubuntu 18.04 LTS with
lxterminal 0.3.1
I can also usectrl
and+
to increase the font andctrl
andshift
and-
to decrease the font. But this is only temporary. Do it via the Edit menu, if you want to change the settings in a persistent way.
-