LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 08-05-2020, 09:30 AM   #1
Rhyader
LQ Newbie
 
Registered: Jun 2020
Posts: 13

Rep: Reputation: Disabled
How can I change screen resolution via the shell?


More video problems...

I got a new monitor. After connecting it, it worked and I was offered higher resolution choices in the GUI settings dialog. I choose the highest one. It looked great. I said to accept this choice. It worked. Until the next time I booted. Now every time suse tries to go into graphical mode the screen is completely unreadable. I can use control-alt-F1 or control-alt-F2 to get a plain command line, but I cannot use anything GUI. Also, I CAN log on as root in either the GUI mode or text. How can I reset the screen resolution for "rhyader"? Can I do it from the command line as rhyader? Can I do it in the GUI as root?

xrandr does not work. It says "can't open display".
 
Old 08-05-2020, 09:47 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,837

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
how did you try xrandr at all?
Would be nive to give us some details (about your hardware, os ...)
 
1 members found this post helpful.
Old 08-05-2020, 02:34 PM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Rhyader View Post
How can I reset the screen resolution for "rhyader"? Can I do it from the command line as rhyader?
Yes, try to blindly type in the xrandr command:
Code:
xrandr --output HDMI-2 --mode 1024x768
replace output and mode values with what is appropriate.
Otherwise, you can log into command line (not root) and try to remove configuration files until you hit the correct one.
Or, you can boot with 'nomodeset' (please do a web search onhow to do that), fix what you need to fix, and boot normally again.

Quote:
Can I do it in the GUI as root?
No.
 
Old 08-05-2020, 08:25 PM   #4
Rhyader
LQ Newbie
 
Registered: Jun 2020
Posts: 13

Original Poster
Rep: Reputation: Disabled
To Pan64:
If you hit control-alt-F1 or control-alt-F2 you can escape the GUI. But in this mode xrandr does not seem to work correctly. It says "can't open display".

To ondoho:
I will try some xrandr commands, but I get the impression that that program won't work in non-graphical mode. And no, I cannot type blindly. How would I bring up a terminal window? And if I could I could't see it anyway.

I don't think it sounds like a good idea to randomly remove files when I don't know what I'm doing. I tried editing an .xml file to replace resolution numbers but that did not work.

nomodeset is another foreign word to me. Looks like more hours of research to find out what that is and what I need to fix and how to fix it. Not enough time for that today.

OR... here's an idea... maybe should I just create a new user? That would take less time than trying to fix this. I should be able to do that if I log on as root.
 
Old 08-06-2020, 02:06 AM   #5
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,805
Blog Entries: 1

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
Xrandr only works from within a running X session that has already opened a "display". To apply xrandr as a session starts up, create a file in /etc/X11/xinit/xinitrc.d/ and put in it the xrandr command you wish to run.

Nomodeset explained.

Your DE or WM has apparently saved a configuration in some fashion that is incompatible with your new display. First thing to try is to delete all content from ~/.cache/ from a login from e.g. Ctrl-Alt-F3. If it doesn't help, then the incompatible setting is probably somewhere in ~/.config/. You could delete the entire content of that directory just as tried with ~/.cache/, but it would delete most custom settings. This would be similar to creating a new user, without the hassle of creating a new user, but not deleting any Thunderbird, Palemoon or Firefox settings, or settings of certain other apps, so should be less painful than trying to migrate to the new user if the new user works as expected.

Last edited by mrmazda; 08-07-2020 at 03:28 AM.
 
Old 08-06-2020, 03:35 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Rhyader View Post
If you hit control-alt-F1 or control-alt-F2 you can escape the GUI. But in this mode xrandr does not seem to work correctly. It says "can't open display".
Aha, so that still works! Good!
You can run xrandr like this:
Code:
DISPLAY=:0 xrandr .........
Assuming the Xorg session is still running when you do that.

And yes, you can try to create a new user.
 
Old 08-07-2020, 02:13 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,837

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
Quote:
Originally Posted by Rhyader View Post
If you hit control-alt-F1 or control-alt-F2 you can escape the GUI. But in this mode xrandr does not seem to work correctly. It says "can't open display".
It does work correctly. Without knowing the DISPLAY you want to use xrandr cannot do anything. It is also reported, (=can't open display).
Additionally X has an authentication system, so "from outside" no one has access to it (that means only the allowed user can use it), for example root (and any other user) has no any permission to display anything or manipulate/configure it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changed screen resolution and now can't see screen to change it back in Ubuntu lmb6832 Linux - Newbie 1 09-28-2010 10:52 PM
Low screen resolution problem: Fedora 7, Via P4M800Pro, Via/S3G Unichrome Pro IGP martin.klvana Linux - Hardware 2 08-26-2007 02:11 PM
change screen resolution of xdm login screen in suse linux anon104 Linux - Desktop 2 04-02-2007 09:26 AM
How do I change screen resolution for Fedora core2's shell? babyboss Fedora 4 10-26-2004 06:32 PM
Knoppix: Can't Change Screen Resolution Supremacy Debian 1 11-14-2003 12:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 08:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration