generates upper row , lower row and filler elements
Code: Select all
"_ : gen_fillers"{ // <--- select folders to generate seperators then execute
$folders = sel_files();
foreach $folder, $folders {
$per_row = 8; // <--- set how much items are per row
// create files row
$sep_f_count = listfolder($folder, "*.separ", 32, );
if $sep_f_count != $per_row-1 {
$sep_f = quicksearch("*.separ /n",$folder ,"|" , );
if $sep_f {
delete 1,0, $sep_f;
}
$sep_f_counter = $per_row-1 ;
while ( 0 < $sep_f_counter ){
new($folder . "\$" . "_" . $sep_f_counter . ".separ", "file", , );
$sep_f_counter -= 1;
}
}
// create dir row
$sep_d_count = listfolder($folder, "ᐱ_*", 32, );
if $sep_d_count != $per_row {
$sep_d = quicksearch("ᐱ_* /n",$folder ,"|" , );
if $sep_d {
delete 1,0, $sep_d;
}
$sep_d_counter = $per_row;
while ( 0 < $sep_d_counter ){
new($folder . "\ᐱ_" . $sep_d_counter, "dir", , );
$sep_d_counter -= 1;
}
}
//count only real files
$files = listfolder($folder, "*", 4, );
$total_files = 0;
foreach $file,$files{
if str_compare($file , "_____") == -1 AND str_compare($file , "Desktop.ini") == -1 AND str_compare($file , "Folder.ico") == -1{
if str_compare($file , "ᐱ") == -1 AND str_compare($file , ".separ") == -1 AND str_compare($file , "ᐅ") == -1 {
$total_files += 1;
}
}
}
// how many fillers needed ?
$full_rows = floor($total_files / $per_row);
$fillers_needed = $per_row - ($total_files - ($full_rows * 8 ));
$fillers_exist_count = listfolder($folder, "ᐅ_*", 32, );
if $fillers_needed != $fillers_exist_count{
$fillers = quicksearch("ᐅ_* /n",$folder ,"|" , );
if $fillers {
delete 1,0, $fillers;
}
if $fillers_needed != $per_row {
while ( 0 < $fillers_needed ){
new($folder . "\ᐅ_$fillers_needed", "dir", , );
$fillers_needed -= 1;
}
}
}
}
}
Code: Select all
"_ : ghost_set_separ__"{ //< --- execute this via cat/toolbar button
ghost_via_cat__(".separ", 0);
ghost_via_cat__("ᐱ_", 0);
ghost_via_cat__("ᐅ_", 0);
}
function ghost_via_cat__($str,$set_caption){
$ghost_active = ghost();
$compare = strpos($ghost_active,$str);
if $compare > -1 { //if is active already, toggle it off
$ghost_updated = replace($ghost_active,$str,"");
$ghost_updated = replace($ghost_updated,"||","|");
}
else{ // if is not active , append it
$ghost_updated = trim($ghost_active . "|". $str);
$ghost_updated = replace($ghost_updated,"||","|");
}
ghost($ghost_updated,1);
}
*.separ
\ᐅ_*\
\ᐱ_*\
In Color Filters add & assign font & backgroud color :
L:dir: *ᐅ_*
L:dir: *ᐱ_*
L:.separ
upper and lower row are generated once , filler row regenerates when qty of files changes .
use 1 lvl branch view for this