diff --git a/config.h b/config.h index 2151980..e0218a6 100644 --- a/config.h +++ b/config.h @@ -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" }, diff --git a/interactions.c b/interactions.c index 1da14fc..59f385a 100644 --- a/interactions.c +++ b/interactions.c @@ -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); diff --git a/sorting.c b/sorting.c index c414973..4eff683 100644 --- a/sorting.c +++ b/sorting.c @@ -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 << 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(); diff --git a/threading.c b/threading.c index 1663394..f9f76a8 100644 --- a/threading.c +++ b/threading.c @@ -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);