我想将tty-clock输出设置为我的i3设置的背景。我想知道如何将命令输出显示为背景。
到目前为止我尝试的事情:
tty-clock && killall tty-clock
scrot ~/Pictures/Wallpaper/background.png
feh ~/Pictures/Wallpaper/background.png
tty-clock | cat > ~/TEMP/tty-clock-output
TTY时钟输出
[?1049h[22;0;0t[1;39r(B[m[4l[?7h[?1h=[39;49m[?25l[39;49m(B[m[H[2J[17;59H[H[2J[7;12H[17;59H
[64G[45m
[Z
[Z
[Z
[Z [49m(B[m[18d [45m [49m(B[m [45m
[67G [49m(B[m [45m
[67G
[49m(B[m[18;79H[45m [19;75H [49m(B[m [45m [49m(B[m [45m
[79G [49m(B[m [45m [21;75H [49m(B[m [45m [49m(B[m [45m
[79G [49m(B[m[18d [45m [49m(B[m [45m
[86G [49m(B[m [45m
[86G
[49m(B[m[22;66H [22;85H[92G[22;66H [22;85H[92G[22;66H [22;85H[92G[22;66H [22;85H[92G[22;66H [22;85H[92G[22;66H [22;85H[92G[22;66H [22;85H[92G[39;1H[?12l[?25h[?1049l[23;0;0t
[?1l>[?1049h[22;0;0t[1;39r(B[m[4l[?7h[?1h=[39;49m[?25l[39;49m(B[m[H[2J[17;59H[H[2J[7;12H[17;59H
[64G[45m
[Z
[Z
[Z
[Z [49m(B[m[18d [45m [49m(B[m [45m
[67G [49m(B[m [45m
[67G
[49m(B[m[18;79H[45m [19;75H [49m(B[m [45m [49m(B[m [45m
[79G [49m(B[m [45m [21;75H [49m(B[m [45m [49m(B[m [45m
[79G [49m(B[m[18d [45m
[86G
[86G [49m(B[m[22;66H [22;85H[92G[22;66H [22;85H[92G[39;1H[?12l[?25h[?1049l[23;0;0t
[?1l>
编辑:
▞▀▖ ▜ ▌
▚▄ ▞▀▖▐ ▌ ▌▞▀▖▞▀▌
▖ ▌▌ ▌▐ ▐▐ ▛▀ ▌ ▌
▝▀ ▝▀ ▘ ▘ ▝▀▘▝▀▘
我得到了一个similar font到我需要的东西,并修改它以匹配tty-clock风格。
这是我写的脚本,将使用watch -n 15命令重复:
#! /bin/sh
echo "text 0,0 '" > /home/murteza/Pictures/Wallpaper/i3wm/time
date +%H\:%M | figlet -f /home/murteza/.local/share/figlet/ANSI\ Regular.flf >> /home/murteza/Pictures/Wallpaper/i3wm/time
echo \' >> /home/murteza/Pictures/Wallpaper/i3wm/time
convert -size 390x130 xc:black -font "DejaVu-Sans-Mono" -pointsize 20 -fill "#808080" -draw @/home/murteza/Pictures/Wallpaper/i3wm/time /home/murteza/Pictures/Wallpaper/i3wm/clock.png
composite /home/murteza/Pictures/Wallpaper/i3wm/clock.png -gravity center /home/murteza/Pictures/Wallpaper/i3wm/source.jpg /home/murteza/Pictures/Wallpaper/i3wm/result.jpg
feh --bg-scale /home/murteza/Pictures/Wallpaper/i3wm/result.jpg
最终结果是here
感谢@ZeroCC
你根本不需要调用tty-clock:一个脚本,它将date
的输出(格式化为适合)发送到文本文件,然后运行convert
就可以了。你需要花一些时间玩convert
参数来获得理想的外观。