meuter / argon-one-case-ubuntu-20.04

port of the argon one case power button and fan script for Ubuntu 20.04 on rpi 4
255 stars 49 forks source link

Revise the generated argone-tempmon #11

Closed hivehand closed 3 years ago

hivehand commented 3 years ago

The previously-generated argone-tempmon didn't have a shebang (!#) line at the beginning, and so wasn't directly executable. This commit fixes that. It also revises the update logic: instead of clearing the entire screen, argone-tempmon now uses a cursor-movement escape code to just redraw its output in the same place. This avoids the blinking that results from using clear.

Note that this differs from the other inline scripts in two ways:

  1. It invokes bash via /usr/bin/env instead of directly.
  2. It uses HEREDOC functionality to embed the script, instead of a succession of echo <LINE> >> output_file invocations.

I hope that's acceptable. Please let me know if it isn't. (If you'd like me to revise the other script-generation instances for consistency, please let me know that as well: I'd be happy to.)

meuter commented 3 years ago

Thanks for the re-write. Much easier to read now.

-Cédric