diff options
-rw-r--r-- | sbin/chksession | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/sbin/chksession b/sbin/chksession index c7c6fa8..9e4f0f3 100644 --- a/sbin/chksession +++ b/sbin/chksession @@ -49,7 +49,7 @@ sub parse_file { # parse a session descriptor file } sub gen_desktops { - my ($d, $createdefault, $usesession) = @_; + my ($d, $usesession) = @_; -d $d or system("mkdir -p $d"); system("rm -f $d/*"); @@ -70,18 +70,6 @@ sub gen_desktops { close FH; chmod 0755, $file; } - if ($createdefault) { - open FH, ">$d/Default.desktop" or die "Can't write to $d/Default.desktop\n"; - print FH "[Desktop Entry]\n"; - print FH "Encoding=UTF-8\n"; - print FH "Name=Default\n"; - print FH "Comment=Default\n"; - print FH "Exec=/etc/X11/xdm/Xsession\n"; - print FH "Icon=\n"; - print FH "Type=Application\n"; - close FH; - chmod 0755, $file; - } } usage(1) @@ -130,11 +118,11 @@ my ($e) = eval {cat("/etc/sysconfig/desktop")} =~ /DESKTOP=(\S+)/; if ($kdm) { - gen_desktops('/usr/share/apps/kdm/sessions', 0, 0); + gen_desktops('/usr/share/apps/kdm/sessions', 0); } if ($gdm) { - gen_desktops('/etc/X11/dm/Sessions', 1, 1); + gen_desktops('/etc/X11/dm/Sessions', 1); } if ($xsession) { @@ -159,7 +147,7 @@ if ($xsession) { if ($list) { if (@lf) { - my $p; for(@lf) { $p .= /^$lf[-1]$/ ? "$_ default failsafe" : "$_ " } print "$p\n"; + print join(' ', @lf, 'Default', 'failsafe'), "\n"; } else { print "Default\n"; } |