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?

link|improve this question
feedback

1 Answer

up vote 3 down vote accepted

.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.

link|improve this answer
Heh. I should have assumed that from the name. Got it fixed now. Thanks! – TaylorOtwell Jul 7 '11 at 17:46
Ya should mark Lekensteyn's post as the answer then – Thomas Ward Jul 7 '11 at 17:57
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.