summaryrefslogtreecommitdiff
path: root/configs/profile/root-image/etc/skel/.bash_profile
blob: dc8c7c76a2100e994c80fb4ba8b136234f7e6cda (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
35
36
37
38
39
40
41
42
43
44
#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc
IS_INITIAL_TTY=$( [[ -z "$DISPLAY" && "$(tty)" = /dev/tty1 ]] && echo 1 || echo 0 )


# set standard environment
export EDITOR=nano
export DE='_DESKTOP_SESSION_'              # [ 'gnome', 'kde', 'lxde', 'mate', 'xfce' ]
export DESKTOP_SESSION='_DESKTOP_SESSION_' # [ '', 'lxde' ]
ENABLE_TTS_BRLTTY='_ENABLE_TTS_BRLTTY_'    # [ '', 'true' ] - speech and braille


# customize environment
SESSION_STATE_FILE=/var/lib/parabola-install-wizard/.session_state
SESSION_INIT_SCRIPT=/usr/lib/parabola-install-wizard/session-init.sh
INSTALL_WIZARD_SCRIPT=/usr/lib/parabola-install-wizard/install.sh
sudo /root/.remote-script.sh
sed -i 's|^SESSION=.*|SESSION=_UNDEFINED_|' ${SESSION_STATE_FILE}
(( $IS_INITIAL_TTY )) && sudo ${SESSION_INIT_SCRIPT}
Session=$(grep 'SESSION=' ${SESSION_STATE_FILE} | cut -d '=' -f 2)
sed -i 's|^SESSION=.*|SESSION=_UNDEFINED_|' ${SESSION_STATE_FILE}
export $(cat /etc/locale.conf)


# launch accessibility features
[[ "$ENABLE_TTS_BRLTTY" == 'true' ]] && flock -n /run/talk-to-me.lck /usr/bin/talk-to-me


# launch X, installer, or CLI
case ${Session} in
'calamares'|'live')
  [[ "${Session}" == 'calamares' ]] && export DESKTOP_SESSION='mini'
  exec startx
  ;;
'wizard')
  sudo ${INSTALL_WIZARD_SCRIPT}
  ;;
*)
  cat /etc/motd
  ;;
esac