source: proiecte/PPPP/gdm/data/Init.in @ 134

Last change on this file since 134 was 134, checked in by (none), 14 years ago

gdm sources with the modifications for webcam

File size: 2.6 KB
Line 
1#!/bin/sh
2# Stolen from the debian kdm setup, aren't I sneaky
3# Plus a lot of fun stuff added
4#  -George
5
6PATH=@X_PATH@:$PATH
7OLD_IFS=$IFS
8
9gdmwhich () {
10  COMMAND="$1"
11  OUTPUT=
12  IFS=:
13  for dir in $PATH
14  do
15    if test -x "$dir/$COMMAND" ; then
16      if test "x$OUTPUT" = "x" ; then
17        OUTPUT="$dir/$COMMAND"
18      fi
19    fi
20  done
21  IFS=$OLD_IFS
22  echo "$OUTPUT"
23}
24
25sysresources=/etc/X11/Xresources
26
27# merge in defaults
28if [ -f "$sysresources" ]; then
29    xrdb -merge "$sysresources"
30fi
31
32sysmodmap=/etc/X11/Xmodmap
33
34XMODMAP=`gdmwhich xmodmap`
35if [ "x$XMODMAP" != "x" ] ; then
36  if [ "x$GDM_PARENT_DISPLAY" = "x" ]; then
37    if [ -f $sysmodmap ]; then
38      $XMODMAP $sysmodmap
39    fi
40  else
41    ( DISPLAY=$GDM_PARENT_DISPLAY XAUTHORITY=$GDM_PARENT_XAUTHORITY $XMODMAP -pke ) | $XMODMAP -
42  fi
43
44  #
45  # Switch Sun's Alt and Meta mod mappings
46  #
47
48  UNAME=`gdmwhich uname`
49  PROCESSOR=`$UNAME -p`
50  if [ "x$PROCESSOR" = "xsparc" ]; then
51    if $XMODMAP | /usr/bin/grep mod4 | /usr/bin/grep Alt > /dev/null 2>/dev/null
52    then
53      $XMODMAP -e "clear Mod1" \
54               -e "clear Mod4" \
55               -e "add Mod1 = Alt_L" \
56               -e "add Mod1 = Alt_R" \
57               -e "add Mod4 = Meta_L" \
58               -e "add Mod4 = Meta_R"
59    fi
60  fi
61fi
62
63SETXKBMAP=`gdmwhich setxkbmap`
64if [ "x$SETXKBMAP" != "x" ] ; then
65  # FIXME: is this all right?  Is this completely on crack?
66  # What this does is move the xkb configuration from the GDM_PARENT_DISPLAY
67  # FIXME: This should be done in code.  Or there must be an easier way ...
68  if [ -n "$GDM_PARENT_DISPLAY" ]; then
69    XKBSETUP=`( DISPLAY=$GDM_PARENT_DISPLAY XAUTHORITY=$GDM_PARENT_XAUTHORITY $SETXKBMAP -v )`
70    if [ -n "$XKBSETUP" ]; then
71      XKBKEYMAP=`echo "$XKBSETUP" | grep '^keymap' | awk '{ print $2 }'`
72      XKBTYPES=`echo "$XKBSETUP" | grep '^types' | awk '{ print $2 }'`
73      XKBCOMPAT=`echo "$XKBSETUP" | grep '^compat' | awk '{ print $2 }'`
74      XKBSYMBOLS=`echo "$XKBSETUP" | grep '^symbols' | awk '{ print $2 }'`
75      XKBGEOMETRY=`echo "$XKBSETUP" | grep '^geometry' | awk '{ print $2 }'`
76      if [ -n "$XKBKEYMAP" ]; then
77        $SETXKBMAP -keymap "$XKBKEYMAP"
78      elif [ -n "$XKBTYPES" -a -n "$XKBCOMPAT" -a -n "$XKBSYMBOLS" -a -n "$XKBGEOMETRY" ]; then
79        $SETXKBMAP -types "$XKBTYPES" -compat "$XKBCOMPAT" -symbols "$XKBSYMBOLS" -geometry "$XKBGEOMETRY"
80      elif [ -n "$XKBTYPES" -a -n "$XKBCOMPAT" -a -n "$XKBSYMBOLS" ]; then
81        $SETXKBMAP -types "$XKBTYPES" -compat "$XKBCOMPAT" -symbols "$XKBSYMBOLS"
82      elif [ -n "$XKBSYMBOLS" ]; then
83        $SETXKBMAP -symbols "$XKBSYMBOLS"
84      fi
85    fi
86  fi
87fi
88
89exit 0
Note: See TracBrowser for help on using the repository browser.