backgroundttyi3

How to set tty-clock output as background


I would like to set tty-clock output as background for my i3 setup. I want to know how to display a command output as background.

Things I tried so far:

  1. Running a script that supposedly would run tty-clock and take its screenshot with scrot once a minute and feh would set it as background.

    Problem: tty-clock would stay on without ever letting next command to run and scrot is a screenshot utility and it would capture whatever I am looking at. Or I would need to switch to that workspace every minute to run, shot, kill, set as background.

tty-clock && killall tty-clock
scrot ~/Pictures/Wallpaper/background.png
feh ~/Pictures/Wallpaper/background.png
  1. save tty-clock output to a file which supposedly would be converted into image by convert (by imagemagick) and feh would set it as background.

    Problem: tty-clock output is more than just clock which I guess give information about characters' colors or place.

tty-clock | cat > ~/TEMP/tty-clock-output

tty-clock-output

[?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>

Solution

  • You don't need to invoke tty-clock at all: a script which sends the output of date (formatted to suit) to a text file, and then runs convert on that should do the trick. You'll need to spend some time playing with the convert parameters to get the desired look of course.