(Xubuntu) 如何在 window 标题中显示微调动画?

(Xubuntu) How to display spinner animation in window title?

使用 bash,我一直在尝试在 Nemo ( 3.8.6) 文件管理器。我正在使用带有基本 Greybird 主题的 Xubuntu 18.04.2 LTS。

这是我试过的。我安装了在这个地址找到的脚本:

https://askubuntu.com/questions/634034/display-the-current-date-time-in-the-windows-title/634158#634158

完美运行。这是我得到的:

https://forum.ubuntu-fr.org/viewtopic.php?pid=22115889#p22115889

https://www.zupimages.net/up/19/26/owfa.png

在此屏幕截图中,我想在时钟旁边显示微调器。然后我尝试将一个简单的微调器合并到上面的脚本中。我用过这个:

while :; do
  for c in / - \ \|; do
    printf '%s\b' "$c"
    sleep .1
  done
done

window装饰脚本:

while true
do
    wmctrl -r :ACTIVE: -N "$(awk -F' \|\|' '{print }' <<< $(xdotool getwindowfocus getwindowname)) || $(LANG=fr_FR.UTF-8 date "+%A %d %B %Y  -  %H:%M:%S")"
    sleep 1
done

此脚本在控制台中正确显示微调器但是:

感谢您的宝贵时间和帮助!

替换

printf '%s\b' "$c"

wmctrl -r :ACTIVE: -N $(printf '%s\b' "$c")

更新:

#!/bin/bash

while :; do
  d=$(LANG=fr_FR.UTF-8 date "+%A %d %B %Y  -  %H:%M:%S")
  for c in / - \ \|; do
    wmctrl -r :ACTIVE: -N "$c $d"
    sleep .1
  done
done