#xrandr doesnt run in .xinitrc

8 messages · Page 1 of 1 (latest)

soft grail
#

newbie here
this is my .xinitrc
exec dwm sleep 2 xrandr --output HDMI-1-0 --mode 1920x1080 --rate 180 xrandr --output eDP-1 --off
the xrandr commands work correctly. Can someone tell me what am i doing wrong?

marble stream
#

you should put all the commands you want to run before your exec command

lost kite
# soft grail newbie here this is my .xinitrc `exec dwm sleep 2 xrandr --output HDMI-1-0 --mod...

When the shell ran exec dwm, the shell's instance was replaced by the command dwm, that's what the exec command does.
Hence, anything that came after the exec line was not processed by the shell.
You could write it like this,
exec sleep 2 && xrandr --output HDMI-1-0 --mode 1920x1080 --rate 180 && xrandr --output eDP-1 --off && dwm
as Andy suggested, just putting the lines before the exec line is easiest.

marble stream
#

also if you need to run something that's supposed to run for a long time, like flameshot, you can write it like this flameshot &, the ampersand makes it run in the background

#

but i dont think xrandr commands need that

tired pine
lost kite
#

yeah my bad