forked from instantOS/instantWM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartinstantos
More file actions
executable file
·63 lines (51 loc) · 1.66 KB
/
startinstantos
File metadata and controls
executable file
·63 lines (51 loc) · 1.66 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
#!/bin/bash
###############################################
## x session for instantOS, use with lightdm ##
###############################################
# used for shutdown
# try to obtain a temp dir unique to the user, to enable
# instantOS xsessions for concurrent users on the same machine
RTD="$(instantruntimedir)"
if [ -z "$RTD" ]; then
mkdir -p /tmp/instantos
RTD="/tmp/instantos"
fi
echo $$ >"${RTD}"/instantosrunning
# just in case, some systems might not do this
cd || echo "failed to access home directory"
# execute autostart even if instantautostart doesn't work
if ! command -v instantautostart &>/dev/null; then
sleep 4
bash ~/.instantautostart
fi &
# needed to fix some misbehaving applications
if iconf wmname; then
wmname "$(iconf wmname)"
fi
[ -e ~/.instantsession ] && source ~/.instantsession
# loop so crashing instantwm doesn't end the x session
while [ -e "${RTD}"/instantosrunning ]; do
# allow changing wm on the fly
if [ -e "${RTD}"/wmoverride ]; then
if command -v "$(cat "${RTD}"/wmoverride)" &>/dev/null; then
"$(cat ${RTD}/wmoverride)" 2>~/.instantos.log &
WMPID="$!"
echo "$WMPID" >"${RTD}"/wmpid
while kill -0 "$WMPID"; do
sleep 1
done
fi
rm "${RTD}"/wmoverride
else
# Log stderror or stdout to a file
if ! [ -e .local/share ]; then
mkdir -p ~/.local/share
fi
export XDG_CURRENT_DESKTOP="instantwm"
if iconf -i debug; then
instantwm &>~/.local/share/instantos.log
else
instantwm 2>~/.local/share/instantos.log
fi
fi
done