1

In ~/.profile I run a script in the background (redshift for changing the screen temperature at night time).

After logging in, I can open a terminal, and run tmux.

However, at this point, redshift visibly gets interrupted as the screen temperature resets and it seems that redshift starts again in this terminal.

What's happening here? I get the impression that ~/.profile is for each shell, and gets parsed again when I run tmux. Could this be?

1 Answer 1

5

As explained in 6.2 Bash Startup Files, ~/.profile is executed when you start an interactive login shell (or use the --login option). Since tmux's default behavior is to start a login shell in each new window, your profile is being executed again.

Probably the simplest thing to do is change your script to determine whether redshift is running, and start it only if necessary.

1
  • Thanks, and just for the record I edited my script as shown here.
    – eoinoc
    Feb 26, 2012 at 13:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .