Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: How to set my monitor as my default display?

  1. #1

    Question How to set my monitor as my default display?

    Hello all, I'm using OpenSuse 13.1. I have a notebook (resolution 1366x768) and I connect it to a 17" monitor (resolution 1920x1080) using a HDMI connector. I am able to switch screens pressing Fn+F1 twice and everything works fine (notebook screen turns off and monitor becomes the only screen as 1920x1020). The problem is that everytime I reboot I have to press Fn+F1 twice in the login manager (I guess it's GDM). I already tryed to add this line to /etc/rc.d/boot.local but it has no effect:

    Code:
    xrandr --output HDMI1 --mode 1920x1080
    It's strange because I am able to change my resolution using xrandr. Here is my current output for xrandr:


    Code:
    $ xrandr --current
    Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 32767 x 32767
    LVDS1 connected (normal left inverted right x axis y axis)
       1366x768       60.0 +   40.0  
       1024x768       60.0  
       800x600        60.3     56.2  
       640x480        59.9  
    VGA1 disconnected (normal left inverted right x axis y axis)
    HDMI1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 510mm x 290mm
       1920x1080      59.9*+   60.0     60.0     50.0     59.9  
       1920x1080i     60.1     50.0     60.0  
       1680x1050      59.9  
       1280x1024      75.0     60.0  
       1152x864       75.0  
       1280x720       60.0     50.0     59.9  
       1024x768       75.1     60.0  
       832x624        74.6  
       800x600        75.0     60.3     56.2  
       720x576        50.0  
       720x480        60.0     59.9  
       640x480        75.0     60.0     59.9  
       720x400        70.1  
    DP1 disconnected (normal left inverted right x axis y axis)
    VIRTUAL1 disconnected (normal left inverted right x axis y axis)
    How do I set my 17" monitor to be the default display everytime I boot my notebook and it's connected to it?

  2. #2

    Default Re: How to set my monitor as my default display?

    Quote Originally Posted by renatov View Post
    I already tryed to add this line to /etc/rc.d/boot.local but it has no effect:
    ...
    It's strange because I am able to change my resolution using xrandr.
    not strange at all -- boot.local is run before the DM brings up the display server (X)

  3. #3

    Question Re: How to set my monitor as my default display?

    Quote Originally Posted by Tyler_K View Post
    not strange at all -- boot.local is run before the DM brings up the display server (X)
    Oh, I didn't know that. But where should I put this command, then?

  4. #4
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,699
    Blog Entries
    1

    Default Re: How to set my monitor as my default display?

    Quote Originally Posted by renatov View Post
    Oh, I didn't know that. But where should I put this command, then?
    Create an executable script within the user's ~/.config/autostart/ directory.

  5. #5
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,699
    Blog Entries
    1

    Default Re: How to set my monitor as my default display?

    Quote Originally Posted by deano_ferrari View Post
    Create an executable script within the user's ~/.config/autostart/ directory.
    Actually, this method won't work directly. It is necessary to create a .desktop file, and call the script from it.

    http://standards.freedesktop.org/aut...ec-latest.html

    As a KDE user, I have used ~/.kde4/Autostart/ to do this in the past. (Other DE's have equivalent 'autostart' locations.)

  6. #6

    Default Re: How to set my monitor as my default display?

    Quote Originally Posted by deano_ferrari View Post
    Actually, this method won't work directly. It is necessary to create a .desktop file, and call the script from it.

    http://standards.freedesktop.org/aut...ec-latest.html

    As a KDE user, I have used ~/.kde4/Autostart/ to do this in the past. (Other DE's have equivalent 'autostart' locations.)
    I haven't tryed yet, but either way I think it won't work. The path "~/" will only be determined after a successful login, right? By that time I would have already set my monitor as my display, because I need it to perform the login. After the login I don't need the monitor to be set once again as my display, it has already been done manually.

    I need this command to be executed before the login manager appears (or else I can't login), thus I need it to be executed before any user has been authenticated and before any "~/" path has been defined.

  7. #7
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,699
    Blog Entries
    1

    Default Re: How to set my monitor as my default display?

    Quote Originally Posted by renatov View Post
    I haven't tryed yet, but either way I think it won't work. The path "~/" will only be determined after a successful login, right?
    Yes, that is correct. If you need it to occur earlier, you could try adding the xrandr command to /etc/X11/xinit/xinitrc instead, right where it says
    Code:
    #
    # Add your own lines here...
    #
    Bear in mind that as KDM/GDM initialises, some settings are auto-detected again, so for example if a display resolution is set here, it won't persist, and the xrandr command has to be set again after login (via autostart script or similar). In your case, it should set the primary display before login.

    The alternative method would be to use the Xorg config files to do the same as outlined here:

    https://wiki.edubuntu.org/X/Config/R...s_in_xorg.conf

    * The example there shows how to set display resolution and set primary display.

  8. #8

    Default Re: How to set my monitor as my default display?

    I added that command to /etc/X11/xinit/xinitrc but it didn't work, I'm losing hope

  9. #9
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,699
    Blog Entries
    1

    Default Re: How to set my monitor as my default display?

    Quote Originally Posted by renatov View Post
    I added that command to /etc/X11/xinit/xinitrc but it didn't work, I'm losing hope
    Try setting it via Xorg configuration files. You can create /etc/X11/xorg.conf, or use the newer /etc/X11/xorg.conf.d/ config files...

  10. #10
    Join Date
    Jun 2008
    Location
    Sogndal, Noreg
    Posts
    1,103

    Default Re: How to set my monitor as my default display?

    Could placing the command inside a .bashrc file work? I did pass a similar command, related to a resolution issue I had, using either that method or from a .bash_profile file, can't remember which but it worked well enough.

    .bashrc:
    Code:
    xrandr --output HDMI1 --mode 1920x1080 &
    OpenSuSE 13.1, KDE 4.11.5, 64bit
    Gigabyte 990FXA-UD3, AMD FX8350, MSI GeForce GTX 760, RME HDSP9632, 16GB HyperX Kingston DDR3, Samsung 840-Pro SSD 128GB, WD Desktop Black 1TB, Hitachi Deskstar 7K1000 750GB

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •