mirror of
https://gittea.dev/nova/th.git
synced 2026-01-30 08:40:10 -05:00
small changes
This commit is contained in:
12
config.h
12
config.h
@@ -21,12 +21,12 @@ static const mimetype mimetype_default_cmd[] = {
|
|||||||
* file --mime-type -b ./image.gif
|
* file --mime-type -b ./image.gif
|
||||||
* gives us "image/gif", thusly if we want to open gif in mpv rather than feh,
|
* gives us "image/gif", thusly if we want to open gif in mpv rather than feh,
|
||||||
* we need to define "gif" before "image" */
|
* we need to define "gif" before "image" */
|
||||||
{ "text", "$EDITOR" },
|
{ "text", "$EDITOR" },
|
||||||
{ "gif", "mpv --loop-file=\"inf\"" },
|
{ "gif", "nohup mpv --loop-file=\"inf\" % >/dev/null 2>&1 &" },
|
||||||
{ "image", "feh % &" },
|
{ "image", "feh % >/dev/null 2>&1 &" },
|
||||||
{ "video", "mpv % &" },
|
{ "video", "nohup mpv % >/dev/null 2>&1 &" },
|
||||||
{ "audio", "mpv" },
|
{ "audio", "mpv" },
|
||||||
{ "pdf", "zathura" },
|
{ "pdf", "zathura" },
|
||||||
};
|
};
|
||||||
static const extension file_extension_default_cmd[] = {
|
static const extension file_extension_default_cmd[] = {
|
||||||
/* extension shell command
|
/* extension shell command
|
||||||
|
|||||||
9
dir.c
9
dir.c
@@ -139,18 +139,13 @@ void get_dir_content(char *path, unsigned long *dir_file_count, file *dir_conten
|
|||||||
}
|
}
|
||||||
free(full_path);
|
free(full_path);
|
||||||
free(file);
|
free(file);
|
||||||
|
free(entry[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qsort(dir_content, *dir_file_count, sizeof(file), order_func);
|
qsort(dir_content, *dir_file_count, sizeof(file), order_func);
|
||||||
|
|
||||||
for (i = 0; i < *dir_file_count; i++) {
|
free(entry);
|
||||||
free(entry[i]);
|
|
||||||
}
|
|
||||||
if (entry != NULL) {
|
|
||||||
free(entry);
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
18
sorting.c
18
sorting.c
@@ -118,19 +118,13 @@ int sort_random(const void *file0, const void *file1){
|
|||||||
if (!(((file*)file0)->file_type & FILE_TYPE_DIR) && (((file*)file1)->file_type & FILE_TYPE_DIR)) {
|
if (!(((file*)file0)->file_type & FILE_TYPE_DIR) && (((file*)file1)->file_type & FILE_TYPE_DIR)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
time_t num = (time_t)&seed;
|
time_t num = ((time_t)&sort_random)^((time_t)sort_natural);
|
||||||
time_t i;
|
int i = 1;
|
||||||
for (i = num%2; i < 6+(((time_t)&seed)%2); i++){
|
for (; i < 6; i++) {
|
||||||
num ^= *seed;
|
num += *seed;
|
||||||
if (num%2) {
|
num ^= num << ((((time_t)&seed)%6)+i);
|
||||||
num ^= (time_t)#
|
num ^= num >> ((((time_t)&num)%9)+i);
|
||||||
num ^= num << (i + (((time_t)&seed)%5));
|
|
||||||
} else {
|
|
||||||
num ^= (time_t)&seed;
|
|
||||||
num ^= num >> (i + (((time_t)&num)%5));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
num ^= getpid();
|
|
||||||
|
|
||||||
return ((num%3) - 1);
|
return ((num%3) - 1);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user