Skip to content

Commit

Permalink
Fix GNOME installation and add an script for that
Browse files Browse the repository at this point in the history
  • Loading branch information
crramirez committed Nov 14, 2023
1 parent 5be6640 commit d0c6b97
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
9 changes: 6 additions & 3 deletions create-targz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,16 @@ function build() {
chmod +x "${TMPDIR}"/dist/usr/local/bin/upgrade.sh
ln -s /usr/local/bin/upgrade.sh "${TMPDIR}"/dist/usr/local/bin/update.sh

cp "${origin_dir}"/linux_files/install-gnome-desktop.sh -o "${TMPDIR}"/dist/usr/local/bin/install-gnome-desktop.sh
chmod +x "${TMPDIR}"/dist/usr/local/bin/install-gnome-desktop.sh

cp "${origin_dir}"/linux_files/start-systemd.sudoers "${TMPDIR}"/dist/etc/sudoers.d/start-systemd
cp "${origin_dir}"/linux_files/start-systemd.sh "${TMPDIR}"/dist/usr/local/bin/start-systemd
chmod +x "${TMPDIR}"/dist/usr/local/bin/start-systemd

# cp "${origin_dir}"/linux_files/wsl2-xwayland.service "${TMPDIR}"/dist/etc/systemd/system/wsl2-xwayland.service
# cp "${origin_dir}"/linux_files/wsl2-xwayland.socket "${TMPDIR}"/dist/etc/systemd/system/wsl2-xwayland.socket
# ln -sf ../wsl2-xwayland.socket "${TMPDIR}"/dist/etc/systemd/system/sockets.target.wants/
cp "${origin_dir}"/linux_files/wsl2-xwayland.service "${TMPDIR}"/dist/etc/systemd/system/wsl2-xwayland.service
cp "${origin_dir}"/linux_files/wsl2-xwayland.socket "${TMPDIR}"/dist/etc/systemd/system/wsl2-xwayland.socket
ln -sf ../wsl2-xwayland.socket "${TMPDIR}"/dist/etc/systemd/system/sockets.target.wants/

cp "${origin_dir}"/linux_files/systemctl3.py "${TMPDIR}"/dist/usr/local/bin/wslsystemctl
chmod +x "${TMPDIR}"/dist/usr/local/bin/wslsystemctl
Expand Down
3 changes: 3 additions & 0 deletions linux_files/00-remix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ setup_display() {
setup_interop
fi

unset WAYLAND_DISPLAY
rm -f /mnt/wslg/runtime-dir/wayland*

return
fi

Expand Down
20 changes: 20 additions & 0 deletions linux_files/install-gnome-desktop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#! /bin/bash
#

[ "$(grep -c "^systemd.*" /etc/wsl.conf)" -eq 0 ] && echo -e "\n[boot]\nsystemd=true\n" | sudo tee -a /etc/wsl.conf
[ "$(grep -c "^systemd.*=.*true$" /etc/wsl.conf)" -eq 0 ] && sudo sed -i "s/^systemd.*=.*false$/systemd=true/" /etc/wsl.conf

[ "$(grep -c "^hostname.*" /etc/wsl.conf)" -eq 0 ] && sudo sed '/\[network\]/s/.*/&\nhostname=fedoraremix/' /etc/wsl.conf

update.sh

sudo dnf -y group install 'GNOME'

sudo localectl set-locale LANG="en_US.UTF-8"

sudo dnf -y install xrdp
sudo systemctl enable xrdp
sudo sed -i "s/port=3389/port=3396/" /etc/xrdp/xrdp.ini
sudo sed -i "s/ListenPort=3350/ListenPort=3346/" /etc/xrdp/sesman.ini

wsl.exe --terminate ${WSL_DISTRO_NAME}
4 changes: 4 additions & 0 deletions linux_files/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ sudo chmod -x,+r /etc/profile.d/00-remix.sh
# Add local.conf to fonts
sudo curl -L -f "${base_url}/linux_files/local.conf" -o /etc/fonts/local.conf

# Install additional scripts
sudo curl -L -f "${base_url}/linux_files/install-gnome-desktop.sh" -o /usr/local/bin/install-gnome-desktop.sh
chmod +x /usr/local/bin/install-gnome-desktop.sh

# Install mesa
source /etc/os-release

Expand Down

0 comments on commit d0c6b97

Please sign in to comment.