aboutsummaryrefslogtreecommitdiffstats
path: root/sbin/chksession
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2004-02-27 17:24:33 +0000
committerFrederic Lepied <flepied@mandriva.com>2004-02-27 17:24:33 +0000
commitd62e8cde55c9f43c0ba392da16c9ead1c7bb850c (patch)
tree9bd8da0380d5f63e626c4b92568c76b3ab910509 /sbin/chksession
parent2950580c983b4754fc577610d662de7475c8b53b (diff)
downloadcommon-data-d62e8cde55c9f43c0ba392da16c9ead1c7bb850c.tar
common-data-d62e8cde55c9f43c0ba392da16c9ead1c7bb850c.tar.gz
common-data-d62e8cde55c9f43c0ba392da16c9ead1c7bb850c.tar.bz2
common-data-d62e8cde55c9f43c0ba392da16c9ead1c7bb850c.tar.xz
common-data-d62e8cde55c9f43c0ba392da16c9ead1c7bb850c.zip
do not generate Default session for kdm
remove files before generating the sessions
Diffstat (limited to 'sbin/chksession')
-rw-r--r--sbin/chksession30
1 files changed, 16 insertions, 14 deletions
diff --git a/sbin/chksession b/sbin/chksession
index d0ac569..5fa7357 100644
--- a/sbin/chksession
+++ b/sbin/chksession
@@ -49,9 +49,9 @@ sub parse_file { # parse a session descriptor file
}
sub gen_desktops {
- my ($d) = @_;
+ my ($d, $createdefault) = @_;
-d $d or system("mkdir -p $d");
- chdir $d;
+ system("rm -f $d/*");
for my $file (@lf) {
open FH, ">$d/$order{$file}$file.desktop" or die "Can't write to $d/$order{$file}.desktop\n";
@@ -66,16 +66,18 @@ sub gen_desktops {
close FH;
chmod 0755, $file;
}
- 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;
+ 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)
@@ -124,11 +126,11 @@ my ($e) = eval {cat("/etc/sysconfig/desktop")} =~ /DESKTOP=(\S+)/;
if ($kdm) {
- gen_desktops '/usr/share/apps/kdm/sessions';
+ gen_desktops('/usr/share/apps/kdm/sessions', 0);
}
if ($gdm) {
- gen_desktops '/etc/X11/dm/Sessions';
+ gen_desktops('/etc/X11/dm/Sessions', 1);
}
if ($xsession) {