1

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>
Dharman
  • 30,962
  • 25
  • 85
  • 135
Murteza Y
  • 13
  • 5

1 Answers1

0

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.

ZeroCC
  • 16
  • 1
  • Expected & achieved results are [here](https://imgur.com/a/OL5f0Kx) i really wanted to have blocky tty-clock font but it was not available in figlet fontDB. I will update my question if I get the solution I wanted. – Murteza Y Mar 27 '19 at 21:45
  • Any particular reason you're using figlet? You can use any installed font with convert. – ZeroCC Mar 28 '19 at 15:38
  • I know I can enlarge any font as much as I want (I learned that yesterday :) but I really like the tty-clock style and I don't know any monospace font with same style. I even looked at [tty-clock source code](https://github.com/xorg62/tty-clock) to find the font tty-clock uses but it uses [drawnumber function](https://github.com/xorg62/tty-clock/blob/0cec6b099385d0db33fe81ae3d0d34e15ed40430/ttyclock.c#L221) instead. – Murteza Y Mar 29 '19 at 16:33
  • Incorporating that in your own code would seem to be the answer then! – ZeroCC Mar 29 '19 at 22:23