Plasma5: I've set a bad screen resolution. Need a CLI command

I have searched this forum and elsewhere but cannot find the answer to what I assume is a trivial question.

What is the CLI command to reset my display resolution? I am running Plasma-5 desktop but when I tried to screen-share with my TV via HDMI, I chose a resolution that crashed my laptop and it now always freezes at the greeter stage of the login. Everything works perfectly if I choose (say) an XFCE session instead of Plasma-5, i.e. the screen res in an XFCE session is correct. But when I log back in using Plasma-5 my laptop freezes as above. Looking in my .conf directory, I see a file called systemsettingsrc, but is that used by Plasma-5? I have experimented with changing some of the values but to no avail.

Edit: I should add that all this happens now without the TV being connected.
Edit again: I get to the CLI after a greeter screen freeze using ctrl-alt-F2 (obvs)

Enumerate the names of all your video outputs, and the possible resolutions for those currently connected to a monitor:

xrandr -q

Choose the name of the output you wish to change the resolution of, and:

xrandr --output <OUTPUT> --mode 1024x768

Note: If running from a text terminal, that is not running in gfx environment, you’ll have to add a -d :0 parameter, i.e:

xrandr -d :0 -q
xrandr -d :0 --output <OUTPUT> --mode 1024x768
1 Like

Many thanks for that. I had tried xrandr but got nowhere because I didn’t use the -d :0 flag. The command x5randr -d :0 -q works, but xrandr -d :0 --output LVDS1 --mode 1024x768 returns:
xrandr: Configure crtc 0 failed
Whereas xrandr -d :0 --output LVDS1 --mode 1280x720 does not fail, but it changes nothing according to x5randr -d :0 -q
I must be doing something stupid.

Here’s my xrandr -d :0 -q output:

Screen 0: minimum 8 x 8, current 1280 x 720, maximum 32767 x 32767
LVDS1 connected primary 1280x720+0+0 (normal left inverted right x axis y axis) 309mm x 174mm
   1366x768      60.20 +
   1280x720      59.74* 
   1024x768      60.00  
   1024x576      60.00    59.90    59.82  
   960x540       60.00    59.63    59.82  
   800x600       60.32    56.25  
   864x486       60.00    59.92    59.57  
   640x480       59.94  
   720x405       59.51    60.00    58.99  
   680x384       60.00  
   640x360       59.84    59.32    60.00  
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

Edit: Apologies, it DID fix my problem!! I thought since the settings hadn’t changed that nothing had happened. But I rebooted and found it was OK. Many thanks!

Talk about :man_facepalming: it DID work for ONE login. Now I am back to the same state, the Plasma-5 greeter just freezes. I don’t seem to be able to set the preferred resolution. If I try to set the 1366x768 resolution I just get xrandr: Configure crtc 0 failed again. The 1280x720 resolution change succeeds but does nothing. For what it’s worth here’s the verbose output:

