(Xubuntu) 如何在 window 标题中显示微调动画?
(Xubuntu) How to display spinner animation in window title?
使用 bash,我一直在尝试在 Nemo ( 3.8.6) 文件管理器。我正在使用带有基本 Greybird 主题的 Xubuntu 18.04.2 LTS。
这是我试过的。我安装了在这个地址找到的脚本:
完美运行。这是我得到的:
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
此脚本在控制台中正确显示微调器但是:
- 从未出现在 window
的标题中
- 微调器显示在插入光标内(如何删除它以便只保留微调器?)
感谢您的宝贵时间和帮助!
替换
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
使用 bash,我一直在尝试在 Nemo ( 3.8.6) 文件管理器。我正在使用带有基本 Greybird 主题的 Xubuntu 18.04.2 LTS。
这是我试过的。我安装了在这个地址找到的脚本:
完美运行。这是我得到的:
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
此脚本在控制台中正确显示微调器但是:
- 从未出现在 window 的标题中
- 微调器显示在插入光标内(如何删除它以便只保留微调器?)
感谢您的宝贵时间和帮助!
替换
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