forked from instantOS/instantWM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
startinstantos
executable file
·46 lines (40 loc) · 1.18 KB
/
startinstantos
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
#!/bin/bash
###############################################
## x session for instantOS, use with lightdm ##
###############################################
# used for shutdown
echo $$ > /tmp/instantosrunning
# just in case, some systems might not do this
cd
# execute autostart even if instantautostart doesn't work
if ! command -v instantautostart &>/dev/null; then
sleep 4
bash ~/.instantautostart
fi &
# loop so crashing instantwm doesn't end the x session
while [ -e /tmp/instantosrunning ]; do
# allow changing wm on the fly
if [ -e /tmp/wmoverride ]; then
if command -v "$(cat /tmp/wmoverride)" &>/dev/null; then
"$(cat /tmp/wmoverride)" 2>~/.instantos.log &
WMPID="$!"
echo "$WMPID" >/tmp/wmpid
while kill -0 "$WMPID"; do
sleep 1
done
fi
rm /tmp/wmoverride
else
# Log stderror or stdout to a file
if ! [ -e .local/share ]
then
mkdir -p ~/.local/share
fi
if iconf -i debug
then
instantwm &>~/.local/share/instantos.log
else
instantwm 2>~/.local/share/instantos.log
fi
fi
done