-
Notifications
You must be signed in to change notification settings - Fork 60
/
setup-desktop.in
187 lines (174 loc) · 3.27 KB
/
setup-desktop.in
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#!/bin/sh
PREFIX=@PREFIX@
: ${LIBDIR=$PREFIX/lib}
. "$LIBDIR/libalpine.sh"
usage() {
cat <<-__EOF__
usage: setup-desktop [-h] [gnome|plasma|xfce|mate|sway|lxqt]
Install a standard desktop
options:
-h Show this help
__EOF__
exit $1
}
while getopts "h" opt; do
case $opt in
h) usage 0;;
'?') usage "1" >&2;;
esac
done
shift $(($OPTIND - 1))
if [ $# -gt 1 ]; then
usage "1" >&2
fi
if [ $# -eq 0 ]; then
users=$(awk -F: '{if ($3<65000 && $3 >= 1000) print $1}' "$ROOT"/etc/passwd 2>/dev/null)
if [ -z "$users" ]; then
setup-user -g "audio,video,netdev"
fi
fi
de="$1"
valid_desktops="xfce gnome plasma mate sway lxqt none"
if [ $# -eq 1 ] && ! isin "$de" $valid_desktops; then
echo "$de is not a valid desktop" >&2
usage "1" >&2
fi
shift
while ! isin "$de" $valid_desktops; do
ask "Which desktop environment? ('gnome', 'plasma', 'xfce', 'mate', 'sway', 'lxqt' or 'none')" none
de="$resp"
done
case "$de" in
none)
exit 0
;;
mate)
setup-xorg-base mate-desktop-environment ${BROWSER:-firefox} \
gvfs \
lightdm \
lightdm-gtk-greeter \
polkit \
dbus \
dbus-x11 \
font-dejavu \
"$@"
rc-update add dbus
rc-update add lightdm
;;
xfce)
setup-xorg-base xfce4 ${BROWSER:-firefox} \
elogind \
gvfs \
lightdm \
lightdm-gtk-greeter \
polkit-elogind \
xfce4-screensaver \
xfce4-terminal \
"$@"
rc-update add lightdm
;;
lxqt)
setup-xorg-base ${BROWSER:-firefox} \
lxqt-desktop \
lximage-qt \
obconf-qt \
pavucontrol-qt \
arandr \
sddm \
font-dejavu \
dbus \
dbus-x11 \
openbox \
elogind \
polkit-elogind \
gvfs \
udisks2 \
adwaita-qt \
oxygen \
"$@"
rc-update add dbus
rc-update add sddm
rc-update add elogind
;;
gnome)
setup-wayland-base ${BROWSER:-firefox} "$@"
# apk info needs community repos which are enabled with setup-wayland-base
apk add $(apk info --quiet --depends gnome gnome-apps-core)
rc-update add gdm
;;
plasma)
setup-xorg-base ${BROWSER:-firefox} \
ark \
bluedevil \
breeze \
breeze-gtk \
dbus \
discover \
drkonqi \
font-noto \
gwenview \
kate \
kde-cli-tools \
kde-gtk-config \
kde-icons \
kdeplasma-addons \
kgamma \
kinfocenter \
kio-fuse \
kmenuedit \
konsole \
kscreen \
ksshaskpass \
kwallet-pam \
kwayland-integration \
pinentry-qt \
pipewire-alsa \
pipewire-pulse \
plasma-browser-integration \
plasma-desktop \
plasma-disks \
plasma-nm \
plasma-pa \
plasma-systemmonitor \
plasma-vault \
plasma-welcome \
plasma-workspace-wallpapers \
polkit-elogind \
polkit-kde-agent-1 \
powerdevil \
print-manager \
sddm-breeze \
sddm-kcm \
spectacle \
systemsettings \
udisks2 \
xdg-desktop-portal-kde \
xdg-user-dirs \
"$@"
rc-update add dbus
rc-update add sddm
;;
sway)
setup-wayland-base ${BROWSER:-firefox} \
font-dejavu \
foot \
grim \
i3status \
sway \
swayidle \
swaylockd \
util-linux-login \
wl-clipboard \
wmenu \
xwayland \
"$@"
;;
*)
usage "1" >&2
;;
esac
users=$(awk -F: '{if ($3<65000 && $3 >= 1000) print $1}' "$ROOT"/etc/passwd 2>/dev/null)
if [ -z "$users" ]; then
echo "WARNING: You need to create a user account. Please run: setup-user" >&2
echo "" >&2
fi