Screen 0: minimum 8 x 8, current 1280 x 720, maximum 32767 x 32767
LVDS1 connected primary 1280x720+0+0 (0x54c) normal (normal left inverted right x axis y axis) 309mm x 174mm
	Identifier: 0x42
	Timestamp:  62696
	Subpixel:   horizontal rgb
	Gamma:      1.0:1.0:1.0
	Brightness: 1.0
	Clones:    
	CRTC:       0
	CRTCs:      0 1 2
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	BACKLIGHT: 1362 
		range: (0, 4539)
	Backlight: 1362 
		range: (0, 4539)
	scaling mode: Full aspect 
		supported: Full, Center, Full aspect
	link-status: Good 
		supported: Good, Bad
	non-desktop: 0 
		range: (0, 1)
  1366x768 (0x48) 70.720MHz -HSync -VSync +preferred
        h: width  1366 start 1414 end 1446 total 1506 skew    0 clock  46.96KHz
        v: height  768 start  771 end  776 total  780           clock  60.20Hz
  1280x720 (0x54c) 63.750MHz +HSync -VSync *current
        h: width  1280 start 1328 end 1360 total 1440 skew    0 clock  44.27KHz
        v: height  720 start  723 end  728 total  741           clock  59.74Hz
  1024x768 (0x54d) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  1024x576 (0x54e) 46.995MHz -HSync +VSync
        h: width  1024 start 1064 end 1168 total 1312 skew    0 clock  35.82KHz
        v: height  576 start  577 end  580 total  597           clock  60.00Hz
  1024x576 (0x54f) 46.500MHz -HSync +VSync
        h: width  1024 start 1064 end 1160 total 1296 skew    0 clock  35.88KHz
        v: height  576 start  579 end  584 total  599           clock  59.90Hz
  1024x576 (0x550) 42.000MHz +HSync -VSync
        h: width  1024 start 1072 end 1104 total 1184 skew    0 clock  35.47KHz
        v: height  576 start  579 end  584 total  593           clock  59.82Hz
  960x540 (0x551) 40.784MHz -HSync +VSync
        h: width   960 start  992 end 1088 total 1216 skew    0 clock  33.54KHz
        v: height  540 start  541 end  544 total  559           clock  60.00Hz
  960x540 (0x552) 40.750MHz -HSync +VSync
        h: width   960 start  992 end 1088 total 1216 skew    0 clock  33.51KHz
        v: height  540 start  543 end  548 total  562           clock  59.63Hz
  960x540 (0x553) 37.250MHz +HSync -VSync
        h: width   960 start 1008 end 1040 total 1120 skew    0 clock  33.26KHz
        v: height  540 start  543 end  548 total  556           clock  59.82Hz
  800x600 (0x554) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  800x600 (0x555) 36.000MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock  35.16KHz
        v: height  600 start  601 end  603 total  625           clock  56.25Hz
  864x486 (0x556) 32.901MHz -HSync +VSync
        h: width   864 start  888 end  976 total 1088 skew    0 clock  30.24KHz
        v: height  486 start  487 end  490 total  504           clock  60.00Hz
  864x486 (0x557) 32.500MHz -HSync +VSync
        h: width   864 start  888 end  968 total 1072 skew    0 clock  30.32KHz
        v: height  486 start  489 end  494 total  506           clock  59.92Hz
  864x486 (0x558) 30.500MHz +HSync -VSync
        h: width   864 start  912 end  944 total 1024 skew    0 clock  29.79KHz
        v: height  486 start  489 end  494 total  500           clock  59.57Hz
  640x480 (0x559) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz
  720x405 (0x55a) 22.500MHz -HSync +VSync
        h: width   720 start  744 end  808 total  896 skew    0 clock  25.11KHz
        v: height  405 start  408 end  413 total  422           clock  59.51Hz
  720x405 (0x55b) 22.176MHz -HSync +VSync
        h: width   720 start  728 end  800 total  880 skew    0 clock  25.20KHz
        v: height  405 start  406 end  409 total  420           clock  60.00Hz
  720x405 (0x55c) 21.750MHz +HSync -VSync
        h: width   720 start  768 end  800 total  880 skew    0 clock  24.72KHz
        v: height  405 start  408 end  413 total  419           clock  58.99Hz
  680x384 (0x55d) 19.677MHz -HSync +VSync
        h: width   680 start  688 end  752 total  824 skew    0 clock  23.88KHz
        v: height  384 start  385 end  388 total  398           clock  60.00Hz
  640x360 (0x55e) 18.000MHz -HSync +VSync
        h: width   640 start  664 end  720 total  800 skew    0 clock  22.50KHz
        v: height  360 start  363 end  368 total  376           clock  59.84Hz
  640x360 (0x55f) 17.750MHz +HSync -VSync
        h: width   640 start  688 end  720 total  800 skew    0 clock  22.19KHz
        v: height  360 start  363 end  368 total  374           clock  59.32Hz
  640x360 (0x560) 17.187MHz -HSync +VSync
        h: width   640 start  640 end  704 total  768 skew    0 clock  22.38KHz
        v: height  360 start  361 end  364 total  373           clock  60.00Hz
DP1 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x43
	Timestamp:  62696
	Subpixel:   unknown
	Clones:    
	CRTCs:      0 1 2
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	Colorspace: Default 
		supported: Default, RGB_Wide_Gamut_Fixed_Point, RGB_Wide_Gamut_Floating_Point, opRGB, DCI-P3_RGB_D65, BT2020_RGB, BT601_YCC, BT709_YCC, XVYCC_601, XVYCC_709, SYCC_601, opYCC_601, BT2020_CYCC, BT2020_YCC
	max bpc: 12 
		range: (6, 12)
	Broadcast RGB: Automatic 
		supported: Automatic, Full, Limited 16:235
	audio: auto 
		supported: force-dvi, off, auto, on
	subconnector: Unknown 
		supported: Unknown, VGA, DVI-D, HDMI, DP, Wireless, Native
	link-status: Good 
		supported: Good, Bad
	non-desktop: 0 
		range: (0, 1)
