xinit improvements

This commit is contained in:
aliriza committed 2023-02-16 12:32:45 +00:00
1 parent 349ab6003c
commit 35063aab6e
7 files changed
+33 -4

No files matched your search

+55
View File
@@ -0,0 +1,55 @@
#!/bin/sh
#
# X session wrapper
echo "Running X session wrapper"
# Load profile
for file in /etc/profile "$HOME/.profile" /etc/xprofile "$HOME/.xprofile"; do
if [ -f "$file" ]; then
echo "Loading profile from $file";
. "$file"
fi
done
# Load resources
for file in /etc/X11/Xresources "$HOME/.Xresources"; do
if [ -f "$file" ]; then
echo "Loading resource: $file"
xrdb -nocpp -merge "$file"
fi
done
# Load keymaps
use_xkbmap=false
for file in "/etc/X11/Xkbmap" "$HOME/.Xkbmap"; do
if [ -f "$file" ]; then
echo "Loading keymap: $file"
setxkbmap `cat "$file"` && use_xkbmap=true
fi
done
# Load xmodmap if not using XKB
if ! $use_xkbmap; then
for file in "/etc/X11/Xmodmap" "$HOME/.Xmodmap"; do
if [ -f "$file" ]; then
echo "Loading modmap: $file"
xmodmap "$file"
fi
done
fi
# Run all system xinitrc shell scripts.
xinitdir="/etc/X11/xinit/xinitrc.d"
if [ -d "$xinitdir" ]; then
for script in $xinitdir/*; do
echo "Loading xinit script $script"
if [ -x "$script" -a ! -d "$script" ]; then
. "$script"
fi
done
fi
echo "X session wrapper complete, running session $@"
exec $@
+4
View File
@@ -0,0 +1,4 @@
# Configuration for /etc/init.d/xinit
## X11 autologin service
## Target user name (default=root)
#USER=root
+14
View File
@@ -0,0 +1,14 @@
#!/sbin/openrc-run
name="xinit"
description="X11 autologin service"
start(){
exec /bin/busybox su - $USER -c "exec /usr/bin/startx"
}
depend()
{
need dbus
provide gui display-manager getty
}
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
if [ -f /var/lib/ymp/sysconf/xinit/postinstall.done ] ; then
mkdir -p /etc/X11/xinit/xinitrc.d /etc/skel/
touch /var/lib/ymp/sysconf/xinit/postinstall.done
fi
+51
View File
@@ -0,0 +1,51 @@
#!/bin/sh
# $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
xinitdir=/etc/X11
sysresources=$xinitdir/Xresources
sysmodmap=$xinitdir/Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f $userresources ]; then
xrdb -merge $userresources
fi
if [ -f $usermodmap ]; then
xmodmap $usermodmap
fi
# First try ~/.xinitrc
if [ -f "$HOME/.xinitrc" ]; then
XINITRC="$HOME/.xinitrc"
if [ -x $XINITRC ]; then
# if the x bit is set on .xinitrc
# it means the xinitrc is not a
# shell script but something else
exec $XINITRC "$@"
else
exec /bin/sh "$HOME/.xinitrc" "$@"
fi
fi
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?* ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
for p in startxfce4 startfluxbox xfce4-terminal \
mrxvt urxvt st xterm; do
command -v "$p" >/dev/null && exec "$p"
done
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/bin/X -nolisten tcp "$@"