[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[i3] [xrandr] xrandr cannot find output modes when execed on startup by i3

I've just upgraded from Stretch to Buster. I use a xrandr script invoked by i3 on startup to set screen layout. Here is the fragment of my config responsible for that:

	# set multimonitor screen layout & background
	exec --no-startup-id setscreenlayout && setbg

`setscreenlayout` is just this:


	if [ -f ~/.screenlayout/default.sh ]; then

And `~/.screenlayout/default.sh` is this:

	xrandr --output HDMI1 --primary --mode 3840x2160 --pos 0x0 \
		--rotate normal --output DP1 --off --output eDP1 \
		--off --output VIRTUAL1 --off

It used to work in Stretch, but after the upgrade xrandr prints this to stderr:

	xrandr: Output DP1 is not disconnected but has no modes
	xrandr: cannot find mode 3840x2160

And everything stays as if xrandr was never run. When I run the script `setscreenlayout` manually (from the terminal) later, it works. When I add `xrandr >/dev/null` just after `#!/bin/sh` in `~/.screenlayout/default.sh`, it works. However, it's clear that something is broken.

I'm not sure which package (i3 vs xrandr) I should report a bug against.

On a related note, I have a Python script which prints on subsequent lines (without any delay) the titles of subsequently focused windows. I use it to print the title of the currently focused window in i3bar. But now it doesn't work when it's invoked by i3blocks when i3 starts. It starts working again after I restart the i3 session in place. The script (something I found on Stack Overflow and tweaked a little bit):


I prints the following to stderr:

Traceback (most recent call last):
  File "/home/yakubin/.scripts/statusbar/window-title", line 100, in <module>
  File "/home/yakubin/.scripts/statusbar/window-title", line 29, in get_active_window
AttributeError: 'NoneType' object has no attribute 'value'

Perhaps these two problems have a common cause?


Reply to: