Page 1 of 2

Changing video resolution manually (Resolved)

Posted: Tue May 14, 2019 11:34 am
by GELvdH
How do I change the video resolution when the desired resolution is not available in the 'Display" settings?
I am running linux mint 19.1 and have a VISIO 22" display.

Re: Changing video resolution manually

Posted: Tue May 14, 2019 12:54 pm
by kukamuumuka
You can use xrandr commands. An example:
https://puolanka.info/goto/set-custom-r ... on-xrandr/

Re: Changing video resolution manually

Posted: Tue May 14, 2019 1:04 pm
by GELvdH
https://puolanka.info/goto/set-custom-r ... on-xrandr/
Unfortunately that did not work, No such file or directory "puolanka.info"

Re: Changing video resolution manually

Posted: Tue May 14, 2019 1:06 pm
by kukamuumuka
GELvdH wrote:
Tue May 14, 2019 1:04 pm
https://puolanka.info/goto/set-custom-r ... on-xrandr/
Unfortunately that did not work, No such file or directory "puolanka.info"
It is a www-link. Open it using browser.

Re: Changing video resolution manually

Posted: Tue May 14, 2019 1:27 pm
by GELvdH
My bad, getting so used to doing things in the terminal.

Re: Changing video resolution manually

Posted: Tue May 14, 2019 1:36 pm
by GELvdH
That is very nice except I can't read Finish. Any other ideas?

Re: Changing video resolution manually

Posted: Tue May 14, 2019 1:55 pm
by kukamuumuka
GELvdH wrote:
Tue May 14, 2019 1:36 pm
That is very nice except I can't read Finish. Any other ideas?
I have always wondered that strange language. :lol:
finnish.. or what.png

Re: Changing video resolution manually

Posted: Tue May 14, 2019 4:23 pm
by GELvdH
Typed in the command line and got these results.
gunter@Gunter-Desktop-1:~$ cvt 1368 768
# 1368x768 59.88 Hz (CVT) hsync: 47.79 kHz; pclk: 85.25 MHz
Modeline "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync
gunter@Gunter-Desktop-1:~$ xrandr --newmode "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync
X Error of failed request: BadName (named color or font does not exist)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 16 (RRCreateMode)
Serial number of failed request: 33
Current serial number in output stream: 33
gunter@Gunter-Desktop-1:~$ xrandr --addmode VGA-1 1368x768_60.00
xrandr: cannot find output "VGA-1"
gunter@Gunter-Desktop-1:~$

Re: Changing video resolution manually

Posted: Tue May 14, 2019 6:10 pm
by kukamuumuka
GELvdH wrote:
Tue May 14, 2019 4:23 pm
xrandr --addmode VGA-1 1368x768_60.00
xrandr: cannot find output "VGA-1"
xrandr command tells your output.

Re: Changing video resolution manually

Posted: Tue May 14, 2019 7:10 pm
by GELvdH
Outstanding, it works.
Dank schoen, gracias, mercie bocou, domo arigato, thanks, etc.

Re: Changing video resolution manually

Posted: Tue May 14, 2019 9:28 pm
by GELvdH
You had mentioned to put the resolution command into a script file and add it to the startup commands. I know how to write a DOS batch file but how do you create an executable script in linux?

Re: Changing video resolution manually

Posted: Wed May 15, 2019 8:12 am
by kukamuumuka
GELvdH wrote:
Tue May 14, 2019 9:28 pm
You had mentioned to put the resolution command into a script file and add it to the startup commands. I know how to write a DOS batch file but how do you create an executable script in linux?

Code: Select all

xed RESO
... the contents

Code: Select all

#! /bin/sh
xrandr --newmode "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync
xrandr --addmode your_output_here 1368x768_60.00
xrandr -s 1368x768
xrandr command told your output
... save and quit and run

Code: Select all

chmod +x RESO
... and add RESO to the startup applications.

Re: Changing video resolution manually

Posted: Wed May 15, 2019 9:42 pm
by GELvdH
OK, I entered the lines you sent with RESO, saved it as "RESO" in the HOME directory.

#! /bin/sh
xrandr --newmode "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync
xrandr --addmode VGA-0 1368x768_60.00
xrandr -s 1368x768

Went to Startup Applications and added the RESO startup with the following command line.

chmod +x RESO

Re-started the system, no luck. I can enter the commands manually and it works fine, what am I missing?

Re: Changing video resolution manually

Posted: Thu May 16, 2019 1:56 am
by kukamuumuka
Check that RESO is into startup applications

Code: Select all

cat $HOME/.config/autostart/RESO.desktop
If it is ok, open displays and set 1368x768 as the default resolution.

Re: Changing video resolution manually

Posted: Thu May 16, 2019 7:21 am
by GELvdH
Thanks for all the help and patience.

Re: Changing video resolution manually

Posted: Sat May 18, 2019 10:15 pm
by GELvdH
OK, I entered these lines exactly as you sent,
#! /bin/sh
xrandr --newmode "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync
xrandr --addmode your_output_here 1368x768_60.00
xrandr -s 1368x768
into reso. I saved them to the desktop since the command you had sent to put into the Startup Applications but it still will not retain the new video mode.
I can copy and paste the "#! /bin/sh etc" commands manually and it works fine it just will not do it automatically.
I feel like a moron asking this again.

Re: Changing video resolution manually

Posted: Fri May 24, 2019 11:17 am
by GELvdH
Still need help with doing the resolution change automatically, would appreciate it if someone has any ideas.
Thanks

Re: Changing video resolution manually

Posted: Sun Jun 09, 2019 10:19 am
by athi
Script is working but not executing during startup, maybe an issue with how script was added to startup programs. Steps to add item to startup programs for Mint Mate, Mint Cinnamon should be similar:
1) Select Menu/Control Center/Startup Applications to open Startup Application Preferences window.
2) Select Add to open Add Startup Program window.
3) Enter name in name field, enter note or comment about item/function in the Comment field.
4) Click Browse to open Select Command window, browse to location of program/script, click on program/script to select program/script and click Open to enter path and command in the Command field.
5) Click Add to add item to Startup Programs list.
6) Scroll to find item and ensure that item is check marked.

Re: Changing video resolution manually

Posted: Fri Aug 09, 2019 9:55 pm
by GELvdH
Hi athi, if you are still around. I tried to create a file with the commands in it and start it with Startup Applications but it does not want to start automatically. These are the commands I typed into a reso file and put on the desktop...
#! /bin/sh
xrandr --newmode "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync
xrandr --addmode VGA-0 1368x768_60.00
xrandr -s 1368x768
I can manually copy and paste those commands into the terminal and it works fine but have not been able to do it automatically.
Any suggestions?

Re: Changing video resolution manually

Posted: Sat Aug 10, 2019 7:07 am
by athi
GELvdH wrote:
Fri Aug 09, 2019 9:55 pm
Hi athi, if you are still around. I tried to create a file with the commands in it and start it with Startup Applications but it does not want to start automatically. These are the commands I typed into a reso file and put on the desktop...
#! /bin/sh
xrandr --newmode "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync
xrandr --addmode VGA-0 1368x768_60.00
xrandr -s 1368x768
I can manually copy and paste those commands into the terminal and it works fine but have not been able to do it automatically.
Any suggestions?
Still around, how is the network working for you? Have not done much shell script, but here goes.

You already tested the commands so you will have to:
1) save it as a .sh file (shell script) in a location that is easy to find for later maintenance. Directory in /home/user/ is always good.
2) make file executable. You can use CLI as tutorial or run chmod +x shellscriptname.sh to make file executable.
3) create a new item in Start Menu and add file to start-up menu.
Link to a tutorial on how to add script file to start menu: https://www.writebash.com/bash-gui/add- ... t-659.html

In this case, file was saved to user home directory, chmod via CLI to add execution rights, and add to Start Menu items.