#!/bin/sh

while true
do
  text="$(TZ='Asia/Shanghai' date "+%H:%M:%S") $(date "+%H:%M:%S %a %Y-%m-%d")"
  text="-$(hours-and-minutes-till-midnight) $text"
  xsetroot -name "$text"
  sleep 50
done