Setting modified 'xrandr' resolution to stay after boot? [Solved]

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
panorain
Level 5
Level 5
Posts: 572
Joined: Mon Dec 16, 2013 3:21 pm

Setting modified 'xrandr' resolution to stay after boot? [Solved]

Post by panorain »

Hello, after installing Mint 19.1 Tessa on my computer the resolution is stuck at 1366x768 (video card only capable of using Vga not DVI or HDMI) with my Vizio 32" tv/monitor. I would like to set the resolution permanantely to 1900x1200 Vga. I have followed the following link with success as to temporarily set the resolution to 1900x1200 which does work fine. I would like to keep the resolution at 1900x1200 after a powercycle/reboot of the computer if at all possible. ----> https://ubuntuforums.org/showthread.php?t=1370258

1. Is there a (file/files) and/or how can the pc maintain this 1900x1200 resolution after reboot as the file ----> /etc/gdm/Init/Default <---- does not exist in the Linux Mint 19.1 distribution?

Code: Select all

inxi -Fxz
  • Kernel: 4.15.0-46-generic i686 bits: 32 compiler: gcc v: 7.3.0 Desktop: MATE 1.20.1
    Distro: Linux Mint 19.1 Tessa base: Ubuntu 18.04 bionic
    Machine: Type: Desktop System: Gateway product: N/A v: N/A serial: <filter>
    Mobo: Intel model: D915GAG v: AAC77881-303 serial: <filter> BIOS: Intel v: EV91510A.15A.0067.2004.0722.1717
    date: 07/22/2004
    CPU: Topology: Single Core model: Intel Pentium 4 bits: 32 type: MT arch: Netburst Prescott rev: 4 L2 cache: 1024 KiB
    flags: pae sse sse2 sse3 bogomips: 11999
    Speed: 3000 MHz min/max: N/A Core speeds (MHz): 1: 3000 2: 3000
    Graphics: Device-1: Intel 82915G/GV/910GL Integrated Graphics vendor: Gateway driver: i915 v: kernel bus ID: 00:02.0
    Display: x11 server: X.Org 1.19.6 driver: intel unloaded: fbdev,modesetting,vesa resolution: 1904x1200_60.00~60Hz
    OpenGL: renderer: Mesa DRI Intel 915G x86/MMX/SSE2 v: 1.4 Mesa 18.2.2 direct render: Yes
    Audio: Device-1: Intel 82801FB/FBM/FR/FW/FRW High Definition Audio vendor: Gateway driver: snd_hda_intel v: kernel
    bus ID: 00:1b.0
    Sound Server: ALSA v: k4.15.0-46-generic
    Network: Device-1: Broadcom and subsidiaries BCM4318 [AirForce One 54g] 802.11g Wireless LAN vendor: Belkin
    driver: b43-pci-bridge v: N/A port: c400 bus ID: 06:01.0
    Device-2: Intel 82562ET/EZ/GT/GZ - PRO/100 VE Ethernet vendor: Gateway driver: e100 v: 3.5.24-k2-NAPI port: bc00
    bus ID: 06:08.0
    IF: enp6s8 state: down mac: <filter>
    IF-ID-1: wlan0 state: up mac: <filter>
    Drives: Local Storage: total: 78.24 GiB used: 23.18 GiB (29.6%)
    ID-1: /dev/sda vendor: Maxtor model: 6Y080M0 size: 74.51 GiB
    ID-2: /dev/sdf type: USB model: N/A size: 3.73 GiB
    Partition: ID-1: / size: 70.14 GiB used: 11.49 GiB (16.4%) fs: ext4 dev: /dev/dm-1
    ID-2: /boot size: 703.5 MiB used: 202.3 MiB (28.8%) fs: ext4 dev: /dev/sda1
    ID-3: swap-1 size: 1.99 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/dm-3
    Sensors: Message: No sensors data was found. Is sensors configured?
    Info: Processes: 183 Uptime: 1h 06m Memory: 2.44 GiB used: 681.1 MiB (27.2%) Init: systemd runlevel: 5 Compilers:
    gcc: 7.3.0 Shell: bash v: 4.4.19 inxi: 3.0.27
