1
0
mirror of https://gittea.dev/nova/th.git synced 2025-10-21 10:20:15 -04:00

delta time to reload directory

This commit is contained in:
nova
2025-09-24 23:07:29 +02:00
parent fe781c2d3c
commit b46d2da308
2 changed files with 16 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
#define SETTINGS_LINE_NUMBERS 2 /* 0 is disabled, 1 is enabled, 2 is relative */
#define SETTINGS_UEBERZUG_IMAGE_PREVIEW 1 /* 0 is disabled, 1 is enabled, 2 is with caching */
#define SETTINGS_LINE_NUMBERS 2 /* 0 is disabled, 1 is enabled, 2 is relative */
#define SETTINGS_UEBERZUG_IMAGE_PREVIEW 1 /* 0 is disabled, 1 is enabled, 2 is with caching */
#define SETTINGS_RELOAD_DIR_DELTA 10 /* 0 is disabled, time in seconds of how often the directory should be reload */
/* {{{ */
#ifndef CONFIG_GUARD

13
main.c
View File

@@ -60,6 +60,11 @@ int main(){
char threading = 0;
terminal_width_empty_line = malloc(terminal_width);
#if SETTINGS_RELOAD_DIR_DELTA != 0
time_t t;
time_t dt;
time(&t);
#endif
pthread_create(&thread_t, NULL, thread_top, &status); /*top bar*/
pthread_create(&thread_l, NULL, thread_lft, &status); /*parent_content slash win_l*/
@@ -92,6 +97,14 @@ int main(){
render_pass();
#if SETTINGS_RELOAD_DIR_DELTA != 0
time(&dt);
if (dt - t >= SETTINGS_RELOAD_DIR_DELTA) {
time(&t);
status |= (STATUS_RUN_BACKEND | STATUS_RELOAD_DIRECTORY);
}
#endif
}
threading_free();
free(start_path);