xrandr: cannot find mode on startup

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











up vote
2
down vote

favorite
1












I want to configure my 2 external screens of my laptop on every startup.
Because I have a kind of dockstation I wrote a small script which retrieves whether my laptop is connected to the dock or not.



If yes the monitors should configure themselfs by xrandr. Here is my script:



#!/bin/bash

export DISPLAY=:0
export XAUTHORITY=/home/$USER/.Xauthority

sleep 1

DOCKED=$(cat /sys/devices/platform/dock.2/docked)
case "$DOCKED" in
0)
xrandr --output DVI1 --off --output VIRTUAL1 --off --output VGA1 --off &> && xrandr --output LVDS1 --mode 1024x768 --pos 0x0 --rotate normal
;;
1)
xrandr --output VIRTUAL1 --off --output LVDS1 --off && xrandr --output DVI1 --mode 1366x768 --pos 1360x0 --rotate normal --output VGA1 --primary --mode 1360x768 --pos 0x0 --rotate normal
;;
esac


Unfortunately xrand does not work in the right way on boot. It shows me this:



xrandr: cannot find mode 1360x768


I am a little bit confused because if I start the script while my pc is already running it works flawless and there is no error report!



So I guess xrandr does not find my monitors on startup and therefore it does not know the specific configuration of each of them..



How can I fix this issue??



Thanks a lot for helping me!










