stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [STUMP] Building StumpWM/CLisp on Ubuntu


From: Sébastien Vauban
Subject: Re: [STUMP] Building StumpWM/CLisp on Ubuntu
Date: Tue, 10 Nov 2009 15:09:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Vitaly,

Vitaly Mayatskikh wrote:
> At Tue, 10 Nov 2009 13:56:35 +0100, Sébastien Vauban wrote:
>
>> I don't know if this is the correct method, but here is what I did:
>> 
>> 1. logged out of StumpWM, back to GDM
>> 2. logged in, choosing xterm as Session
>> 3. in xterm window, typed "script console.log"
>> 4. typed "strace stumpwm"
>
> No, you've straced stumpwm. I'm not sure if GDM ever bothers to read
> ~/.xsession. I use XDM, it works.

OK. One difference.


> You can check what GDM reads and executes somewhere in startup scripts in
> /etc/X11.

I've found the file `/etc/gdm/Xsession', whose beginning is this:

--8<---------------cut here---------------start------------->8---
#!/bin/sh
#
# This is SORT OF LIKE an X session, but not quite.  You get a command as the
# first argument (it could be multiple words, so run it with "eval").  As a
# special case, the command can be:
#  default - Run the appropriate Xclients startup (see the code below)
#  custom - Run ~/.xsession and if that's not available run 'default'
#
# (Note that other arguments could also follow, but only the command one is
# right now relevant and supported)
#
# The output is ALREADY redirected to .xsession-errors in GDM.  This way
# .xsession-errors actually gets more output such as if the PreSession script
# is failing.  This also prevents DoS attacks if some app in the users session
# can be prodded to dump lots of stuff on the stdout/stderr.  We wish to be
# robust don't we?  In case you wish to use an existing script for other DM's,
# you can just not redirect when GDMSESSION is set.  GDMSESSION will always
# be set from gdm.
#
# Also note that this is not run as a login shell, this is just executed.
# This is why we source the profile files below.
#
# based on:
# $XConsortium: Xsession /main/10 1995/12/18 18:21:28 gildea $

command="$@"

# this will go into the .xsession-errors along with all other echo's
# good for debugging where things went wrong
echo "$0: Beginning session setup..."

# First read /etc/profile and .profile
test -f /etc/profile && . /etc/profile
test -f "$HOME/.profile" && . "$HOME/.profile"
# Second read /etc/xprofile and .xprofile for X specific setup
test -f /etc/xprofile && . /etc/xprofile
test -f "$HOME/.xprofile" && . "$HOME/.xprofile"

# Translation stuff
if [ -x "/usr/lib/gdm/gdmtranslate" ] ; then
  gdmtranslate="/usr/lib/gdm/gdmtranslate"
else
  gdmtranslate=
fi

# Note that this should only go to zenity dialogs which always expect utf8
gettextfunc () {
  if [ "x$gdmtranslate" != "x" ] ; then
    "$gdmtranslate" --utf8 "$1"
  else
    echo "$1"
  fi
}

OLD_IFS=$IFS

gdmwhich () {
  COMMAND="$1"
  OUTPUT=
  IFS=:
  for dir in $PATH
  do
    if test -x "$dir/$COMMAND" ; then
      if test "x$OUTPUT" = "x" ; then
        OUTPUT="$dir/$COMMAND"
      fi
    fi
  done
  IFS=$OLD_IFS 
  echo "$OUTPUT"
}

zenity=`gdmwhich zenity`

# Note: ~/.xsession-errors is now done in the daemon so that it
# works for ALL sessions (except ones named 'Failsafe')

# clean up after xbanner
freetemp=`gdmwhich freetemp`
if [ -n "$freetemp" ] ; then
        "$freetemp"
fi

userresources="$HOME/.Xresources"
usermodmap="$HOME/.Xmodmap"
userxkbmap="$HOME/.Xkbmap"

sysresources=/etc/X11/Xresources 
sysmodmap=/etc/X11/Xmodmap 
sysxkbmap=/etc/X11/Xkbmap

rh6sysresources=/etc/X11/xinit/Xresources 
rh6sysmodmap=/etc/X11/xinit/Xmodmap 

# merge in defaults
if [ -f "$rh6sysresources" ]; then
    xrdb -nocpp -merge "$rh6sysresources"
fi

if [ -f "$sysresources" ]; then
    xrdb -nocpp -merge "$sysresources"
fi

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

# merge in keymaps
if [ -f "$sysxkbmap" ]; then
    setxkbmap `cat "$sysxkbmap"`
    XKB_IN_USE=yes
fi

if [ -f "$userxkbmap" ]; then
    setxkbmap `cat "$userxkbmap"`
    XKB_IN_USE=yes
