Change terminal font size programatically












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










share|improve this question




















  • 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 at 15:20
















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










share|improve this question




















  • 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 at 15:20














1












1








1


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










share|improve this question
















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







gnome-terminal fonts






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 18 at 15:32







Mehdi

















asked Jan 18 at 15:05









MehdiMehdi

227313




227313








  • 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 at 15:20














  • 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 at 15:20








1




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 at 15:20





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 at 15:20










2 Answers
2






active

oldest

votes


















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.






share|improve this answer



















  • 1





    I added some details

    – Mehdi
    Jan 18 at 15:27



















0














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 more, it will make the OS unoperatable.
by mistake i press 512 instead of 52 and press enter..struggled a lot to get back.



enter image description here






share|improve this answer

























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1110903%2fchange-terminal-font-size-programatically%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    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.






    share|improve this answer



















    • 1





      I added some details

      – Mehdi
      Jan 18 at 15:27
















    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.






    share|improve this answer



















    • 1





      I added some details

      – Mehdi
      Jan 18 at 15:27














    0












    0








    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.






    share|improve this answer













    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.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 18 at 15:22









    Jonas EberleJonas Eberle

    1




    1








    • 1





      I added some details

      – Mehdi
      Jan 18 at 15:27














    • 1





      I added some details

      – Mehdi
      Jan 18 at 15:27








    1




    1





    I added some details

    – Mehdi
    Jan 18 at 15:27





    I added some details

    – Mehdi
    Jan 18 at 15:27













    0














    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 more, it will make the OS unoperatable.
    by mistake i press 512 instead of 52 and press enter..struggled a lot to get back.



    enter image description here






    share|improve this answer






























      0














      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 more, it will make the OS unoperatable.
      by mistake i press 512 instead of 52 and press enter..struggled a lot to get back.



      enter image description here






      share|improve this answer




























        0












        0








        0







        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 more, it will make the OS unoperatable.
        by mistake i press 512 instead of 52 and press enter..struggled a lot to get back.



        enter image description here






        share|improve this answer















        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 more, it will make the OS unoperatable.
        by mistake i press 512 instead of 52 and press enter..struggled a lot to get back.



        enter image description here







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 19 at 15:47

























        answered Jan 19 at 15:33









        PRATAPPRATAP

        2,7082627




        2,7082627






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1110903%2fchange-terminal-font-size-programatically%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Human spaceflight

            Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

            File:DeusFollowingSea.jpg