Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround xrandr bug: "cannot find crtc for output" #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions autorandr
Expand Up @@ -164,6 +164,13 @@ config_equal() {
}

load_cfg_xrandr() {
# Disable all displays first. There is a bug in xrandr where trying to enable a different display
# when two displays are already attached gives the error "cannot find crtc for output" even
# when --off was passed to disable existing displays. If --off is called first as a separate
# command the crtcs are freed up for use.
# https://bugs.freedesktop.org/show_bug.cgi?id=22539
# https://bugs.freedesktop.org/show_bug.cgi?id=29929
$XRANDR | grep -P '(^[^ ]+) (dis)?connected' | sed -r 's/(^[^ ]+).*/--output \1 --off/' | xargs $XRANDR
sed 's!^!--!' "$1" | xargs $XRANDR
}

Expand Down