From 2c1e78f723f02bdcd134c1783e02fe7873769830 Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Thu, 10 Oct 2024 23:47:34 +0200 Subject: [PATCH] TODOs --- TODO | 7 +++++++ ambientd.c | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 TODO diff --git a/TODO b/TODO new file mode 100644 index 0000000..4e98381 --- /dev/null +++ b/TODO @@ -0,0 +1,7 @@ +[ ] Add a config file +[ ] Use a better filter than a simple median, maybe a kalman filter +[ ] Add a way to customise the brightness curve +[ ] Automatically detect backlight device, or at least make it configurable +[ ] Add signal handlers + [ ] SIGUSR1 to reset the user offset + [ ] Handle kill by closing all file descriptors diff --git a/ambientd.c b/ambientd.c index bcc78af..6cacd5b 100644 --- a/ambientd.c +++ b/ambientd.c @@ -55,6 +55,9 @@ int read_int(FILE *fp) return r; } +// TODO: add some command line options like: +// -v: verbose/logging +// -c file; specify a config file int main (void) { // open the luminance device @@ -131,6 +134,7 @@ int main (void) } brightness_adjusted = MIN(MAX(brightness_target + user_offset, min_brightness), max_brightness); + // TODO: put this in write_int() function x = snprintf(STR_BUFFER, sizeof(STR_BUFFER), "%d", brightness_adjusted); if (x <= 0) { fprintf(stderr, "Error in snprintf(): %s\n", strerror(errno)); @@ -156,6 +160,7 @@ int main (void) user_offset = off; } + // TODO: option to turn off logging printf("brightness target: %d; user offset: %d; brightness adjusted: %d\n", brightness_target, user_offset, brightness_adjusted); }