-
Notifications
You must be signed in to change notification settings - Fork 3
/
bash-login
executable file
·132 lines (103 loc) · 2.35 KB
/
bash-login
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/bin/bash
# login ////////////////////////////////////////////////////////////////////////
if [ -n "${TERMUX_VERSION}" ]
then
frobulator.fwd "Logging in..."
echo
fi
# dextop ///////////////////////////////////////////////////////////////////////
if [ -n "${TERMUX_VERSION}" ]
then
# session
if [[ $(cat "${HOME}"/.dextop/dextop-environment) = xfce ]]
then
session_interface="XFCE"
else
session_interface="CONSOLE"
fi
if [ -f /etc/os-release ]
then
. /etc/os-release
distribution_name="${NAME}"
fi
# settings
if [ ! -f "${HOME}"/.dextop/dextop-settings-checkpoint ]
then
frobulator.fwd "Setting up..."
echo
dbus-launch "${HOME}"/.local/bin/container-settings
frobulator.file "${HOME}"/.dextop dextop-settings-checkpoint
frobulator.clear
fi
# update
if [[ $(pgrep -f proot) ]]
then
:
else
if [[ $(cat "${HOME}"/.dextop/dextop-update) = *update* ]]
then
if [[ $(cat "${HOME}"/.dextop/dextop-update) = *dextop* ]]
then
dextop -u dextop
fi
if [[ $(cat "${HOME}"/.dextop/dextop-update) = *shell* ]]
then
dextop -u shell
fi
if [[ $(cat "${HOME}"/.dextop/dextop-update) = *utility* ]]
then
dextop -u utility all
fi
if [[ $(cat "${HOME}"/.dextop/dextop-update) = *all* ]]
then
dextop -u all
fi
frobulator.clear
fi
fi
# audio
if [[ $(pgrep -f proot) ]]
then
echo 'default-server = 127.0.0.1' > /etc/pulse/client.conf
echo 'auto-connect-localhost = yes' >> /etc/pulse/client.conf
echo 'autospawn = no' >> /etc/pulse/client.conf
else
if [[ $(cat "${HOME}"/.dextop/dextop-audio) = "audio" ]]
then
if [[ $(command -v pulseaudio) ]]
then
if [[ $(pgrep -f pulseaudio) ]]
then
:
else
# start pulseaudio and daemonize
pulseaudio \
--start \
--daemonize=true \
--exit-idle-time=-1
# initialize transmission control protocol
pacmd \
load-module \
module-native-protocol-tcp \
auth-ip-acl=127.0.0.1 \
auth-anonymous=1
fi
fi
fi
fi
# automatic session start
if [[ $(cat "${HOME}"/.dextop/dextop-login) = "login" ]]
then
# interface
if [[ $(pgrep -f com.termux.x11) ]]
then
frobulator.fwd "Session" "[ ${session_interface} ]"
echo
fi
if [[ $(pgrep -f proot) ]]
then
container-session -o
fi
container-session -o
fi
fi