There's a number of ways to do what I think you want.
Option 1:
use /titlebar to shove the time you want into a titlebar of a window, other than that you would need some form of custom @window.
Option 2: Custom @window
Using a combination of /aline and /rline you could first display the time, then periodically replace the line with the updated time.
Example:
alias tclock {
if (!$window(@TClock) && !$1) { window -dBfk0 +t @TClock -1 -1 150 150 | aline @TClock $time }
if ($window(@TClock)) {
rline @TClock 1 $time
titlebar @TClock $time
.timerTClock -om 1 100 TClock Update
}
}
Option 3: Custom Picture @window
Using picture windows grants you the ability to "draw" whatever you wish with the available /draw* commands, and you can get as creative as you wish to output your clock.
Example:
alias pclock {
if (!$window(@Clock) && !$1) { window -dBpfk0 +t @Clock -1 -1 150 150 }
if ($window(@Clock)) {
var %x = 0 , %y = 15 , %hw = $window(@Clock).dw / 2 , %hh = $window(@Clock).dh / 2 , %r = %hw - 10
drawrect -nf @Clock 1 1 0 0 $window(@Clock).dw $window(@Clock).dh
while (%x <= %y) {
var %a = $calc(%x * $pi * 2 / 60) , %dx = $calc(%r * $cos(%a)) , %dy = $calc(%r * $sin(%a)) , %c = $iif($calc(%x % 5),14 2,4 4)
drawdot -n @Clock %c $calc(%dx + %hw) $calc(%dy * -1 + %hh)
drawdot -n @Clock %c $calc(%dx + %hw) $calc(%dy + %hh)
drawdot -n @Clock %c $calc(%dx * -1 + %hw) $calc(%dy + %hh)
drawdot -n @Clock %c $calc(%dx * -1 + %hw) $calc(%dy * -1 + %hh)
inc %x
}
tokenize 58 $asctime(HH:nn:ss)
var %ha = $calc(($1 - 3 + $2 / 60) * $pi * 2 / 12) , %ma = $calc(($2 - 15 + $3 / 60) * $pi * 2 / 60) , %sa = $calc(($3 - 15) * $pi * 2 / 60)
drawline -n @Clock 14 2 $calc($cos(%ha) * %r * 0.6 + %hw) $calc($sin(%ha) * %r * 0.6 + %hw) %hw %hw $calc($cos(%ma) * %r * 0.9 + %hw) $calc($sin(%ma) * %r * 0.9 + %hw)
drawline -n @Clock 4 2 $calc($cos(%sa) * %r + %hw) $calc($sin(%sa) * %r + %hw) %hw %hw
drawtext -n @Clock 14 $qt($window(@Clock).font) $window(@Clock).fontsize $calc(%hw - $width($asctime(hh:nn:ss TT),$window(@Clock).font,$window(@Clock).fontsize) / 2) %hh $asctime(hh:nn:ss TT)
drawdot @Clock
titlebar @Clock $asctime(HH:nn:ss)
.timerClock -om 1 100 PClock Update
}
}