aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChmouel Boudjnah <chmouel@mandriva.org>1999-12-22 02:22:14 +0000
committerChmouel Boudjnah <chmouel@mandriva.org>1999-12-22 02:22:14 +0000
commitefda392f90e6257cbf262361b557d92ebddfaea3 (patch)
tree968c68295d5eacfa6f40fe412640d451091559f8
parenta347d25db6b5c471aec82a42447d116c69484a1d (diff)
downloadcommon-data-efda392f90e6257cbf262361b557d92ebddfaea3.tar
common-data-efda392f90e6257cbf262361b557d92ebddfaea3.tar.gz
common-data-efda392f90e6257cbf262361b557d92ebddfaea3.tar.bz2
common-data-efda392f90e6257cbf262361b557d92ebddfaea3.tar.xz
common-data-efda392f90e6257cbf262361b557d92ebddfaea3.zip
"Seethechangelog"
-rw-r--r--ChangeLog6
-rw-r--r--Makefile4
-rw-r--r--icons/gnome-mandrake.jpgbin0 -> 7787 bytes
-rw-r--r--mandrake_desk.spec2
-rw-r--r--sbin/chksession127
-rwxr-xr-xsbin/fndSession128
-rw-r--r--window-managers45
7 files changed, 194 insertions, 118 deletions
diff --git a/ChangeLog b/ChangeLog
index eed30ca..c8a286e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1999-12-22 Chmouel Boudjnah <chmouel@mandrakesoft.com>
+
+ * sbin/fndSession: new script with the new chksession.
+ * sbin/chksession: a new greatest hit.
+ * window-managers: a new list.
+
1999-12-20 Chmouel Boudjnah <chmouel@mandrakesoft.com>
* icons/*: new supermount icons.
diff --git a/Makefile b/Makefile
index 275e674..fdd4f1b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION = 1.0
+VERSION = 1.0.1
all:
@echo "Run make install"
@@ -30,10 +30,12 @@ install:
mkdir -p $(RPM_BUILD_ROOT)/usr/{bin,sbin}
mkdir -p $(RPM_BUILD_ROOT)/usr/share/{icons,icons/large,icons/mini,pixmaps/backgrounds/mandrake}
mkdir -p $(RPM_BUILD_ROOT)/usr/share/gnome/apps/Internet
+ mkdir -p $(RPM_BUILD_ROOT)/etc/X11/
mkdir -p $(RPM_BUILD_ROOT)/usr/share/pixmaps/mdk
mkdir -p $(RPM_BUILD_ROOT)/etc/skel/Desktop
install -m755 bin/* $(RPM_BUILD_ROOT)/usr/bin
install -m755 sbin/* $(RPM_BUILD_ROOT)/usr/sbin
+ install -m644 window-managers $(RPM_BUILD_ROOT)/etc/X11/
install -m644 icons/*.xpm $(RPM_BUILD_ROOT)/usr/share/icons/
install -m644 icons/mini/*.xpm $(RPM_BUILD_ROOT)/usr/share/icons/mini
install -m644 icons/large/*.xpm $(RPM_BUILD_ROOT)/usr/share/icons/large
diff --git a/icons/gnome-mandrake.jpg b/icons/gnome-mandrake.jpg
new file mode 100644
index 0000000..a2886da
--- /dev/null
+++ b/icons/gnome-mandrake.jpg
Binary files differ
diff --git a/mandrake_desk.spec b/mandrake_desk.spec
index 1ec5d23..65bfb4c 100644
--- a/mandrake_desk.spec
+++ b/mandrake_desk.spec
@@ -1,7 +1,7 @@
# DO NOT MODIFY THE VERSION HERE, modify in the CVS
%define version 1.0
#
-%define release 4mdk
+%define release 1mdk
%define name mandrake_desk
Summary: The Desktop configuration files for Linux Mandrake.
diff --git a/sbin/chksession b/sbin/chksession
new file mode 100644
index 0000000..4ef57e5
--- /dev/null
+++ b/sbin/chksession
@@ -0,0 +1,127 @@
+#!/usr/bin/perl
+# (c) MandrakeSoft, Chmouel Boudjnah <chmouel@mandrakesoft.com>
+# Copyright under GPL blah blah blah.
+## you'll don't find much info here, see --help.
+
+my @lf;
+
+sub usage {
+ my $e = shift @_;
+ $0 =~ s|.*/||;
+ print { $e ? STDERR : STDOUT } << "EOF";
+Usage: $0 [OPTION]...
+
+ -F --first: Print only first available entry.
+ -t, --test: Go in test mode.
+ -l, --list: List window-managers.
+ -f=FILE, --file=FILE: Specify an alternarte config files other
+ than /etc/X11/window-manager
+-x=ENTRY, --xsession=ENTRY: Product window-managers script of ENTRY.
+-r=ENTRY, --remove=ENTRY: remove an entry (product to stdin).
+ -k, --kdm: Product window-managers list for kdm sessions.
+ -g, --gdm: Product window-managers script for gdm sessions.
+ -h, --help: Product this help.
+
+EOF
+ exit($e);
+}
+
+sub parse_file {
+ my $f=shift @_;
+ open F, $f or die "Can't open $f\n";
+ local $/ = "--@@--";
+ while (<F>) {
+ $n = $1 if /^NAME=(.*)/m;
+ $e = $1 if /^EXEC=(.*)/m;
+ $d = $1 if /^DESC=(.*)/m;
+ $i = $1 if /^ICON=(.*)/m;
+ $s = $1 while /SCRIPT:(.*?)$/gs; chomp $s;
+ if (-x $e) { $script{$n} = $s; $exec{$n} = $e; $desc{$n} = $d; $icon{$n} = $i; push @lf, $n; }
+ }
+}
+
+sub remove_entry {
+ my $e = shift @_;
+ my $f = shift @_;
+ open F, $f or die "Can't open $f\n";
+ local $/ = "--@@--";
+ while (<F>) {
+ next if /^NAME=$e/m;
+ print;
+ }
+}
+
+usage(1)
+ if @ARGV < 1;
+
+while ($ARGV[0] =~ /^--/ || $ARGV[0] =~ /^-/) {
+ $_ = shift;
+ if (/^--xsession=([^ ]+)/ || /^-x=([^ ]+)/) {
+ $xsession = $1;
+ } elsif (/^--first/ || /^-F/) {
+ $first++;
+ } elsif (/^--gdm/ || /^-g/) {
+ $gdm++;
+ } elsif (/^--list/ || /^-l/) {
+ $list++;
+ } elsif (/^--kdmsess/ || /^-k/) {
+ $kdm++;
+ } elsif (/^--test/ || /^-t/) {
+ $test++;
+ } elsif (/^--file=([^ ]+)/ || /^-f=([^ ]+)/) {
+ $file = $1;
+ } elsif (/^--remove=([^ ]+)/ || /^-r=([^ ]+)/) {
+ $remove=$1;
+ } elsif (/^--help/ || /^-h/ || /^-\?/) {
+ usage(0);
+ } else {
+ print STDERR "Unrecognized switch: $_\n";
+ usage(1);
+ }
+}
+
+$file = $test ? './window-managers' : '/etc/X11/window-managers' unless $file;
+die "$file don't exist\n" unless -r $file;
+$remove ? remove_entry($remove, $file) : parse_file ($file);
+
+if ($kdm) {
+ $session="SessionTypes=";
+ for(@lf) { $session .= /$lf[-1]/ ? "$_;failsafe;default" : "$_;" }
+ print "$session\n";
+ exit(0);
+}
+
+
+if ($gdm) {
+ my $d = '/etc/X11/gdm/Sessions/';
+ chdir $d;
+
+ #Any better way ?
+ opendir D, $d;
+ for ( readdir(D)) { next if /^\.\.?/;next if /^Failsafe/; chmod 0644, $_; }
+ closedir D;
+
+ for my $file (@lf) {
+ open FH, ">/etc/X11/gdm/Sessions/$file" or die "Can't write to /etc/X11/gdm/Sessions/$file\n";
+ print FH "#!/bin/sh";
+ print FH $script{$file};
+ close FH;
+ chmod 0755, $file;
+ }
+ unlink 'Default';
+ symlink shift @lf, 'Default';
+}
+
+if ($xsession) {
+ if ($script{$xsession}) {
+ print "#!/bin/sh\n";
+ print $script{$xsession}
+ } else {
+ print "xterm -geometry 100x25+0+0 &\n";
+ -x '/usr/X11R6/bin/icewm' ? print "icewm\n" : print "xterm -geometry 67x14+384+446\n";
+ }
+ exit (0);
+}
+
+print shift @lf, "\n" if $first;
+if ($list) { my $p; for(@lf) { $p .= /$lf[-1]/ ? "$_ default failsafe" : "$_ " } print "$p\n"; }
diff --git a/sbin/fndSession b/sbin/fndSession
index 6cbcb1e..1f7ec8b 100755
--- a/sbin/fndSession
+++ b/sbin/fndSession
@@ -1,122 +1,18 @@
#!/bin/sh
-# fndSession (c) MandrakeSoft
-# Chmouel Boudjnah <chmouel@mandrakesoft.com>
+# fndSession (c) MandrakeSoft, Chmouel Boudjnah <chmouel@mandrakesoft.com>
+## FindSession for kdm and gdm.
-LIST="SessionTypes"
-
-[ -x /usr/bin/kde ] && {
-LIST="$LIST=KDE"; FIRST=yes
-}
-[ -x /usr/bin/gnome-session ] && {
- if [ "$FIRST" = "yes" ];then
- LIST="$LIST;Gnome"
- else
- LIST="$LIST=Gnome"
- FIRST="yes"
- fi
-}
-
-[ -x /usr/X11R6/bin/afterstep ] && {
- if [ "$FIRST" = "yes" ];then
- LIST="$LIST;AfterStep"
- else
- LIST="$LIST=AfterStep"
- FIRST="yes"
- fi
-}
-
-
-[ -e /usr/share/apps/switchdesk/Xclients.anotherlevel ] && {
- if [ "$FIRST" = "yes" ];then
- LIST="$LIST;AnotherLevel"
- else
- LIST="$LIST=AnotherLevel"
- FIRST="yes"
- fi
-}
-
-[ -x /usr/X11R6/bin/bbdrake ] && {
- if [ "$FIRST" = "yes" ] ; then
- LIST="$LIST;BlackBox"
- FIRST="yes"
- fi
-}
-
-# Work but some end users don't understant how it works. So, we disable it.
-#[ -x /usr/X11R6/bin/bbdrake_kde ] && {
-# if [ "$FIRST" = "yes" ] ; then
-# LIST="$LIST;BlackBox/KDE"
-# FIRST="yes"
-# fi
-#}
-
-[ -x /usr/bin/enlightenment ] && {
- if [ "$FIRST" = "yes" ];then
- LIST="$LIST;Enlightenment"
- else
- LIST="$LIST=Enlightenment"
- FIRST="yes"
- fi
+[ -x /usr/sbin/chksession ] || {
+ echo "I can't find /usr/sbin/chksession"
+ echo "check your installation"
+ exit 1
}
-[ -x /usr/X11R6/bin/fvwm ] && {
- if [ "$FIRST" = "yes" ];then
- LIST="$LIST;FVWM"
- else
- LIST="$LIST=FVWM"
- FIRST="yes"
- fi
-}
-
-[ -x /usr/X11R6/bin/fvwm2 ] && {
- if [ "$FIRST" = "yes" ];then
- LIST="$LIST;FVWM2"
- else
- LIST="$LIST=FVWM2"
- FIRST="yes"
- fi
-}
-
-[ -x /usr/X11R6/bin/icewm ] && {
- if [ "$FIRST" = "yes" ];then
- LIST="$LIST;IceWM"
- else
- LIST="$LIST=IceWM"
- FIRST="yes"
- fi
-}
-
-[ -x /usr/X11R6/bin/mwm ] && {
- if [ "$FIRST" = "yes" ];then
- LIST="$LIST;MWM"
- else
- LIST="$LIST=MWM"
- FIRST="yes"
- fi
-}
-
-[ -x /usr/X11R6/bin/wmaker ] && {
- if [ "$FIRST" = "yes" ];then
- LIST="$LIST;WindowMaker"
- else
- LIST="$LIST=WindowMaker"
- FIRST="yes"
- fi
-}
-
-[ -x /usr/X11R6/bin/startxfce ] && {
- if [ "$FIRST" = "yes" ];then
- LIST="$LIST;XFCE"
- else
- LIST="$LIST=XFCE"
- FIRST="yes"
- fi
-}
+if [ -e /usr/share/config/kdmrc ];then
+LIST="`/usr/sbin/chksession -k`" perl -pi -e 's|^SessionTypes=.*|$ENV{LIST}|'\
+ /usr/share/config/kdmrc
+fi
-if [ $FIRST = "yes" ];then
- LIST="$LIST;default;FailSafe;"
-else
- LIST="$LIST=default;DailSafe;"
+if [ -d /etc/X11/gdm/Sessions ];then
+ /usr/sbin/chksession -g
fi
-sed "s/^SessionTypes.*/"$LIST"/" /usr/share/config/kdmrc > /tmp/$$.kdmrc && \
-mv /tmp/$$.kdmrc /usr/share/config/kdmrc
diff --git a/window-managers b/window-managers
new file mode 100644
index 0000000..7c7d62d
--- /dev/null
+++ b/window-managers
@@ -0,0 +1,45 @@
+--@@--
+NAME=Kde
+ICON=kde.xpm
+DESC=The fabulous desktop
+EXEC=/usr/bin/startkde
+SCRIPT:
+exec startkde
+--@@--
+NAME=Gnome
+ICON=Gnome.xpm
+DESC=The another fabulous desktop
+EXEC=/usr/bin/gnome-session
+SCRIPT:
+exec gnome-session
+--@@--
+NAME=WindowMaker
+ICON=WindowMaker.xpm
+EXEC=/usr/bin/wmaker
+DESC=Another NeXt like Window-Manager
+SCRIPT:
+[ -f $HOME/GNUstep/Defaults/WindowMaker ] || {
+ /usr/X11R6/bin/wmaker.inst -batch
+}
+exec /usr/X11R6/bin/wmaker
+--@@--
+NAME=AfterStep
+ICON=AfterStep.xpm
+EXEC=/usr/X11R6/bin/afterstep
+DESC=A NeXt like Window-Manager
+SCRIPT:
+exec /usr/X11R6/bin/afterstep
+--@@--
+NAME=Icewm
+ICON=icewm.xpm
+EXEC=/usr/X11R6/bin/icewm
+DESC=A Light Window-Manager
+SCRIPT:
+exec /usr/X11R6/bin/icewm
+--@@--
+NAME=AnotherLevel
+ICON=AnotherLevel.xpm
+DESC=The AnotherLevel desktop
+EXEC=/usr/share/apps/switchdesk/Xclients.anotherlevel
+SCRIPT:
+exec /usr/share/apps/switchdesk/Xclients.anotherlevel