This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Command to reset or refresh monitors/screens?

Tags: None
(comma "," separated)
skjerns
Registered Member
Posts
2
Karma
0
Even though 5.17.X fixed quite a few bugs when it comes to multiple screens/monitors (finally my icons stay in place after reboot! at least most of the time), there are still some bugs for me, e.g.

1) Third monitor via HDMI gets recognized when I turn it on, but turing it off is not recognized, so an unreachable screen area remains until reboot (it's fine in Windows)
2) When resuming from sleep sometimes a couple of pixels rows are missing from my primary screen and/or the screen is slightly compressed and a few rows of black are shown at the bottom.

I do not want to resort to rebooting everytime this happens. Is there any command I can run to force a redetection of my attached monitors? Or something I can run to "reset" my monitor configuration to a specific setup? For example, if I go to Display configuration, change something and then click "revert changes" instead of accept, bug #2 seems to be fixed.

Is there any command to force a refresh of the monitors without logging in/out? Same like if I would be setting the current settings and click "apply"?

KDE Plasma 5.17.2
Kubuntu 22.10
NVIDIA 1070 with 525 drivers
Kernel: 5.19.0-31
X11
skjerns
Registered Member
Posts
2
Karma
0
Found a solution after searching for hours :)
1. Using `arandr`, save current configuration
2. within the saved script, duplicate the line and change something minor. Only if there are changes applied will the screen actually reset. E.g. change the monitor position by 1 pixel and in the next line use the original configuration. This forces xrandr to reload the configuration.

My script looks like this, once setting the position to 291 and then reverting to 290.

Code: Select all
#!/bin/sh
xrandr --output DVI-D-0 --off --output DP-0 --mode 1920x1080 --pos 1920x0 --rotate left --output DP-1 --off --output HDMI-0 --off --output DP-2 --primary --mode 1920x1200 --pos 0x291 --rotate normal --output DP-3 --off --output DP-4 --off --output DP-5 --off
xrandr --output DVI-D-0 --off --output DP-0 --mode 1920x1080 --pos 1920x0 --rotate left --output DP-1 --off --output HDMI-0 --off --output DP-2 --primary --mode 1920x1200 --pos 0x290 --rotate normal --output DP-3 --off --output DP-4 --off --output DP-5 --off


edit:

turns out, a simple
Code: Select all
xrandr -s 0
also does the trick


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]