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

changes too small for proper commit message

This commit is contained in:
nova
2025-10-09 01:01:52 +02:00
parent ac6d0e8408
commit 3fa16fd8b2
4 changed files with 13 additions and 10 deletions

View File

@@ -69,8 +69,11 @@ static const binding key_binding[] = {
{ "G", jump_bottom, NULL, "jump to last file in dir" },
{ "gg", jump_top, NULL, "jump to first file in dir" },
{ "gh", jump_to_dir, "$HOME", "jump to $HOME" },
{ "gs", jump_to_dir, "$START_PATH", "jump to $START_PATH" },
{ "gs", jump_to_dir, "$START_PATH", "jump to $START_PATH" }, /* the path you started th in */
{ "gD", jump_to_dir, "$HOME/Downloads", "jump to $HOME/Downloads" },
{ "gC", jump_to_dir, "$HOME/Documents", "jump to $HOME/Documents" },
{ "gP", jump_to_dir, "$HOME/Pictures", "jump to $HOME/Pictures" },
{ "gM", jump_to_dir, "$HOME/Music", "jump to $HOME/Music" },
{ "gd", jump_to_dir, "/dev", "jump to /dev" },
{ "ge", jump_to_dir, "/etc", "jump to /etc" },
{ "gp", jump_to_dir, "/etc/portage", "jump to /etc/portage" },
@@ -87,11 +90,10 @@ static const binding key_binding[] = {
{ "uz", cmd_on_selected, "unzip ", "unzip zip" },
{ "on", order_by, sort_natural, "order natural" },
{ "or", not_implemented, "", "order reverse" },
{ "oe", not_implemented, "", "order extension" },
{ "oe", not_implemented, NULL, "order extension" },
{ "os", order_by, sort_size, "order size" },
{ "ot", order_by, sort_type, "order type" },
{ "oz", order_by, sort_random, "order random" },
{ "or", order_by, sort_random, "order random" },
{ "oa", order_by, sort_alpha, "order alphabetically" },
{ "mk", makedir, NULL, "create directory" },

View File

@@ -642,6 +642,7 @@ void order_by(int passes, int index){
(void)passes;
free(seed);
seed = NULL;
seed = malloc(sizeof(time_t));
*seed = time(NULL);

View File

@@ -119,15 +119,15 @@ int sort_random(const void *file0, const void *file1){
return 1;
}
time_t num = (time_t)&seed;
unsigned long i;
for (i = 0; i < 6; i++){
time_t i;
for (i = num%2; i < 6+(((time_t)&seed)%2); i++){
num ^= *seed;
if (num%2) {
num ^= (time_t)&num;
num ^= num << i;
num ^= num << (i + (((time_t)&seed)%5));
} else {
num ^= (time_t)&seed;
num ^= num >> i;
num ^= num >> (i + (((time_t)&num)%5));
}
}
num ^= getpid();

View File

@@ -259,7 +259,7 @@ void *thread_btm(){
if (local_status & (STATUS_RUN_BACKEND | STATUS_RELOAD_DIRECTORY)) {
/*{{{ parse storage info */
/*{{{ parse storage info; the fold of shame*/
pthread_mutex_lock(&mutex_mid);
unsigned long i;
float total_dir_size = 0;
@@ -319,7 +319,7 @@ void *thread_btm(){
ui_btm_right_block_size = snprintf(NULL, 0, "%0.2lf%c %s %0.0lf%c %s", parsed_number[0], size_unit[(unsigned)size_index[0]], ui_btm_current_dir_size, parsed_number[1], size_unit[(unsigned)size_index[1]], ui_btm_text_storage_left)+1;
ui_btm_right_block = malloc(ui_btm_right_block_size);
sprintf(ui_btm_right_block, "%0.2lf%c %s %0.0lf%c %s", parsed_number[0], size_unit[(unsigned)size_index[0]], ui_btm_current_dir_size, parsed_number[1], size_unit[(unsigned)size_index[1]], ui_btm_text_storage_left);
} else if (size_index[0] <= 0 && size_index[1] <= 0) {
} else {
ui_btm_right_block_size = snprintf(NULL, 0, "%0.0lf%c %s %0.0lf%c %s", parsed_number[0], size_unit[(unsigned)size_index[0]], ui_btm_current_dir_size, parsed_number[1], size_unit[(unsigned)size_index[1]], ui_btm_text_storage_left)+1;
ui_btm_right_block = malloc(ui_btm_right_block_size);
sprintf(ui_btm_right_block, "%0.0lf%c %s %0.0lf%c %s", parsed_number[0], size_unit[(unsigned)size_index[0]], ui_btm_current_dir_size, parsed_number[1], size_unit[(unsigned)size_index[1]], ui_btm_text_storage_left);