Having to type in Xrandr commands every time i start up

When i boot my computer the os sets all my sceens to 60 hrz, though, i have a 240 hrz main monitor.
The commands i have to run everytime:
xrandr --output DP-1 --left-of DP-2
xrandr --output HDMI-0 --right-of DP-2
xrandr --output DP-2 --mode 1920x1080 --rate 240

Same with nitrogen, it resets itself. so the background disperses
Is there a way i can make this be saved? So i don’t have to type it everytime?

No expertise here - but I would first run arandr. It can save the results of your tweaking, and should automatically restore them on startup. At least - it seems to do so with my setup, which is rather less complex (2 monitors, different res, positioned to the side, and one rotated).

Hope this helps…

$xrandr --output HDMI2 --auto --left-of eDP1
$autorandr --save workstation1

first check the name of your output monitor, then enable it, then save the config so next time it is recognized.

workstation1 is a custom name you can choose any.


and in i3wm I add the following to .iconfig/i3/config

exec_always autorandr --change

add a script to


might do the trick. Then it will run every boot. In your case the script would of course be:

xrandr --output DP-1 --left-of DP-2
xrandr --output HDMI-0 --right-of DP-2
xrandr --output DP-2 --mode 1920x1080 --rate 240

Don’t forget to set the correct permissons, as that is annoying to forget.

(edited: #1 for clarity, #2 for typo in path to destination)

Thank you, it worked.

1 Like

I suspect they all work - just choose the one you like most! :grin:

the nice thing about autorandrd save is that one can configure a setting at home, at work, etc… without the need to write any script and it is saved and recognized.

1 Like

Yup - as far as I know that is what arandr does, just with a GUI so you don’t need to remember the -switches! Of course - YMMV…

1 Like