Since I upgraded from Ubuntu 21.04 to 21.10, my screen doesn't turn back on when reawakening my desktop PC from sleep mode. I then have to perform a hard reset to get my PC into working order again.
I use xrandr
to switch between a single and dual monitors, so I thought maybe that causes the issue. And indeed, when I set the display settings through the GUI (Settings -> Displays) instead of using xrandr
, it works*, i.e. the display wakes up from sleep normally. NOT THE CASE ANYMORE, see edit.
However, as soon as I set the display settings with xrandr
, I will be faced with a black screen when waking the PC back up from sleep mode.
I use xrandr
, because I can't switch between dual and single displays using Super
+P
(options are "Mirror", "Join Displays", "External Only", and "Built-in Only", but all three latter options activate both displays). Therefore I'd like to keep using it or find an alternative.
Here are my scripts for switching:
"single.sh":
#!/bin/sh
xrandr --output DVI-I-0 --off --output DVI-I-1 --off --output DP-0 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP-1 --off --output HDMI-0 --off --output DVI-D-0 --off
"dual.sh":
#!/bin/sh
xrandr --output DVI-I-0 --off --output DVI-I-1 --off --output DP-0 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP-1 --off --output HDMI-0 --off --output DVI-D-0 --mode 1600x1200 --pos 1920x46 --rotate normal
"toggle.sh":
#!/bin/bash
TOGGLE=$HOME/.screenlayout/.toggle
DIR=$(dirname "$0")
if [ ! -e $TOGGLE ]; then
touch $TOGGLE
$DIR/single.sh
else
rm $TOGGLE
$DIR/dual.sh
fi
*EDIT: It worked with a single display, but I still wanted to test it for dual displays.
But while I was writing my question, an update to the nvidia drivers was released, so I thought that maybe that'll fix the whole thing. However, instead, now it doesn't work even with a single display anymore. Now sleep mode means hard reset.
Removed the xrandr
tag for that reason.
EDIT2: My system: Ryzen 2700, GeForce 950. Output of lspci -v | grep -i vga
:
0a:00.0 VGA compatible controller: NVIDIA Corporation GM206 [GeForce GTX 950] (rev a1) (prog-if 00 [VGA controller])
0 Answers