3

I have the following in my .bashrc file...

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# multi-monitor configuration
xrandr --output HDMI1 --mode 1920x1080 --pos 0x0 --rotate normal --output DP1 --off --output VGA1 --mode 1600x900 --pos 1920x0 --rotate normal

When I login, my monitors are mirrored and are at a bad resolution, making me believe this did not run. However, the first time I open a terminal after logging in, my monitors adjust the proper resolution and extend properly.

Why does this .bashrc file seem to be running only after I open a terminal? I was under the impression it runs when I login. How can I get it to do so?

TaylorOtwell
  • 2,095

1 Answers1

5

.bashrc (as it name may suggest) is only executed on startup of a bash shell.

You have to edit ~/.profile to apply changes to your graphical session. Note that this file is intended for setting environment variables and such. You'd better create a startup script to accomplish this task.

Lekensteyn
  • 174,277