[COMMENTED] Make inotify monitor new per-app config file or if delete, the main config file again
Needs to be triggered by main config file change.
FIXME what if there's no config file?
@@ -21,9 +21,14 @@ static void fileChanged(void *params_void) {
struct inotify_event *event =
(struct inotify_event *) &buffer[i];
i += EVENT_SIZE + event->len;
- if (event->mask & IN_MODIFY) {
+ if (event->mask & IN_MODIFY /*|| event->mask & IN_IGNORED*/) {
parse_overlay_config(&local_params, getenv("MANGOHUD_CONFIG"));
std::lock_guard<std::mutex> lk(nt->mutex);
+ /*if (nt->params->config_file_path != local_params.config_file_path) {
+ fprintf(stderr, "MANGOHUD: watching config file: %s\n", local_params.config_file_path.c_str());
+ inotify_rm_watch(nt->fd, nt->wd);
+ nt->wd = inotify_add_watch(nt->fd, local_params.config_file_path.c_str(), IN_MODIFY | IN_DELETE | IN_DELETE_SELF);
+ }*/
*nt->params = local_params;
}
}
