-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathxinitrc
More file actions
executable file
·73 lines (64 loc) · 1.98 KB
/
xinitrc
File metadata and controls
executable file
·73 lines (64 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
# This file (.xinitrc) is run with startx
# If startx has no parameter, LXSESSION will be set to i3
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
# umask 022
export XINITRC=true
# use bash for "exec -l", howto run login shell by /bin/sh ?
# if startx has an argument, then make it LXSESSION
if [ $# -eq 1 -a -n "$1" ]; then
LXSESSION=$1
else
# default session
LXSESSION=/usr/bin/i3
fi
[ -f /etc/xprofile ] && . /etc/xprofile
[ -f ~/.xprofile ] && . ~/.xprofile
#include sbin in PATH
if [ -d "/sbin" ] ; then
PATH="/sbin:$PATH"
fi
if [ -d "/usr/sbin" ] ; then
PATH="/usr/sbin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
# xinitrc-common should normally exist on fedora, so the elifs' content will be skipped
# Execute LXSESSION (i3)
if [ -f /etc/X11/xinit/xinitrc-common ]; then
# fedora
. /etc/X11/xinit/xinitrc-common
exec $SSH_AGENT /bin/sh -c "exec -l bash -c \"$LXSESSION\""
elif [ -x /etc/X11/xinit/Xsession ]; then
# fedora
exec $SSH_AGENT /bin/sh -c "exec /etc/X11/xinit/Xsession \"$LXSESSION\""
elif [ -x /etc/X11/Xsession ]; then
# mandriva, debian, ubuntu
exec $SSH_AGENT /bin/sh -c "exec /etc/X11/Xsession \"$LXSESSION\""
elif [ -x /etc/X11/xinit/xinitrc ]; then
#suse
export WINDOWMANAGER=$LXSESSION
exec $SSH_AGENT /bin/sh -c "exec -l bash -c /etc/X11/xinit/xinitrc"
else
# unknown, user should custom /etc/lxdm/xinitrc self
if [ -x /etc/lxdm/xinitrc ]; then
. /etc/lxdm/xinitrc "$LXSESSION"
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
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS";
then
eval "$(dbus-launch --sh-syntax --exit-with-session)"
fi
exec $SSH_AGENT /bin/sh -c "exec -l bash -c \"$LXSESSION\""
fi