Thank You for any help with this problem.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Linux Mint 21.2 Victoria
Always =updatedb=
GNU/LINUX
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Setting modified 'xrandr' resolution to stay after boot?

Post by AndyMH »

Put your newmode and addmode commands into your .profile file (hidden lives in /home/you). Alternatively if you want to set the resolution earlier in the boot cycle, i.e. before the login screen then read this thread (it's quite long) viewtopic.php?f=46&t=280143&p=1547499&h ... e#p1547499. I had a similar problem.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
panorain
Level 5
Level 5
Posts: 572
Joined: Mon Dec 16, 2013 3:21 pm

Re: Setting modified 'xrandr' resolution to stay after boot?

Post by panorain »

@AndyMH, thanks for your response. Adding my received newmode and addmode commands to /home/ME/.profile and then saving did not seem to work. Initially after modifying the file and rebooting MATE loaded with an error message concerning xrandr. I did end up 'commenting out ' the lines I had added. Then I procedded to reboot 2 times. First being after removing the #xrandr --output VGA1 --mode 1904x1200_60.0 line and seeing that did not help and then rebooting again.

Example of my current /home/ME/.profile file below:
  • # ~/.profile: executed by the command interpreter for login shells.
    # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
    # exists.
    # see /usr/share/doc/bash/examples/startup-files for examples.
    # the files are located in the bash-doc package.

    # the default umask is set in /etc/profile; for setting the umask
    # for ssh logins, install and configure the libpam-umask package.
    #umask 022

    # if running bash
    if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
    fi

    # set PATH so it includes user's private bin if it exists
    if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
    fi

    # set PATH so it includes user's private bin if it exists
    if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
    fi
    #xrandr --newmode "1904x1200_60.00" 191.00 1904 2032 2232 2560 1200 1203 1213 1245 -hsync +vsync
    #xrandr --addmode VGA1 1904x1200_60.00
    #xrandr --output VGA1 --mode 1904x1200_60.0
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


~$

Code: Select all

cvt 1900 1200
# 1904x1200 59.93 Hz (CVT) hsync: 74.61 kHz; pclk: 191.00 MHz
Modeline "1904x1200_60.00" 191.00 1904 2032 2232 2560 1200 1203 1213 1245 -hsync +vsync
~$

Code: Select all

xrandr --newmode "1904x1200_60.00"  191.00  1904 2032 2232 2560  1200 1203 1213 1245 -hsync +vsync
~$

Code: Select all

xrandr --addmode VGA1 1904x1200_60.00
~$ xrandr --output VGA1 --mode 1904x1200_60.00
~$ xrandr
Screen 0: minimum 8 x 8, current 1904 x 1200, maximum 32767 x 32767
VGA1 connected primary 1904x1200+0+0 (normal left inverted right x axis y axis) 700mm x 390mm
1366x768 59.81 +
1024x768 75.03 70.07 60.00
800x600 72.19 75.00 60.32
640x480 75.00 59.94
720x400 70.08
1904x1200_60.00 59.93*
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
~$

The commands above do in fact switch the resolution to 1904 x 1200.

Before reviewing the link you sent ----> viewtopic.php?f=46&t=280143&p=1547499&h ... e#p1547499

I figured to send this post out and ask again if there is something that I may have missed?

Thank you
Linux Mint 21.2 Victoria
Always =updatedb=
GNU/LINUX
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Setting modified 'xrandr' resolution to stay after boot?

Post by AndyMH »

Clutching at straws, do you need double quotes?

From:

Code: Select all

xrandr --addmode VGA1 1904x1200_60.00
xrandr --output VGA1 --mode 1904x1200_60.0
To:

Code: Select all

xrandr --addmode VGA1 "1904x1200_60.00"
xrandr --output VGA1 --mode "1904x1200_60.0"
If it worked 'manually' and you copied those lines into .profile it should work :(
rebooting MATE loaded with an error message concerning xrandr
Can you post the error message.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
panorain
Level 5
Level 5
Posts: 572
Joined: Mon Dec 16, 2013 3:21 pm

Re: Setting modified 'xrandr' resolution to stay after boot?

Post by panorain »

@AndyMH, I did change the file to the following. ---->
  • # ~/.profile: executed by the command interpreter for login shells.
    # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
    # exists.
    # see /usr/share/doc/bash/examples/startup-files for examples.
    # the files are located in the bash-doc package.

    # the default umask is set in /etc/profile; for setting the umask
    # for ssh logins, install and configure the libpam-umask package.
    #umask 022

    # if running bash
    if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
    fi

    # set PATH so it includes user's private bin if it exists
    if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
    fi

    # set PATH so it includes user's private bin if it exists
    if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
    fi
    xrandr --addmode VGA1 "1904x1200_60.00"
    xrandr --output VGA1 --mode "1904x1200_60.0"
I did take a photo of the 'xrandr' error message that I am receiving now when MATE loads.
IMG_20190312_153405.jpg
I apologize it's a bit blurry but loading in a seperate tab makes the image much more legiable.

Edit: It was mentioned to me that I do want to edit the .profile file to 'reflect an actual mode' would that mean adding all the following lines and not just the 2 lines being mentioned above by chance?

cvt 1900 1200
xrandr --newmode "1904x1200_60.00" 191.00 1904 2032 2232 2560 1200 1203 1213 1245 -hsync +vsync
xrandr --addmode VGA1 1904x1200_60.00
xrandr --output VGA1 --mode 1904x1200_60.00

Thank you
Linux Mint 21.2 Victoria
Always =updatedb=
GNU/LINUX
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Setting modified 'xrandr' resolution to stay after boot?

Post by AndyMH »

The reason that you got the error in the piccy is that you were missing the --newmode line in .profile.

Assuming the modeline and resolutions were correct, adding:

Code: Select all

xrandr --newmode "1904x1200_60.00" 191.00 1904 2032 2232 2560 1200 1203 1213 1245 -hsync +vsync
xrandr --addmode VGA1 "1904x1200_60.00"
xrandr --output VGA1 --mode "1904x1200_60.00"
at the end of your .profile file should work.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Setting modified 'xrandr' resolution to stay after boot?

Post by catweazel »

AndyMH wrote: Wed Mar 13, 2019 5:06 am The reason that you got the error in the piccy is that you were missing the --newmode line in .profile.

Assuming the modeline and resolutions were correct, adding:

Code: Select all

xrandr --newmode "1904x1200_60.00" 191.00 1904 2032 2232 2560 1200 1203 1213 1245 -hsync +vsync
xrandr --addmode VGA1 "1904x1200_60.00"
xrandr --output VGA1 --mode "1904x1200_60.00"
at the end of your .profile file should work.
Impressive.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Setting modified 'xrandr' resolution to stay after boot?

Post by AndyMH »

Just trying to do my bit having had similar problems in the past :D
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Setting modified 'xrandr' resolution to stay after boot?

Post by catweazel »

AndyMH wrote: Wed Mar 13, 2019 7:42 am Just trying to do my bit having had similar problems in the past :D
Well, I thought it was great support.

Cheers.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Setting modified 'xrandr' resolution to stay after boot?

Post by AndyMH »

BTW nice to see you posting regularly again. You went quiet for a while. You were one of those that helped me out in my early days with mint. :)
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
panorain
Level 5
Level 5
Posts: 572
Joined: Mon Dec 16, 2013 3:21 pm

Re: Setting modified 'xrandr' resolution to stay after boot?

Post by panorain »

I appreciate your help it seems I am on a better track now. I don't want to keep pressing the issue but it just doesn't take. After typing the password in the splash screen the mouse cursor does look like the correct smaller resolution for a second but when Desktop wallpaper comes up display output is still in the 1366x768 resolution. Until I manually enter the following 1. line into terminal ---->

Code: Select all

 xrandr --output VGA1 --mode 1704x1000_60.00 
then it changes.

Code: Select all

xrandr
Screen 0: minimum 8 x 8, current 1704 x 1000, maximum 32767 x 32767
VGA1 connected primary 1704x1000+0+0 (normal left inverted right x axis y axis) 700mm x 390mm
1366x768 59.81 +
1704x1000 59.89
1024x768 75.03 70.07 60.00
800x600 72.19 75.00 60.32
640x480 75.00 59.94
720x400 70.08
1704x1000_60.00 59.89*
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

/etc/username/.profile

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
cvt 1700 1000
xrandr --newmode "1704x1000_60.00" 140.75 1704 1808 1984 2264 1000 1003 1013 1038 -hsync +vsync
xrandr --addmode VGA1 1704x1000_60.00
xrandr --output VGA1 --mode 1704x1000_60.00

I don't want to make anyone upset or pick on me. So it can just be dropped at this point. I am upset enough about trying to get it to work at this point right now.

Your support has been great and I appreciate it thanks.
Linux Mint 21.2 Victoria
Always =updatedb=
GNU/LINUX
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Setting modified 'xrandr' resolution to stay after boot?

Post by roblm »

Use the 3 xrandr commands in the Terminal for the 1900x1200 mode. They should also be in the .profile file.

Open the Display program and click Apply, which saves the new mode settings in the monitors.xml file. Log out and back in.

If that doesn’t work, use this command to remove the monitors.xml file. A new one is created when a change is made in the Display program: rm ~/.config/monitors.xml

Repeat the steps above.


EDITED: actually only the first 2 commands need to be added to .profile.
Last edited by roblm on Thu Mar 21, 2019 4:33 pm, edited 1 time in total.
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Setting modified 'xrandr' resolution to stay after boot?

Post by AndyMH »

Open the Display program and click Apply, which saves the new mode settings in the monitors.xml file.
I've just learnt something. Thanks :D
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
panorain
Level 5
Level 5
Posts: 572
Joined: Mon Dec 16, 2013 3:21 pm

Re: Setting modified 'xrandr' resolution to stay after boot?

Post by panorain »

@roblm, yes in fact that did work.

I had tried the following which did cause Mate desktop to open in the modified resolution but it's not the correct way to do so:

Menu -> Preferences -> Startup Applications -> Add ->

Name: Resolution 1900x1200
Command: xrandr --output VGA1 --mode 1904x1200_60.00
Comment: Increase Screen Resolution

It's nice to have had the help and support with this issue. The monitor display at least for me; is much better than the default 1366x768 setting now.

Thank You. :mrgreen:
Linux Mint 21.2 Victoria
Always =updatedb=
GNU/LINUX
User avatar
panorain
Level 5
Level 5
Posts: 572
Joined: Mon Dec 16, 2013 3:21 pm

Re: Setting modified 'xrandr' resolution to stay after boot?

Post by panorain »

AndyMH wrote: Tue Mar 12, 2019 6:12 am Put your newmode and addmode commands into your .profile file (hidden lives in /home/you). Alternatively if you want to set the resolution earlier in the boot cycle, i.e. before the login screen then read this thread (it's quite long) viewtopic.php?f=46&t=280143&p=1547499&h ... e#p1547499. I had a similar problem.
Just wanted to add that I spent some time reading your post today AndyMH. I should have done that from the beginning.

Thank You again.
Linux Mint 21.2 Victoria
Always =updatedb=
GNU/LINUX
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Setting modified 'xrandr' resolution to stay after boot? [Solved]

Post by AndyMH »

Menu -> Preferences -> Startup Applications -> Add ->
I did think about suggesting that.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Locked

Return to “Graphics Cards & Monitors”