share|improve this question

























    up vote
    2
    down vote

    favorite
    1












    I want to configure my 2 external screens of my laptop on every startup.
    Because I have a kind of dockstation I wrote a small script which retrieves whether my laptop is connected to the dock or not.



    If yes the monitors should configure themselfs by xrandr. Here is my script:



    #!/bin/bash

    export DISPLAY=:0
    export XAUTHORITY=/home/$USER/.Xauthority

    sleep 1

    DOCKED=$(cat /sys/devices/platform/dock.2/docked)
    case "$DOCKED" in
    0)
    xrandr --output DVI1 --off --output VIRTUAL1 --off --output VGA1 --off &> && xrandr --output LVDS1 --mode 1024x768 --pos 0x0 --rotate normal
    ;;
    1)
    xrandr --output VIRTUAL1 --off --output LVDS1 --off && xrandr --output DVI1 --mode 1366x768 --pos 1360x0 --rotate normal --output VGA1 --primary --mode 1360x768 --pos 0x0 --rotate normal
    ;;
    esac


    Unfortunately xrand does not work in the right way on boot. It shows me this:



    xrandr: cannot find mode 1360x768


    I am a little bit confused because if I start the script while my pc is already running it works flawless and there is no error report!



    So I guess xrandr does not find my monitors on startup and therefore it does not know the specific configuration of each of them..



    How can I fix this issue??



    Thanks a lot for helping me!










    share|improve this question























      up vote
      2
      down vote

      favorite
      1









      up vote
      2
      down vote

      favorite
      1






      1





      I want to configure my 2 external screens of my laptop on every startup.
      Because I have a kind of dockstation I wrote a small script which retrieves whether my laptop is connected to the dock or not.



      If yes the monitors should configure themselfs by xrandr. Here is my script:



      #!/bin/bash

      export DISPLAY=:0
      export XAUTHORITY=/home/$USER/.Xauthority

      sleep 1

      DOCKED=$(cat /sys/devices/platform/dock.2/docked)
      case "$DOCKED" in
      0)
      xrandr --output DVI1 --off --output VIRTUAL1 --off --output VGA1 --off &> && xrandr --output LVDS1 --mode 1024x768 --pos 0x0 --rotate normal
      ;;
      1)
      xrandr --output VIRTUAL1 --off --output LVDS1 --off && xrandr --output DVI1 --mode 1366x768 --pos 1360x0 --rotate normal --output VGA1 --primary --mode 1360x768 --pos 0x0 --rotate normal
      ;;
      esac


      Unfortunately xrand does not work in the right way on boot. It shows me this:



      xrandr: cannot find mode 1360x768


      I am a little bit confused because if I start the script while my pc is already running it works flawless and there is no error report!



      So I guess xrandr does not find my monitors on startup and therefore it does not know the specific configuration of each of them..



      How can I fix this issue??



      Thanks a lot for helping me!










      share|improve this question













      I want to configure my 2 external screens of my laptop on every startup.
      Because I have a kind of dockstation I wrote a small script which retrieves whether my laptop is connected to the dock or not.



      If yes the monitors should configure themselfs by xrandr. Here is my script:



      #!/bin/bash

      export DISPLAY=:0
      export XAUTHORITY=/home/$USER/.Xauthority

      sleep 1

      DOCKED=$(cat /sys/devices/platform/dock.2/docked)
      case "$DOCKED" in
      0)
      xrandr --output DVI1 --off --output VIRTUAL1 --off --output VGA1 --off &> && xrandr --output LVDS1 --mode 1024x768 --pos 0x0 --rotate normal
      ;;
      1)
      xrandr --output VIRTUAL1 --off --output LVDS1 --off && xrandr --output DVI1 --mode 1366x768 --pos 1360x0 --rotate normal --output VGA1 --primary --mode 1360x768 --pos 0x0 --rotate normal
      ;;
      esac


      Unfortunately xrand does not work in the right way on boot. It shows me this:



      xrandr: cannot find mode 1360x768


      I am a little bit confused because if I start the script while my pc is already running it works flawless and there is no error report!



      So I guess xrandr does not find my monitors on startup and therefore it does not know the specific configuration of each of them..



      How can I fix this issue??



      Thanks a lot for helping me!







      linux bash arch-linux xrandr






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 22 '15 at 13:11









      linux_lover

      2315




      2315




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          First add the mode you want.



          Use gtf/cvt and xrandr to do that.



          $ cvt 1360 768 60
          # 1360x768 59.80 Hz (CVT) hsync: 47.72 kHz; pclk: 84.75 MHz
          Modeline "1360x768_60.00" 84.75 1360 1432 1568 1776 768 771 781 798 -hsync +vsync
          $ gtf 1360 768 60 -x

          # 1360x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 84.72 MHz
          Modeline "1360x768_60.00" 84.72 1360 1424 1568 1776 768 769 772 795 -HSync +Vsync

          $ xrandr --newmode "1360x768_60.00" 84.72 1360 1424 1568 1776 768 769 772 795 -HSync +Vsync
          $ xrandr --addmode VGA1 "1360x768_60.00"





          share|improve this answer




















          • Could you explain why it's not working on startup and this would be the correct fix ?
            – Nikana Reklawyks
            Jan 10 '17 at 22:46










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f244726%2fxrandr-cannot-find-mode-on-startup%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          First add the mode you want.



          Use gtf/cvt and xrandr to do that.



          $ cvt 1360 768 60
          # 1360x768 59.80 Hz (CVT) hsync: 47.72 kHz; pclk: 84.75 MHz
          Modeline "1360x768_60.00" 84.75 1360 1432 1568 1776 768 771 781 798 -hsync +vsync
          $ gtf 1360 768 60 -x

          # 1360x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 84.72 MHz
          Modeline "1360x768_60.00" 84.72 1360 1424 1568 1776 768 769 772 795 -HSync +Vsync

          $ xrandr --newmode "1360x768_60.00" 84.72 1360 1424 1568 1776 768 769 772 795 -HSync +Vsync
          $ xrandr --addmode VGA1 "1360x768_60.00"





          share|improve this answer




















          • Could you explain why it's not working on startup and this would be the correct fix ?
            – Nikana Reklawyks
            Jan 10 '17 at 22:46














          up vote
          0
          down vote













          First add the mode you want.



          Use gtf/cvt and xrandr to do that.



          $ cvt 1360 768 60
          # 1360x768 59.80 Hz (CVT) hsync: 47.72 kHz; pclk: 84.75 MHz
          Modeline "1360x768_60.00" 84.75 1360 1432 1568 1776 768 771 781 798 -hsync +vsync
          $ gtf 1360 768 60 -x

          # 1360x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 84.72 MHz
          Modeline "1360x768_60.00" 84.72 1360 1424 1568 1776 768 769 772 795 -HSync +Vsync

          $ xrandr --newmode "1360x768_60.00" 84.72 1360 1424 1568 1776 768 769 772 795 -HSync +Vsync
          $ xrandr --addmode VGA1 "1360x768_60.00"





          share|improve this answer




















          • Could you explain why it's not working on startup and this would be the correct fix ?
            – Nikana Reklawyks
            Jan 10 '17 at 22:46












          up vote
          0
          down vote










          up vote
          0
          down vote









          First add the mode you want.



          Use gtf/cvt and xrandr to do that.



          $ cvt 1360 768 60
          # 1360x768 59.80 Hz (CVT) hsync: 47.72 kHz; pclk: 84.75 MHz
          Modeline "1360x768_60.00" 84.75 1360 1432 1568 1776 768 771 781 798 -hsync +vsync
          $ gtf 1360 768 60 -x

          # 1360x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 84.72 MHz
          Modeline "1360x768_60.00" 84.72 1360 1424 1568 1776 768 769 772 795 -HSync +Vsync

          $ xrandr --newmode "1360x768_60.00" 84.72 1360 1424 1568 1776 768 769 772 795 -HSync +Vsync
          $ xrandr --addmode VGA1 "1360x768_60.00"





          share|improve this answer












          First add the mode you want.



          Use gtf/cvt and xrandr to do that.



          $ cvt 1360 768 60
          # 1360x768 59.80 Hz (CVT) hsync: 47.72 kHz; pclk: 84.75 MHz
          Modeline "1360x768_60.00" 84.75 1360 1432 1568 1776 768 771 781 798 -hsync +vsync
          $ gtf 1360 768 60 -x

          # 1360x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 84.72 MHz
          Modeline "1360x768_60.00" 84.72 1360 1424 1568 1776 768 769 772 795 -HSync +Vsync

          $ xrandr --newmode "1360x768_60.00" 84.72 1360 1424 1568 1776 768 769 772 795 -HSync +Vsync
          $ xrandr --addmode VGA1 "1360x768_60.00"






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 23 '15 at 18:44









          Mal V Bonner

          173




          173











          • Could you explain why it's not working on startup and this would be the correct fix ?
            – Nikana Reklawyks
            Jan 10 '17 at 22:46
















          • Could you explain why it's not working on startup and this would be the correct fix ?
            – Nikana Reklawyks
            Jan 10 '17 at 22:46















          Could you explain why it's not working on startup and this would be the correct fix ?
          – Nikana Reklawyks
          Jan 10 '17 at 22:46




          Could you explain why it's not working on startup and this would be the correct fix ?
          – Nikana Reklawyks
          Jan 10 '17 at 22:46

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f244726%2fxrandr-cannot-find-mode-on-startup%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay