----------  Messaggio inoltrato  ----------
Subject: Re: [newbie-it] star office
Date: Thu, 4 Jan 2001 22:44:52 +0100
From: ioadamo <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]


> Quindi il file da ritoccare e` /etc/X11/Xsession. IL file ่ il seguente:
>
>#!/bin/bash -login

# Modification for Linux-Mandrake by Chmouel Boudjnah
<[EMAIL PROTECTED]>
# 20000309, Francis Galiegue <[EMAIL PROTECTED]>: imwheel -k added for
 wheel # mice and braindead-not-supporting-wheel-yet toolkits (this includes
 Qt...)

# redirect errors to a file in user's home directory if we can
for errfile in "$HOME/.xsession-errors" "${TMPDIR-/tmp}/xses-$USER"
"/tmp/xses-$USER"
do
    if ( cp /dev/null "$errfile" 2> /dev/null )
    then
        chmod 600 "$errfile"
        exec > "$errfile" 2>&1
        break
    fi
done

# Mandrake default background
xsetroot -solid "#666699"

if [ -x /usr/bin/ssh-agent -a -r $HOME/.ssh/identity ]; then
    SSH_AGENT="/usr/bin/ssh-agent --"
fi

# clean up after xbanner
if [ -f /usr/X11R6/bin/freetemp ]; then
    freetemp
fi

userresources=$HOME/.Xresources
userresources2=$HOME/.Xdefaults
sysresources=/etc/X11/Xresources

# merge in defaults and keymaps
if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $userresources ]; then
    xrdb -merge $userresources
fi

if [ -f $userresources2 ]; then
    xrdb -merge $userresources2
fi

if [ -x /etc/X11/xinit/fixkeyboard ]; then
    /etc/X11/xinit/fixkeyboard
fi

if [ -z "$BROWSER" ] ; then
        # we need to find a browser on this system
        BROWSER=`which netscape`
        if [ -z "$BROWSER" ] || [ ! -e "$BROWSER" ] ; then
        # not found yet
                BROWSER=
        fi
fi

if [ -z "$BROWSER" ] ; then
        # we need to find a browser on this system
        BROWSER=`which lynx`
        if [ -z "$BROWSER" ] || [ ! -e "$BROWSER" ] ; then
        # not found yet
                BROWSER=
        else
                BROWSER="xterm -font 9x15 -e lynx"
        fi
fi
export BROWSER

export HELP_BROWSER="$BROWSER"

if [ -x /usr/sbin/chksession ];then
    LIST=$(/usr/sbin/chksession -l)
else
    LIST="kde Gnome AfterStep Icewm AnotherLevel failsafe"
fi

# run scripts in /etc/X11/xinit.d
for i in /etc/X11/xinit.d/* ; do
    [ -d $i ] && continue
    # Don't run ??foo.{rpmsave,rpmorig,rpmnew} scripts
    [ "${i%.rpmsave}" != "${i}" ] && continue
    [ "${i%.rpmorig}" != "${i}" ] && continue
    [ "${i%.rpmnew}" != "${i}" ] && continue

    if [ -x $i ]; then
        $i &
    fi
done

# now, we see if xdm/gdm/kdm has asked for a specific environment
if [ $# = 1 ]; then
    case $1 in
        failsafe)
        exec $SSH_AGENT xterm -geometry 80x24-0-0
        ;;
        default)
        ;;
        *)
        exec $SSH_AGENT /bin/sh -c "$(/usr/sbin/chksession -x=$1)"
        ;;
    esac
else
    # otherwise, take default action
    if [ -x "$HOME/.xsession" ]; then
        exec $SSH_AGENT "$HOME/.xsession"
    elif [ -x "$HOME/.Xclients" ]; then
        exec $SSH_AGENT "$HOME/.Xclients"
    fi

    # We may try with chksession
    if [ -x /usr/sbin/chksession ];then
    #get the first available
        SESSION=$(/usr/sbin/chksession -F)
        [ "$SESSIONxxx" != "xxx" ] && exec $SSH_AGENT sh -c "$(/usr/sbin/chksession
-x=$SESSION)"
    fi

    # Argh! Nothing good is installed. Fall back to icewm
    if [ -x /usr/X11R6/bin/icewm-light ];then
        exec $SSH_AGENT /usr/X11R6/bin/icewm-light
    else
        # gosh, neither fvwm95 nor fvwm2 is available;
        # fall back to failsafe settings
        xclock -geometry 100x100-5+5 &
        xterm -geometry 80x30-50+150 &
        if [ -x /usr/bin/netscape -a -f /usr/doc/HTML/index.html ]; then
            netscape /usr/doc/HTML/index.html &
        fi
        if [ -x /usr/X11R6/bin/icewm-light ];then
            exec $SSH_AGENT icewm-light
        elif [ -x /usr/X11R6/bin/twm ];then
            exec $SSH_AGENT twm
        fi
    fi
fi

# otherwise, take default action
if [ -x "$HOME/.xsession" ]; then
    exec $SSH_AGENT "$HOME/.xsession"
elif [ -x "$HOME/.Xclients" ]; then
    exec $SSH_AGENT "$HOME/.Xclients"
elif [ -x /etc/X11/xinit/Xclients ]; then
    exec $SSH_AGENT /etc/X11/xinit/Xclients
else
    exec $SSH_AGENT xsm
fi

> Dovresti avere qualcosa del tipo...non ce l'ho....ho l'impressone di essere

finito in un vero e proprio labirinto !!!!!
ma fa riferimento a un file SESSION=$(/usr/sbin/chksession -F) che sono
andato puntualmente a vedere e te lo mostro:

#!/usr/bin/perl
# (c) MandrakeSoft, Chmouel Boudjnah <[EMAIL PROTECTED]>
# 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.
              -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; }
  }
}

usage(1)
  if @ARGV < 1;

while ($ARGV[0] =~ /^--/ || $ARGV[0] =~ /^-/) {
  $_ = shift;
  if (/^--xsession=([^ ]+)/ || /^-x=([^ ]+)/) {
    $xsession = $1;
  } elsif (/^--first/ || /^-F/) {
    $first++;
  } elsif (/^--gdm/ || /^-g/) {
    die "You should be root to build gdm session\n" if $< != 0;
    $gdm++;
  } elsif (/^--list/ || /^-l/) {
    $list++;
  } elsif (/^--kdmsess/ || /^-k/) {
    $kdm++;
  } elsif (/^--test/ || /^-t/) {
    $test++;
  } elsif (/^--dir=([^ ]+)/ || /^-d=([^ ]+)/) {
    $dir = $1;
  } elsif (/^--help/ || /^-h/ || /^-\?/) {
    usage(0);
  } else {
    print STDERR "Unrecognized switch: $_\n";
    usage(1);
  }
}

$dir = $test ? './wmsession.d/' : '/etc/X11/wmsession.d/' unless $dir;
chdir $dir; parse_file ("$dir/$_") for <*>;

sub cat { my ($f) = @_; local *F; open F, $f; join '', <F> }
my ($e) = cat("/etc/sysconfig/desktop") =~ /(\S+)/;
@lf = sort { $b =~ /$e/i <=> $a =~ /$e/i } @lf;

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 or die "Can't open $d\n";
  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\n";
    print FH "exec /etc/X11/Xsession $file\n";
    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";
        if ( -x '/usr/X11R6/bin/icewm' ) {
                print "icewm\n";
        } elsif ( -x '/usr/X11R6/bin/twm' ) {
                print "twm\n";
        } else {
                print "xterm -geometry 67x14+384+446\n";
        }
  }
  exit (0);
}

@lf ? print shift @lf, "\n" : print "Default\n"
  if $first;

if ($list) {
  if (@lf) {
    my $p; for(@lf) { $p .= /$lf[-1]/ ? "$_ default failsafe" : "$_ " } print
"$p\n";
 } else {
    print "Default\n";
  }
}



Qui fa riferimento a un file che ่ contenuto in etc/X11/gdm/Sessions/ che ti

mostro:
>#!/bin/bash -login

# $XConsortium: Xsession /main/10 1995/12/18 18:21:28 gildea $

case $# in
1)
        case $1 in
        failsafe)
                exec xterm -geometry 80x24-0-0
                ;;

        esac
esac

# redirect errors to a file in user's home directory if we can
for errfile in "$HOME/.xsession-errors" "${TMPDIR-/tmp}/xses-$USER"
"/tmp/xses-$USER"
do
        if ( cp /dev/null "$errfile" 2> /dev/null )
        then
                chmod 600 "$errfile"
                exec > "$errfile" 2>&1
                break
        fi
done

# clean up after xbanner
freetemp

startup=$HOME/.xsession
resources=$HOME/.Xresources

if [ -x "$startup" ]; then
        exec "$startup"
elif [ -x "$HOME/.Xclients" ]; then
        exec "$HOME/.Xclients"
elif [ -x /etc/X11/xinit/Xclients ]; then
        exec /etc/X11/xinit/Xclients
else
        if [ -f "$resources" ]; then
                xrdb -load "$resources"
        fi
        exec xsm

finalmente c'e riferimento a qualcosa di simile a quello che tu mi hai detto
in questo file ho inserito questo sotto il case$1 ma non ่ successo niente

soffice)
                exec $HOME/office52/soffice
                ;;

>se non erro tu hai la 7.1 , ่ possibile che abbiano cambiato qualcosa nella

7.2, ma mi sembra diventata un impresa impossibile e inoltre mi st๒ rompendo
i c......
Se hai ancora qualcosa da suggerirmi ti ringrazio molto altrimenti grazie lo
stesso.
un cordiale saluto
Federico

-------------------------------------------------------

Rispondere a