fi

#
# Eeek, this seems like too much magic here
#
if [ -z "$XKB_IN_USE" -a ! -L /etc/X11/X ]; then
    if grep '^exec.*/Xsun' /etc/X11/X > /dev/null 2>&1 && [ -f 
/etc/X11/XF86Config ]; then
       xkbsymbols=`sed -n -e 's/^[     ]*XkbSymbols[   ]*"\(.*\)".*$/\1/p' 
/etc/X11/XF86Config`
       if [ -n "$xkbsymbols" ]; then
           setxkbmap -symbols "$xkbsymbols"
           XKB_IN_USE=yes
       fi
    fi
fi

# xkb and xmodmap don't play nice together
if [ -z "$XKB_IN_USE" ]; then
    if [ -f "$rh6sysmodmap" ]; then
       xmodmap "$rh6sysmodmap"
    fi

    if [ -f "$sysmodmap" ]; then
       xmodmap "$sysmodmap"
    fi

    if [ -f "$usermodmap" ]; then
       xmodmap "$usermodmap"
    fi
fi

unset XKB_IN_USE

# Normalize languages, some places/distros screw us up in /etc/profile,
# so in case the user did select a language
if [ -n "$GDM_LANG" ]; then
  LANG="$GDM_LANG"
  export LANG

  if [ -n "$LC_ALL" ]; then
    if [ "$LC_ALL" != "$LANG" ]; then
      LC_ALL="$LANG"
    fi
  else
    unset LC_ALL
  fi

  if [ -n "$LANGUAGE" ]; then
    if [ "$LANGUAGE" != "$LANG" ]; then
      LANGUAGE="$LANG"
    fi
  else
    unset LANGUAGE
  fi

  if [ -n "$LINGUAS" ]; then
    if [ "$LINGUAS" != "$LANG" ]; then
      LINGUAS="$LANG"
    fi
  else
    unset LINGUAS
  fi
fi

# run all system xinitrc shell scripts.
if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for i in /etc/X11/xinit/xinitrc.d/* ; do
        if [ -x "$i" ]; then
            . "$i"
        fi
    done
fi

# run /etc/X11/Xsession.d/
OPTIONFILE=/etc/X11/Xsession.options
if [ -d /etc/X11/Xsession.d ]; then
    for i in `ls /etc/X11/Xsession.d/` ; do
        if [ -r "/etc/X11/Xsession.d/$i" ] && expr "$i" : '^[[:alnum:]_-]\+$' > 
/dev/null; then
            . "/etc/X11/Xsession.d/$i"
        fi
    done
fi

if [ "x$command" = "xcustom" ] ; then
  if [ -x "$HOME/.xsession" ]; then
    command="$HOME/.xsession"
  else
    echo "$0: Cannot find ~/.xsession will try the default session"
    command="default"
  fi
fi

if [ "x$command" = "xdefault" ] ; then
  if [ -x "$HOME/.Xclients" ]; then
    command="$HOME/.Xclients"
  elif [ -x /etc/X11/xinit/Xclients ]; then
    command="/etc/X11/xinit/Xclients"
  elif [ -x /etc/X11/Xclients ]; then
    command="/etc/X11/Xclients"
  else
    if [ -n "$zenity" ] ; then
        disptext=`gettextfunc "System has no Xclients file, so starting a 
failsafe xterm session.  Windows will have focus only if the mouse pointer is 
above them.  To get out of this mode type 'exit' in the window."`
      "$zenity" --info --text "$disptext"
    else
      echo "$0: Cannot find Xclients"
    fi
    exec xterm -geometry 80x24+0+0
  fi
fi
--8<---------------cut here---------------end--------------->8---

It first addresses files such as `.profile' and `.xprofile', but still refers
to `.xsession' and `.Xclients' just here above...

Anyway, as it seems to be more portable to have that single command for the
keyboard in `.stumpwmrc', that's where I will definitely put it...


>> Then I got a huge trace...
>> ... ending in a crash...
>
> Sure, SBCL doesn't like to work being ptraced.

OK. Thanks.


>> > Otherwise you can run setxkbmap from ~/.stumpwmrc ;)
>> 
>> That does work like a charm. Thanks a lot!
>> 
>> Though this does not seem to be related with that (?), I now have Num_Lock
>> on by default as soon as I enter the X session. I just have to disable it
>> once per session, but I wonder from where that comes...
>
> Try to play with numlockx. Or, may be, there's a proper switch somewhere in
> GDM configs.

It won't be easy for me to make any worthful finding, I guess, but would I do,
I'll clearly mention it here...

Best regards and thanks for your help,
  Seb

-- 
Sébastien Vauban





reply via email to

[Prev in Thread] Current Thread [Next in Thread]