From 21d9706b6a0557e3b5ed851ca425167e9a7e7362 Mon Sep 17 00:00:00 2001 From: tigro Date: Thu, 7 Sep 2023 13:09:32 +0300 Subject: [PATCH] Added scripts to configure wayland and flatpak --- bin/sphere-add-flatpack-repos | 15 ++++++++++++++ bin/sphere-wayland-configure | 37 +++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100755 bin/sphere-add-flatpack-repos create mode 100755 bin/sphere-wayland-configure diff --git a/bin/sphere-add-flatpack-repos b/bin/sphere-add-flatpack-repos new file mode 100755 index 0000000..a8053e4 --- /dev/null +++ b/bin/sphere-add-flatpack-repos @@ -0,0 +1,15 @@ +#!/bin/sh + +if [ "$(id -u)" = "0" ]; then + SYSTEM="--system" + MSG="to all users" +else + MSG="to user $(whoami)" +fi + +if [ -f /usr/bin/flatpak ]; then + /usr/bin/flatpak remote-add $SYSTEM --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + /usr/bin/flatpak remote-add $SYSTEM --if-not-exists fedora oci+https://registry.fedoraproject.org + + echo "Added flathub and fedoraproject flatpak repos $MSG" +fi diff --git a/bin/sphere-wayland-configure b/bin/sphere-wayland-configure new file mode 100755 index 0000000..2fa9ba2 --- /dev/null +++ b/bin/sphere-wayland-configure @@ -0,0 +1,37 @@ +#!/bin/sh + +usage() +{ + echo "Enable/Disable Wayland in GDM" + echo "Usage: sphere-wayland-configure <--enable|--disable>" + echo + exit 1 +} + +OPTION="$1" + +echo $OPTION + +if [ "$OPTION" != "--disable" -a "$OPTION" != "--enable" ]; then + echo "Unknown option" + usage +fi + +if [ ! -f /etc/gdm/custom.conf ]; then + echo "GDM configuration file not found" + exit 5 +fi + +if [ "$OPTION" = "--enable" ]; then + sed -i '/^WaylandEnable=false/s@^@#@' /etc/gdm/custom.conf + sed -i '/^DefaultSession=/s@^@#@' /etc/gdm/custom.conf + + echo "Wayland enabled, please restart gdm" + echo "sudo systemctl restart gdm.service" +elif [ "$OPTION" = "--disable" ]; then + sed -i '/^#WaylandEnable=false/s@^#@@' /etc/gdm/custom.conf + sed -i '/^#DefaultSession=/s@^#@@' /etc/gdm/custom.conf + + echo "Wayland enabled, please restart gdm" + echo "sudo systemctl restart gdm.service" +fi