How to change display resolution and scaling using the command line [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
2
down vote

favorite













This question already has an answer here:



  • How do I change the screen resolution using Ubuntu command line?

    4 answers



i have a laptop with a hidpi display, i'm using ubuntu 18.04 with a resolution of 3840x2160 and 200% scale. Everything software I use looks fine with the exception of one so I would like to write a script so I can automatically change, let's say scaling to 100% and resolution to 1024x768.



Is there a way to do this?



Thanks!







share|improve this question












marked as duplicate by karel, Sergiy Kolodyazhnyy, Goddard, Eric Carvalho, user364819 May 31 at 20:17


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • To reviewers: This duplicate doesn’t address the scaling in any way.
    – dessert
    May 29 at 6:29










  • Suggest you visit askubuntu.com/questions/771673/…
    – K7AAY
    May 31 at 18:08















up vote
2
down vote

favorite













This question already has an answer here:



  • How do I change the screen resolution using Ubuntu command line?

    4 answers



i have a laptop with a hidpi display, i'm using ubuntu 18.04 with a resolution of 3840x2160 and 200% scale. Everything software I use looks fine with the exception of one so I would like to write a script so I can automatically change, let's say scaling to 100% and resolution to 1024x768.



Is there a way to do this?



Thanks!







share|improve this question












marked as duplicate by karel, Sergiy Kolodyazhnyy, Goddard, Eric Carvalho, user364819 May 31 at 20:17


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • To reviewers: This duplicate doesn’t address the scaling in any way.
    – dessert
    May 29 at 6:29










  • Suggest you visit askubuntu.com/questions/771673/…
    – K7AAY
    May 31 at 18:08













up vote
2
down vote

favorite









up vote
2
down vote

favorite












This question already has an answer here:



  • How do I change the screen resolution using Ubuntu command line?

    4 answers



i have a laptop with a hidpi display, i'm using ubuntu 18.04 with a resolution of 3840x2160 and 200% scale. Everything software I use looks fine with the exception of one so I would like to write a script so I can automatically change, let's say scaling to 100% and resolution to 1024x768.



Is there a way to do this?



Thanks!







share|improve this question













This question already has an answer here:



  • How do I change the screen resolution using Ubuntu command line?

    4 answers



i have a laptop with a hidpi display, i'm using ubuntu 18.04 with a resolution of 3840x2160 and 200% scale. Everything software I use looks fine with the exception of one so I would like to write a script so I can automatically change, let's say scaling to 100% and resolution to 1024x768.



Is there a way to do this?



Thanks!





This question already has an answer here:



  • How do I change the screen resolution using Ubuntu command line?

    4 answers









share|improve this question











share|improve this question




share|improve this question










asked May 28 at 22:53









Horacio González

184




184




marked as duplicate by karel, Sergiy Kolodyazhnyy, Goddard, Eric Carvalho, user364819 May 31 at 20:17


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by karel, Sergiy Kolodyazhnyy, Goddard, Eric Carvalho, user364819 May 31 at 20:17


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • To reviewers: This duplicate doesn’t address the scaling in any way.
    – dessert
    May 29 at 6:29










  • Suggest you visit askubuntu.com/questions/771673/…
    – K7AAY
    May 31 at 18:08

















  • To reviewers: This duplicate doesn’t address the scaling in any way.
    – dessert
    May 29 at 6:29










  • Suggest you visit askubuntu.com/questions/771673/…
    – K7AAY
    May 31 at 18:08
















To reviewers: This duplicate doesn’t address the scaling in any way.
– dessert
May 29 at 6:29




To reviewers: This duplicate doesn’t address the scaling in any way.
– dessert
May 29 at 6:29












Suggest you visit askubuntu.com/questions/771673/…
– K7AAY
May 31 at 18:08





Suggest you visit askubuntu.com/questions/771673/…
– K7AAY
May 31 at 18:08











1 Answer
1






active

oldest

votes

















up vote
2
down vote



accepted










This is an X Server solution and may not work with Wayland.



You can use randr for that, just determine the output name and available modes with xrandr and use the --mode and --scale options to change the settings. Provided this mode already exists, this would change the output DP2 to 3840x2160 with 200% scaling:



xrandr --output DP2 --mode 3840x2160 --scale 2x2


This changes to 1024x768 with 100% scaling:



xrandr --output DP2 --mode 1024x768 --scale 1x1


Further reading:



  • man xrandr

  • How do I change the screen resolution using Ubuntu command line?


To automate this I’d use xdotool, e.g. to call xrandr as soon an xterm window gets focus:



xdotool search --class xterm behave %@ focus exec xrandr





share|improve this answer





























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote



    accepted










    This is an X Server solution and may not work with Wayland.



    You can use randr for that, just determine the output name and available modes with xrandr and use the --mode and --scale options to change the settings. Provided this mode already exists, this would change the output DP2 to 3840x2160 with 200% scaling:



    xrandr --output DP2 --mode 3840x2160 --scale 2x2


    This changes to 1024x768 with 100% scaling:



    xrandr --output DP2 --mode 1024x768 --scale 1x1


    Further reading:



    • man xrandr

    • How do I change the screen resolution using Ubuntu command line?


    To automate this I’d use xdotool, e.g. to call xrandr as soon an xterm window gets focus:



    xdotool search --class xterm behave %@ focus exec xrandr





    share|improve this answer


























      up vote
      2
      down vote



      accepted










      This is an X Server solution and may not work with Wayland.



      You can use randr for that, just determine the output name and available modes with xrandr and use the --mode and --scale options to change the settings. Provided this mode already exists, this would change the output DP2 to 3840x2160 with 200% scaling:



      xrandr --output DP2 --mode 3840x2160 --scale 2x2


      This changes to 1024x768 with 100% scaling:



      xrandr --output DP2 --mode 1024x768 --scale 1x1


      Further reading:



      • man xrandr

      • How do I change the screen resolution using Ubuntu command line?


      To automate this I’d use xdotool, e.g. to call xrandr as soon an xterm window gets focus:



      xdotool search --class xterm behave %@ focus exec xrandr





      share|improve this answer
























        up vote
        2
        down vote



        accepted







        up vote
        2
        down vote



        accepted






        This is an X Server solution and may not work with Wayland.



        You can use randr for that, just determine the output name and available modes with xrandr and use the --mode and --scale options to change the settings. Provided this mode already exists, this would change the output DP2 to 3840x2160 with 200% scaling:



        xrandr --output DP2 --mode 3840x2160 --scale 2x2


        This changes to 1024x768 with 100% scaling:



        xrandr --output DP2 --mode 1024x768 --scale 1x1


        Further reading:



        • man xrandr

        • How do I change the screen resolution using Ubuntu command line?


        To automate this I’d use xdotool, e.g. to call xrandr as soon an xterm window gets focus:



        xdotool search --class xterm behave %@ focus exec xrandr





        share|improve this answer














        This is an X Server solution and may not work with Wayland.



        You can use randr for that, just determine the output name and available modes with xrandr and use the --mode and --scale options to change the settings. Provided this mode already exists, this would change the output DP2 to 3840x2160 with 200% scaling:



        xrandr --output DP2 --mode 3840x2160 --scale 2x2


        This changes to 1024x768 with 100% scaling:



        xrandr --output DP2 --mode 1024x768 --scale 1x1


        Further reading:



        • man xrandr

        • How do I change the screen resolution using Ubuntu command line?


        To automate this I’d use xdotool, e.g. to call xrandr as soon an xterm window gets focus:



        xdotool search --class xterm behave %@ focus exec xrandr






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited May 29 at 6:58

























        answered May 29 at 6:46









        dessert

        19.5k55594




        19.5k55594












            Popular posts from this blog

            pylint3 and pip3 broken

            Missing snmpget and snmpwalk

            How to enroll fingerprints to Ubuntu 17.10 with VFS491