PMbwmon bandwidth monitor: can specify which interfaces to watch, also supporting...
[hband-tools.git] / icewm / icewm-menu-cwds
blobc6e4169247e6ed9d81d21f67cc84d3795db2ade7
1 #!/usr/bin/env perl
3 for my $wd (glob "/proc/[0-9]*/cwd")
5 $dir{$_} = $wd if $_ = readlink $wd;
8 for my $dir (sort keys %dir)
10 my $wd = $dir{$dir};
12 my $opendir = $dir;
13 $opendir = $wd if ! -e $dir;
15 # escape for icewm menu parser
16 $dir =~ s{^$ENV{'HOME'}/}{~/};
17 $dir =~ s/[""\\]/\\$&/g;
18 $opendir =~ s/[""\\]/\\$&/g;
20 print "prog \"$dir\" folder mimeopen-gui \"$opendir\"\n"