From aa67a52a969f3ef336b845857c48a76a5e319987 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Wed, 27 Apr 2016 16:44:35 +0200 Subject: Deal with custom timezones (non-UTC) in KDE4 and PLASMA5. --- liveinit | 11 +++++++++++ make_slackware_live.sh | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/liveinit b/liveinit index f4bda31..bd251e6 100755 --- a/liveinit +++ b/liveinit @@ -815,6 +815,17 @@ EOT # You should run timeconfig to edit this file. localtime EOT + # QT5 expects "/etc/localtime" to be a symlink. Slackware's file is a real + # file so QT5 fails to determine the timezone and falls back to UTC. Fix: + echo ${TZ} > /mnt/overlay/etc/timezone + sed -i -n "p;s/^\( *\)rm -f localtime$/\1echo \$TZ > timezone/p" \ + /mnt/overlay//usr/sbin/timeconfig + + # KDE4 and PLASMA5 user timezone re-configuration: + sed -i -e "s%^LocalZone=.*%LocalZone=${TZ}%" \ + /mnt/overlay/home/live/.kde/share/config/ktimezonedrc + sed -i -e "s%^LocalZone=.*%LocalZone=${TZ}%" \ + /mnt/overlay/home/live/.config/ktimezonedrc fi if [ ! -z "$LIVEPW" ]; then diff --git a/make_slackware_live.sh b/make_slackware_live.sh index 936ca30..b63cb2a 100755 --- a/make_slackware_live.sh +++ b/make_slackware_live.sh @@ -1297,6 +1297,16 @@ DefaultProfile=Shell.profile EOT +# Configure (default) UTC timezone so we can change it during boot: +mkdir -p ${LIVE_ROOTDIR}/etc/skel/.kde/share/config +cat < ${LIVE_ROOTDIR}/etc/skel/.kde/share/config/ktimezonedrc +[TimeZones] +LocalZone=UTC +ZoneinfoDir=/usr/share/zoneinfo +Zonetab=/usr/share/zoneinfo/zone.tab +ZonetabCache= +EOT + if [ "$LIVEDE" = "PLASMA5" ]; then # -------------------------------------------------------------------------- # @@ -1346,6 +1356,15 @@ KRES_EOF alreadyMigrated=true KWALLET_EOL + # Configure (default) UTC timezone so we can change it during boot: + mkdir -p ${LIVE_ROOTDIR}/etc/skel/.config + cat < ${LIVE_ROOTDIR}/etc/skel/.config/ktimezonedrc +[TimeZones] +LocalZone=UTC +ZoneinfoDir=/usr/share/zoneinfo +Zonetab=/usr/share/zoneinfo/zone.tab +EOTZ + # Make sure that Plasma and SDDM work on older GPUs, # by forcing Qt5 to use software GL rendering: cat <<"EOGL" >> ${LIVE_ROOTDIR}/usr/share/sddm/scripts/Xsetup -- cgit v1.2.3