i3status-rust icon indicating copy to clipboard operation
i3status-rust copied to clipboard

block custom format

Open ayoubelmhamdi opened this issue 1 year ago • 7 comments

[[block]]
block = "custom"
command = "get_bandwith"
interval = 1
  // ...
  unsigned long diff_packet = update_tx_packets(tx_packets) / 1024;
  char s[5];
  snprintf(s, sizeof(s), "%4lu", diff_packet);
  printf("%4s kb\n", s);

I am currently padding my numbers with blank spaces when they are less than 4 characters long. However, the output appears to be trimmed by i3status-rs. I would prefer to avoid having the blocks in my status bar move around when the status is updated.

ayoubelmhamdi avatar Feb 28 '23 22:02 ayoubelmhamdi