From 250679025e7c4ab78ce8611eef51664bf674d7b2 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Fri, 1 Jul 2022 17:01:26 +0100 Subject: [PATCH] Set per-user timezone --- roles/home-cli/files/bashrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/home-cli/files/bashrc b/roles/home-cli/files/bashrc index 1b8b31c..39e8530 100644 --- a/roles/home-cli/files/bashrc +++ b/roles/home-cli/files/bashrc @@ -48,6 +48,7 @@ set -o noclobber # Locale and language. ## Clear the existing locale settings and set options I always want. export TIME_STYLE=long-iso # Used by GNU 'ls'. +export TZ=Europe/London # Can override this elsewhere if needed. if [ -f /etc/locale.conf ] then . /etc/locale.conf @@ -228,7 +229,10 @@ usermotd () { fi uptime echo "LANG=$LANG" - if [ -x /usr/bin/timedatectl ] && [ "x$(systemctl is-system-running)" != "xoffline" ] + if [ -n "$TZ" ] + then + echo "TZ=$TZ" + elif [ -x /usr/bin/timedatectl ] && [ "x$(systemctl is-system-running)" != "xoffline" ] then timedatectl show --property=Timezone | sed 's/Timezone=/TZ=/' fi