-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-sway
72 lines (55 loc) · 2.37 KB
/
setup-sway
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
#!/bin/sh
if [ "$(id -u)" -ne 0 ] || [ "$DOAS_USER" = "root" ] || [ "$DOAS_USER" = "" ]; then
echo "run this script as a regular user using doas"
exit 1
fi
#########################################################################################
# PROGRAM METADATA
#########################################################################################
PROGRAM=$(basename "$0")
#########################################################################################
# PROGRAM DEPENDENCIES
#########################################################################################
. "/lib/libusralpine.sh"
#########################################################################################
# PREREQUISITES
#########################################################################################
echo
task "1. setup-dbus"
task "2. setup-seatd"
task "3. setup-udev"
task "4. setup-sway"
"$PROGRAM_DIR/setup-dbus" || die "sway setup - failed to install prerequisite: dbus"
"$PROGRAM_DIR/setup-seatd" || die "sway setup - failed to install prerequisite: seatd"
#########################################################################################
# PROGRAM
#########################################################################################
header "$PROGRAM"
step "adding eudev"
apk add eudev || die "sway setup - failed to install eudev"
step "setting up udev"
setup-devd udev || die "sway setup - failed to setup udev"
step "adding ttf fonts"
apk add ttf-dejavu || die "sway setup - failed to install fonts"
step "adding sway"
apk add sway \
xwayland \
xdg-desktop-portal \
xdg-desktop-portal-wlr \
foot \
swaylock \
swaylockd \
swaybg \
swayidle || die "sway setup - failed to install sway"
step "restarting dbus service"
rc-service dbus restart || die "sway setup - failed to restart dbus service"
footer_start
footer_text "remember to copy /etc/sway/config to ~/.config/sway/config"
footer_text "if you don't have an existing configuration file already."
footer_text "for additional information, you can start at 'man 5 sway'."
footer_text "launch support programs by adding these lines to your"
footer_text "configuration file:"
footer_text "exec /usr/libexec/pipewire-launcher #pipewire must be launched first"
footer_text "exec /usr/libexec/xdg-desktop-portal-wlr"
footer_text "run sway with: dbus-run-session -- sway"
footer_end