HDMI1 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x44
	Timestamp:  62696
	Subpixel:   unknown
	Clones:     VGA1
	CRTCs:      0 1 2
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	max bpc: 12 
		range: (8, 12)
	content type: No Data 
		supported: No Data, Graphics, Photo, Cinema, Game
	Colorspace: Default 
		supported: Default, SMPTE_170M_YCC, BT709_YCC, XVYCC_601, XVYCC_709, SYCC_601, opYCC_601, opRGB, BT2020_CYCC, BT2020_RGB, BT2020_YCC, DCI-P3_RGB_D65, DCI-P3_RGB_Theater
	aspect ratio: Automatic 
		supported: Automatic, 4:3, 16:9
	Broadcast RGB: Automatic 
		supported: Automatic, Full, Limited 16:235
	audio: auto 
		supported: force-dvi, off, auto, on
	link-status: Good 
		supported: Good, Bad
	non-desktop: 0 
		range: (0, 1)
VGA1 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x45
	Timestamp:  62696
	Subpixel:   unknown
	Clones:     HDMI1
	CRTCs:      0 1 2
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	link-status: Good 
		supported: Good, Bad
	non-desktop: 0 
		range: (0, 1)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x46
	Timestamp:  62696
	Subpixel:   no subpixels
	Clones:    
	CRTCs:      3
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	non-desktop: 0 
		supported: 0, 1

You may want to wade through this:
https://searx.be/search?q=plasma%20ignoring%20xrandr%20settings&categories=general

Some potential directions:

In case, nvidia is used:

What happens, when you type this in a terminal?
kscreen-doctor -i

My VM output looks like this:

kscreen-doctor -i

Environment:

  • KSCREEN_BACKEND : [not set]
  • KSCREEN_BACKEND_INPROCESS : [not set]
  • KSCREEN_LOGGING : [not set]
    Logging to : [logging disabled]
    Preferred KScreen backend : KSC_XRandR.so
    Available KScreen backends:
  • KSC_Fake.so: /usr/lib/qt/plugins/kf5/kscreen/KSC_Fake.so
  • KSC_KWayland.so: /usr/lib/qt/plugins/kf5/kscreen/KSC_KWayland.so
  • KSC_QScreen.so: /usr/lib/qt/plugins/kf5/kscreen/KSC_QScreen.so
  • KSC_XRandR.so: /usr/lib/qt/plugins/kf5/kscreen/KSC_XRandR.so
  • KSC_XRandR11.so: /usr/lib/qt/plugins/kf5/kscreen/KSC_XRandR11.so

Good luck from my end… :v:

OK, thanks, I’ll have a wade. kscreen-doctor -i errored with
qt.qpa.xcb: couldn't connect to display
No Qt platform plugin could be initialized
(core dumped)

Could that point to a faulty plasma-installation? Do you have any additional DEs or WMs installed on your system?

If not, what is your graphic card driver in use?

I have XFCE and Cinnamon but until I mucked around trying to connect a TV screen and setting the screen sizes so that it reasonably mirrored the two screens (laptop and TV), plasma was fine. I’ve used kde/plasma since I can remember.

Graphics card is the Intel standard thing on-board. This is a very old laptop but it’s odd that it went wrong exactly when I was setting the graphics resolution.

Oh well, mixing Plasma (Qt) with XFCE and Cinnamon (both GTK) isn’t a good idea at all for various reasons that can make the system unstable… sorry to say.

So in that case, I’d try to see what happens in XFCE / Cinnamon and if it works there without issues, I’d rid the system of the Pasma-DE…
Just a suggestion.

Or you could do the opposite, but before ridding your machine off the GTK-DEs, please make sure you have a completely working Plasma installation!

If I didn’t have XFCE I couldn’t be writing this! So it does have some use. But I have always had these installed and never had a problem before. Don’t worry, I’ll read the links you provided, it may take me a day or so to respond now.

1 Like

While you were posting: Still edited my last post (see above).

:v:

Many thanks, I will try those suggestions. I’m very grateful for your help.

1 Like

Also, @rogerp please take a look here and here.

:v:

Yes.
Delete this file and also this folder:

$HOME/.local/share/kscreen

They will be recreated on Plasma login. It’s like a reset on display settings.

1 Like

Hi @petsam many thanks!! Just out of interest, I did the two separately:

  1. I deleted systemsettingsrc but it didn’t get recreated when I attempted to login under Plasma-5. The original problem still persisted.
  2. I deleted the
$HOME/.local/share/kscreen

directory – this cured the problem.

I have now rebooted, shutdown and restarted, logged in and logged out and whatever I try it now seems to work. Thank you very much indeed. Sometimes the intricacies of Linux, especially graphics, are completely beyond me. @malapetsasc and @anon11595408 – many thanks for your help!

It will, when you make some modifications in a relevant setting. This file was not the cause of the issue, but it keeps names of the monitors and some properties, so deleting was suggested for a complete reset.

This folder and its files keep all the monitor settings, and is known to require a deletion when such issues come up.

We all hope for Plasma 5.27 to end these issues for good. :person_shrugging:

Great self-solved! :rofl:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.