mirror of
https://gittea.dev/nova/th.git
synced 2025-10-22 10:50:15 -04:00
delta time to reload directory
This commit is contained in:
1
config.h
1
config.h
@@ -1,5 +1,6 @@
|
|||||||
#define SETTINGS_LINE_NUMBERS 2 /* 0 is disabled, 1 is enabled, 2 is relative */
|
#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_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
|
#ifndef CONFIG_GUARD
|
||||||
|
13
main.c
13
main.c
@@ -60,6 +60,11 @@ int main(){
|
|||||||
|
|
||||||
char threading = 0;
|
char threading = 0;
|
||||||
terminal_width_empty_line = malloc(terminal_width);
|
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_t, NULL, thread_top, &status); /*top bar*/
|
||||||
pthread_create(&thread_l, NULL, thread_lft, &status); /*parent_content slash win_l*/
|
pthread_create(&thread_l, NULL, thread_lft, &status); /*parent_content slash win_l*/
|
||||||
@@ -92,6 +97,14 @@ int main(){
|
|||||||
|
|
||||||
render_pass();
|
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();
|
threading_free();
|
||||||
free(start_path);
|
free(start_path);
|
||||||
|
Reference in New Issue
Block a user