xinitrc: Use 'exec' and comment logoff cleaning issue
parent
f9c57990dc
commit
f91890a06d
21
.xinitrc
21
.xinitrc
|
@ -1,17 +1,28 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
## Run site init scripts. Usually not necessary.
|
||||||
|
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
|
||||||
|
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
|
||||||
|
[ -x "$f" ] && . "$f"
|
||||||
|
done
|
||||||
|
unset f
|
||||||
|
fi
|
||||||
|
|
||||||
## Source environment config.
|
## Source environment config.
|
||||||
[ -f ~/.xprofile ] && . ~/.xprofile
|
[ -f ~/.xprofile ] && . ~/.xprofile
|
||||||
|
|
||||||
## Launch session
|
## Launch session
|
||||||
## Note: we do not 'exec' as we want to clean the session on exit.
|
|
||||||
if [ $# -eq 1 ] && command -v $1 >/dev/null 2>&1; then
|
if [ $# -eq 1 ] && command -v $1 >/dev/null 2>&1; then
|
||||||
$1
|
exec $1
|
||||||
else
|
else
|
||||||
awesome
|
exec awesome
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## TODO: This is not needed since all forked processes will be killed anyway
|
## TODO: When the session is terminated, some forked processes must be closed
|
||||||
## when 'exec' is not called. But why?
|
## manually. This can automated by setting a shell 'trap' in .profile when
|
||||||
|
## logged from a TTY. The trick does not work from an X login manager. This file
|
||||||
|
## could be the place where to clean everything, but it will not be parsed by
|
||||||
|
## some login managers. Beside, systemd sessions may sigkill all user apps on
|
||||||
|
## logoff, preventing a clean termination.
|
||||||
# command -v sessionclean >/dev/null 2>&1 && sessionclean
|
# command -v sessionclean >/dev/null 2>&1 && sessionclean
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue