Skip to content

Commit

Permalink
Merge pull request #3 from Musikermomo/patch-1
Browse files Browse the repository at this point in the history
Make skiping of hidden files configurable
  • Loading branch information
trizen authored Feb 10, 2018
2 parents 6e0218d + 3a56cb7 commit ec6b9da
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion obbrowser
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ my $config_documentation = <<"EOD";
| browse_label : Label for "Browse here..." action.
| start_path : An absolute path from which to start to browse the filesystem.
| dirs_first : A true value will make the script to order directories before files.
| ignore_dotfiles : A true value will make the script to ignore files starting with a dot
=cut
Expand All @@ -119,6 +120,7 @@ my %CONFIG = (
dirs_first => 0,
with_icons => 1,
mime_ext_only => 0,
ignore_dotfiles => 0,
icon_size => 48,
force_icon_size => 0,
generic_fallback => 1,
Expand Down Expand Up @@ -227,7 +229,12 @@ my (%alias, %icons, @dirs, @files);
opendir(my $dir_h, $path) or warn "$0: Can't open dir `$path': $!\n";
foreach my $file (readdir $dir_h) {

next if chr ord $file eq q{.}; # skip the hidden files
if ($CONFIG{ignore_dotfiles}) {
next if chr ord $file eq q{.}; # skip the hidden files
}
else {
next if $file eq q{.} or $file eq q{..}; # skip the hidden files
}

if ($CONFIG{with_icons}) {

Expand Down

0 comments on commit ec6b9da

Please sign in to comment.