aboutsummaryrefslogtreecommitdiff
path: root/sh/bash/.bash_profile
blob: d2d4cc35baf09c13d495df7da4f0c704f2361c11 (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
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash
#
# bryson's bash profile
#

# import shell-agnostic profile
if [ -f ~/.profile ]; then
    . ~/.profile
fi

# import global bashrc
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi

# if login shell, run tty menu
if [[ $TERM == 'linux' ]]; then
    while true; do
        echo -e "\e[0;35m***** MAIN MENU *****\e[0m"
        echo "1: Start XMonad"
        echo "2: Exit to Bash"
        echo -e "\e[0;35m---\e[0m"
        echo "8: Logout"
        echo "9: Reboot"
        echo "0: Shutdown"
        read -rs -N 1 key
        case $key in
            1) startx ;;
            2) break ;;
            8) logout ;;
            9) echo "Are you sure you want to reboot? (y will reboot)";
               read -rs -N 1 confirm; [ "$confirm" = 'y' ] && (doas reboot; break) ;;
            0) echo "Are you sure you want to shutdown? (y will shutdown)";
               read -rs -N 1 confirm; [ "$confirm" = 'y' ] && (doas reboot; break) ;;
        esac
    done
fi
# end tty menu

# bash specific variables
HISTSIZE=100000

# enable command completion for doas
complete -cf doas
shopt -s expand_aliases

# export variables
export HISTSIZE black BLACK dgray DGRAY red RED lred LRED green GREEN lgreen LGREEN yellow LYELLOW blue BLUE lblue LBLUE magenta MAGENTA lmagenta LMAGENTA cyan CYAN lcyan LCYAN lgray LGRAY NC

# import bashrc
# if [ -f ~/.bashrc ]; then
#     . ~/.bashrc
# fi