aboutsummaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
Diffstat (limited to 'sbin')
-rwxr-xr-xsbin/kdeDesktopCleanup12
1 files changed, 11 insertions, 1 deletions
diff --git a/sbin/kdeDesktopCleanup b/sbin/kdeDesktopCleanup
index 866c5ec..f00e44b 100755
--- a/sbin/kdeDesktopCleanup
+++ b/sbin/kdeDesktopCleanup
@@ -5,7 +5,7 @@
@dirs = (qw(/etc/skel /root), glob("/home/*"));
@path = split ":", "/sbin:/usr/sbin:/usr/X11R6/bin:/bin:/usr/bin";
-foreach $f (map { glob("$_/Desktop/*.kdelnk") } @dirs) {
+foreach $f (map { grep { /\.kdelnk$/ } all("$_/Desktop") } @dirs) {
open F, $f or next;
L: foreach (<F>) {
$_ = "Exec=linuxconf" if $f =~ /linuxconf/i; # hack
@@ -17,3 +17,13 @@ foreach $f (map { glob("$_/Desktop/*.kdelnk") } @dirs) {
last;
}
}
+
+sub all {
+ my $d = shift;
+ local *F;
+ opendir F, $d or die "all: can't open dir $d: $!\n";
+ my @l = grep { $_ ne '.' && $_ ne '..' } readdir F;
+ closedir F;
+
+ map { "$d/$_" } @l;
+}