Add Red Hat specific custom scripts

This commit is contained in:
mharris 2005-11-01 02:00:56 +00:00
parent bf13edaa1b
commit afd9eb9dd4
6 changed files with 254 additions and 0 deletions

65
Xclients Executable file
View File

@ -0,0 +1,65 @@
#!/bin/bash
# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This
# copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the
# GNU General Public License version 2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
GSESSION="$(which gnome-session 2>/dev/null)"
STARTKDE="$(which startkde 2>/dev/null)"
# check to see if the user has a preferred desktop
PREFERRED=
if [ -f /etc/sysconfig/desktop ]; then
. /etc/sysconfig/desktop
if [ "$DESKTOP" = "GNOME" ]; then
PREFERRED="$GSESSION"
elif [ "$DESKTOP" = "KDE" ]; then
PREFERRED="$STARTKDE"
fi
fi
if [ -n "$PREFERRED" ]; then
exec "$PREFERRED"
fi
# now if we can reach here, either no desktop file was present,
# or the desktop requested is not installed.
# by default, we run GNOME.
if [ -n "$GSESSION" ]; then
exec "$GSESSION"
fi
# if GNOME isn't installed, try KDE.
if [ -n "$STARTKDE" ]; then
exec "$STARTKDE"
fi
# Failsafe.
# these files are left sitting around by TheNextLevel.
rm -f $HOME/Xrootenv.0
# Argh! Nothing good is installed. Fall back to twm
{
# gosh, neither fvwm95 nor fvwm2 is available;
# fall back to failsafe settings
if [ -x /usr/bin/xclock ] ; then
/usr/bin/xclock -geometry 100x100-5+5 &
elif [ -x /usr/bin/xclock ] ; then
/usr/bin/xclock -geometry 100x100-5+5 &
fi
if [ -x /usr/bin/xterm ] ; then
/usr/bin/xterm -geometry 80x50-50+150 &
fi
if [ -x /usr/bin/firefox -a -f /usr/share/doc/HTML/index.html ]; then
/usr/bin/firefox /usr/share/doc/HTML/index.html &
fi
if [ -x /usr/bin/twm ] ; then
exec /usr/bin/twm
fi
}

25
Xmodmap Normal file
View File

@ -0,0 +1,25 @@
! /etc/X11/Xmodmap
!
! global Xmodmap file -- used by both xdm and xinit (startx)
! keycode and keysym remapping should generally be used only if the X
! server config file has been configured to disable the XKEYBOARD
! extension
! i386 and alpha
! keycode 22 = BackSpace
! keycode 107 = Delete
! powerpc
! keycode 59 = BackSpace
! keycode 125 = Delete
! sparc
! keycode 50 = BackSpace
! keycode 73 = Delete
! Euro sign support
! keycode 26 = e E currency
! keycode 54 = c C cent
! keycode 113 = Mode_switch Mode_switch Multi_key

13
Xresources Normal file
View File

@ -0,0 +1,13 @@
! This is the global resources file that is loaded when
! all users log in, as well as for the login screen
! Fix the Xft dpi to 96; this prevents tiny fonts
! or HUGE fonts depending on the screen size.
Xft.dpi: 96
! hintstyle: medium means that (for Postscript fonts) we
! position the stems for maximum constrast and consistency
! but don't force the stems to integral widths. hintnone,
! hintslight, and hintfull are the other possibilities.
Xft.hintstyle: hintmedium
Xft.hinting: true

32
xinitrc Executable file
View File

@ -0,0 +1,32 @@
#!/bin/sh
# Copyright (C) 1999 - 2005 Red Hat, Inc. All rights reserved. This
# copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the
# GNU General Public License version 2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Authors:
# Mike A. Harris <mharris@redhat.com>
# Mandatorily source xinitrc-common, which is common code shared between the
# Xsession and xinitrc scripts which has been factored out to avoid duplication
. /etc/X11/xinit/xinitrc-common
# The user may have their own clients they want to run. If they don't,
# fall back to system defaults.
if [ -f $HOME/.Xclients ]; then
exec $DBUS_LAUNCH $HOME/.Xclients || \
exec $HOME/.Xclients
elif [ -f /etc/X11/xinit/Xclients ]; then
exec $DBUS_LAUNCH /etc/X11/xinit/Xclients || \
exec /etc/X11/xinit/Xclients
else
# Failsafe settings. Although we should never get here
# (we provide fallbacks in Xclients as well) it can't hurt.
[ -x /usr/bin/xclock ] && /usr/bin/xclock -geometry 100x100-5+5 &
[ -x /usr/bin/xterm ] && xterm -geometry 80x50-50+150 &
[ -x /usr/bin/twm ] && /usr/bin/twm
fi

75
xinitrc-common Normal file
View File

@ -0,0 +1,75 @@
#!/bin/bash
# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This
# copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the
# GNU General Public License version 2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# xinitrc-common
#
# This is common code shared by both Xsession and xinitrc scripts. Be sure
# to take this into account when fixing bugs or adding new functionality.
# Set up i18n environment
if [ -r /etc/profile.d/lang.sh ]; then
. /etc/profile.d/lang.sh
fi
[ -x /usr/bin/xsetroot ] && /usr/bin/xsetroot -solid '#222E45'
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
userxkbmap=$HOME/.Xkbmap
sysresources=/etc/X11/Xresources
sysmodmap=/etc/X11/Xmodmap
sysxkbmap=/etc/X11/Xkbmap
# merge in defaults
[ -r "$sysresources" ] && xrdb -merge "$sysresources"
[ -r "$userresources" ] && xrdb -merge "$userresources"
# merge in keymaps
if [ -r "$sysxkbmap" ]; then
setxkbmap $(cat "$sysxkbmap")
XKB_IN_USE=yes
fi
if [ -r "$userxkbmap" ]; then
setxkbmap $(cat "$userxkbmap")
XKB_IN_USE=yes
fi
# xkb and xmodmap don't play nice together
if [ -z "$XKB_IN_USE" ]; then
[ -r "$sysmodmap" ] && xmodmap "$sysmodmap"
[ -r "$usermodmap" ] && xmodmap "$usermodmap"
fi
unset XKB_IN_USE
# run all system xinitrc shell scripts.
for file in /etc/X11/xinit/xinitrc.d/* ; do
if echo $file | grep -q "\.sh$" ; then
. $file
else
echo "warning: $file does not end in .sh extension, ignoring"
fi
done
# Prefix launch of session with ssh-agent if available and not already running.
SSH_AGENT=
if [ -x /usr/bin/ssh-agent -a -z "$SSH_AGENT_PID" ]; then
if [ "x$TMPDIR" != "x" ]; then
SSH_AGENT="/usr/bin/ssh-agent /bin/env TMPDIR=$TMPDIR"
else
SSH_AGENT="/usr/bin/ssh-agent"
fi
fi
DBUS_LAUNCH=
[ -x /usr/bin/dbus-launch -a -z "$DBUS_SESSION_BUS_ADDRESS" ] && DBUS_LAUNCH="/usr/bin/dbus-launch --exit-with-session"

44
xinput.sh Normal file
View File

@ -0,0 +1,44 @@
#!/bin/bash
# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This
# copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the
# GNU General Public License version 2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# X Input method setup script
# Load up the user and system locale settings
oldterm=$TERM
unset TERM
if [ -r /etc/profile.d/lang.sh ]; then
. /etc/profile.d/lang.sh
fi
[ -n "$oldterm" ] && export TERM=$oldterm
tmplang=${LC_CTYPE:-${LANG:-"en_US.UTF-8"}}
## try to source ~/.xinput.d/ll_CC or /etc/X11/xinit/xinput.d/ll_CC to
## setup the input method for locale (CC is needed for Chinese for example)
# unset env vars to be safe
unset XIM XIM_PROGRAM XIM_ARGS XMODIFIERS GTK_IM_MODULE QT_IM_MODULE
lang_region=$(echo $tmplang | sed -e 's/\..*//')
for f in $HOME/.xinput.d/${lang_region} \
$HOME/.xinput.d/default \
/etc/X11/xinit/xinput.d/${lang_region} \
/etc/X11/xinit/xinput.d/default ; do
[ -r $f ] && source $f && break
done
unset lang_region
[ -n "$GTK_IM_MODULE" ] && export GTK_IM_MODULE
[ -n "$QT_IM_MODULE" ] && export QT_IM_MODULE
# setup XMODIFIERS
[ -z "$XMODIFIERS" -a -n "$XIM" ] && XMODIFIERS="@im=$XIM"
[ -n "$XMODIFIERS" ] && export XMODIFIERS
# execute XIM_PROGRAM
[ -n "$XIM_PROGRAM" ] && which "$XIM_PROGRAM" > /dev/null 2>&1 && LANG="$tmplang" "$XIM_PROGRAM" $XIM_ARGS &