You are not logged in.

#1 2021-07-04 09:12:06

Vanimion
Member
Registered: 2021-07-04
Posts: 4

I3 config not automatically changing screen resolution

By default my screen resolution is wrong, so I put three lines of code in i3 config to fix the issue, but it doesn't seem to work for some reason.

Here's the code:

exec xrandr --newmode "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
exec xrandr --addmode "Virtual1" 1920x1080_60.00
exec_always xrandr --output "Virtual1" --mode 1920x1080_60.00

Offline

#2 2021-07-04 13:47:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,441

Re: I3 config not automatically changing screen resolution

You're better off doing this in your session script *before* running i3, however: how do you determine it's not executed?
Does the new mode show up in "xrandr -q"?
Is the config executed in general? Eg. does "exec_always touch /tmp/i3.touch" create and update the timestamps of that file?

Offline

#3 2021-07-05 04:05:15

Vanimion
Member
Registered: 2021-07-04
Posts: 4

Re: I3 config not automatically changing screen resolution

It doesn't work because it's supposed to enter the mode. Also, when I enter xrandr -q the new mode doesn't show up for some reason - even though these exact commands work perfectly when I write them myself in the terminal

Last edited by Vanimion (2021-07-05 04:05:28)

Offline

#4 2021-07-05 05:34:30

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,441

Re: I3 config not automatically changing screen resolution

when I enter xrandr -q the new mode doesn't show up for some reason

seth wrote:

Is the config executed in general? Eg. does "exec_always touch /tmp/i3.touch" create and update the timestamps of that file?

seth also wrote:

You're better off doing this in your session script *before* running i3

Offline

#5 2021-07-07 06:56:20

Vanimion
Member
Registered: 2021-07-04
Posts: 4

Re: I3 config not automatically changing screen resolution

Yes, the config is executed in general, because I have other code in the config file that actually works. It seems to just be these three lines that are not doing anything.
I tried to run the script on startup with systemd, but it didn't work and just ended up saying "Can't open display" three times over.

Offline

#6 2021-07-07 07:33:10

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,441

Re: I3 config not automatically changing screen resolution

Please post your i3config.
You can only run this after the X11 server is up, eg. in some DM script or your xinitrc (before running i3) -> how do you start i3?

Offline

#7 2021-07-07 09:18:05

fistrosan
Member
Registered: 2020-04-01
Posts: 171

Re: I3 config not automatically changing screen resolution

Does it work when you run those commands (i.e. without exec) in the terminal ?

Also, you might want to edit your /etc/X11/xorg.conf.d/##-monitor.conf so that you don't have to add a new mode everytime.

Note: in my i3 config (right on top) I have an exec ~/.screenlayout/set_display.sh where the script was produced by "arandr". It works everytime.

Offline

Board footer

Powered by FluxBB