1

is that possible to do that by running a command? Is there any hack that would allow this? I tried using python-uinput to simulate pushing Ctrl+Plus in order to make font bigger but it did not work.

I am trying to display images in the terminal without any need for a gui. this is possible using timg. However the image resolution is quite bad. When I make the font size of the terminal very small, the image is displayed at almost native resolution.

I want to write a script hat will automatically reset the terminal, resize its font to a very small size and finally call timg to display the image. This will allow ssh into a remote robot and displaying the latest image it acquired without having to first copy it back to my computer.

I am mostly working with gnome-terminal or terminator

  • 1
    This is handled by the terminal emulator itself. Which one are you using? gnome-terminal? And could you explain why you would want this? If Ctrl+Plus works for you, why do you need a command for it? I ask because this might be an XY problem, so if you explain your rationale, we might be able to find a different approach. – terdon Jan 18 '19 at 15:20
1

to change the gnome-terminal font size via command line,

  1. first we need to know the current profile id of the gnome-terminal. I am using the default one which is named as "Unnamed"

enter image description here

in my case the profile id is something that is starting with "b1dcc9" enter image description here

  1. Custom font square must be ticked.

enter image description here

  1. run the below command to get the list of profiles
    gsettings get org.gnome.Terminal.ProfilesList list

Example:

$ gsettings get org.gnome.Terminal.ProfilesList list
['b1dcc9dd-5262-4d8d-a863-c897e6d979b9', 'd2a064f8-146d-45b5-8da7-d7e2f34da77e', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa']

I already know that my current profile is something that is starting with "b1dcc9"

  1. get the font name and size with the below command gsettings get org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/ font

Example:

$ gsettings get org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/ font
'Noto Mono Bold 12'
$
  1. Set the font name and size with the below command gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/ font 'Ubuntu Mono Italic 50'

Example:

$ gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/ font 'Ubuntu Mono Italic 50'
$

Caution: do not put font size in high values, it will make the OS non operative. by mistake i press 512 instead of 52 and press enter..struggled a lot to get back.

enter image description here

0

It comes to mind that unlike e.g. changing colors it is not possible to affect the font size of text on an arbitrary console - but I don't know if you actually try to do that.

Please add more information. Which terminal do you want to control? gnome-terminal? Why do you want it programmatically? For a desktop application, this is normally possible in the terminal application's settings. For the system console, you can use sudo dpkg-reconfigure console-setup.

  • 1
    I added some details – Mehdi Jan 18 '19 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.