-
Notifications
You must be signed in to change notification settings - Fork 3
/
xfce-wayland
executable file
·43 lines (39 loc) · 1.42 KB
/
xfce-wayland
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
#!/bin/bash
set -euo pipefail
vm_name="${1:-$(basename "$0")}"
until command -v multipass > /dev/null
do
echo "Multipass is not installed, do you wish to install it?"
select install in "Yes" "No"; do
case $install in
Yes ) sudo snap install multipass; break;;
No ) break;;
esac
done
done
if ! multipass start "${vm_name}"
then
set -x
multipass launch -v -n "${vm_name}" --cloud-init - daily:hirsute <<EOF
ssh_authorized_keys:
- $(cat ~/.ssh/id_rsa.pub)
packages:
- fonts-freefont-ttf
- fonts-font-awesome
- xfce4-panel
- xfwm4
- xfdesktop4
- xfce4-terminal
- xfce4-goodies
- xfdesktop4-data
runcmd:
- sudo snap install --classic --channel=edge egmde
EOF
multipass exec "${vm_name}" -- sh -c "mkdir --parents ~/.config"
multipass exec "${vm_name}" -- sh -c "if ! grep -q no-of-workspaces= ~/.config/egmde.config; then echo no-of-workspaces=4 >> .config/egmde.config; fi"
multipass exec "${vm_name}" -- sh -c "if ! grep -q shell-enable-autostart= ~/.config/egmde.config; then echo shell-enable-autostart= >> .config/egmde.config; fi"
multipass exec "${vm_name}" -- sh -c "if ! grep -q swaybg.image= ~/.config/egmde.config; then echo swaybg.image=/usr/share/backgrounds/xfce/xfce-stripes.png >> .config/egmde.config; fi"
set +x
fi
host_ip=$(multipass info "${vm_name}" --format csv | awk -F, '/^'"${vm_name}"'/ { print $3 }')
exec ssh -XC "ubuntu@${host_ip}" sh -lc egmde