Your problem is that you are not defining the environment variable TZ
in the right file. ~/.bashrc
is the configuration file for interactive shells. It's the place for aliases, key bindings and other things that you want to have in interactive shell. While you can define an environment variable there, this variable will only be set in the programs that are started from an interactive shell. This excluded your window manager and any program started by the window manager.
So instead define environment variables in the proper place. For non-graphical logins, the proper place is ~/.profile
. When you log in in graphical mode, the proper place depends on your distribution, your display manager and your session or window manager. On Ubuntu, I believe that all display managers are set up to read ~/.profile
as well. So define environment variables in ~/.profile
.
This topic has come up many times — see Is there a ".bashrc" equivalent file read by all shells?
In your situation, an alternative possibility is to define the environment variable in your Awesome configuration file (os.setenv('TZ', 'America/Los_Angeles')
). Awesome would be the right place to act if you want to change the timezone without logging out and back in (if you're travelling with your laptop).