In comp.windows.x, John Tsiombikas <
nuc...@member.fsf.org> wrote:
> Do you have any ideas or suggestions on how to find out what's going on
> and fix this? Am I missing something here?
The startx program is usually a shell script:
$ file /usr/bin/startx
/usr/bin/startx: POSIX shell script text
$ head -15 /usr/bin/startx
#!/bin/sh
# $Xorg: startx.cpp,v 1.3 2000/08/17 19:54:29 cpqbld Exp $
#
# This is just a sample implementation of a slightly less primitive
# interface than xinit. It looks for user .xinitrc and .xserverrc
# files, then system xinitrc and xserverrc files, else lets xinit choose
# its default. The system xinitrc should probably do things like check
# for .Xresources files and merge them in, startup up a window manager,
# and pop a clock and serveral xterms.
#
# Site administrators are STRONGLY urged to write nicer versions.
#
# $XFree86: xc/programs/xinit/startx.cpp,v 3.16tsi Exp $
$
See that "STRONGLY urged" comment? If you have been around a while
(X11R3 seems so recent...) you know that what exactly startx does
various a lot. Read the one on your system.
I find it easier to just wholesale replace the startx script with
my own, to better control what defaults exist.
Set your environment variables, eg XAUTHORITY, and then call xinit:
xinit $HOME/.Xclients $opt_client_args -- /usr/bin/X $opt_server_args
The .Xclients file starts your initial programs (eg, xterms,
window manager, xclock, whaterver), and that is where your xmodmap
command should exit. The X environment will shut down when the Xclients
script ends, so write it with that in mind. Typically you start
everything in the background ("xterm ... &") except for the window
manager.
Here's a bit of my .Xclients by way of example:
#!/bin/ksh
# geometry as reported by xwininfo, alas this is wm dependent
# Top row
xterm -geometry 80x24+0+0 &
xterm -geometry 80x24+504+0 &
xterm -geometry 107x24-6+0 &
# ...
# Windowless commands
map=$HOME/xmodmap/2011-opensuse-dell/tab-numlock-caps.xmodmap
xmodmap $map
# xev | perl -wlne 'if(/ (keycode .*\)),/){print $1}'
xset=
# F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12
for n in 67 68 69 70 71 72 73 74 75 76 95 96 ; do
# -r keycode : surpress autorepeat for keycode
xset="$xset -r $n"
done
xset $xset
xscreensaver -nosplash &
icewm &
keypid=$!
# some window managers set their own background
sleep 2
xsetroot -solid lightblue
wait $keypid
Elijah
------
.Xclients are the easiest shell scripts to write