summaryrefslogtreecommitdiff
path: root/tohu/amber/bin/start-tohu
blob: c8c4b708168d3ea6f32d4bd2c3aec533ac61d82d (plain)
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
#!/bin/sh
export XKB_DEFAULT_LAYOUT=de
export GDK_DPI_SCALE=1.4
export QT_FONT_DPI=134
export XCURSOR_SIZE=32
if [ -z "$XDG_RUNTIME_DIR" ]; then
  export XDG_RUNTIME_DIR="/tmp/$(id -u)-runtime-dir"
  mkdir -p "$XDG_RUNTIME_DIR"
  chmod 0700 "$XDG_RUNTIME_DIR"
fi

export PLAN9="/usr/lib/plan9"
case ":$PATH:" in
  *":$PLAN9/bin:"*) ;;
  *) export PATH="$PATH:$PLAN9/bin" ;;
esac
if [ -z "${NAMESPACE:-}" ]; then
  export NAMESPACE="$XDG_RUNTIME_DIR/p9ns"
fi
mkdir -p "$NAMESPACE"
chmod 0700 "$NAMESPACE"

pkill -x wawa mojito 2>/dev/null || true
rm -f "$XDG_RUNTIME_DIR/tohu-bar.fifo" "$XDG_RUNTIME_DIR/tohu-bar.pid"

cur_tty=$(tty 2>/dev/null || true)
case "$cur_tty" in
  /dev/tty[1-9]*)
    exec swc-launch -t "$cur_tty" tohu 2>/tmp/tohu.log
    ;;
  *)
    exec swc-launch tohu 2>/tmp/tohu.log
    ;;
esac