diff --git a/install/fedora-ostree.sh b/install/fedora-ostree.sh index a3bf8d4..2c0573b 100644 --- a/install/fedora-ostree.sh +++ b/install/fedora-ostree.sh @@ -8,6 +8,16 @@ fi # Don't continue script if any error occurs. set -e +function yes_or_no { + local yn + while true; do + read -r -p "$* [y/n]: " yn + case $yn in + [Yy]*) choice="Y" ; return 0 ;; + [Nn]*) choice="n" ; return 0 ;; + esac + done +} # Check fedora version source /etc/os-release @@ -15,6 +25,9 @@ version=$REDHAT_SUPPORT_PRODUCT_VERSION echo "Enabling nwg-shell Copr" sudo curl https://copr.fedorainfracloud.org/coprs/tofik/nwg-shell/repo/fedora-$version/tofik-nwg-shell-fedora-$version.repo -o /etc/yum.repos.d/nwg-shell.repo +sudo curl https://copr.fedorainfracloud.org/coprs/tofik/sway/repo/fedora-${version}/tofik-sway-fedora-${version}.repo -o /etc/yum.repos.d/tofik-sway.repo +sudo curl https://copr.fedorainfracloud.org/coprs/erikreider/SwayNotificationCenter/repo/fedora-${version}/erikreider-SwayNotificationCenter-fedora-${version}.repo -o /etc/yum.repos.d/erikreider-SwayNotificationCenter.repo +sudo curl https://copr.fedorainfracloud.org/coprs/mochaa/gtk-session-lock/repo/fedora-${version}/mochaa-gtk-session-lock-fedora-${version}.repo -o /etc/yum.repos.d/mochaa-gtk-session-lock.repo echo echo "You're about to select components, that need to be preinstalled for the key bindings to work." @@ -48,8 +61,19 @@ rpm-ostree install --allow-inactive $fm $editor $browser nwg-shell echo "Apply changes live to make nwg-shell-installer available" sudo rpm-ostree apply-live -echo "Installing initial configuration" -# Version in fedora does not support -w flag, so, implemented workaround -echo y | nwg-shell-installer -a +echo "Starting from v0.5.0, nwg-shell supports Hyprland Wayland compositor." + +echo +yes_or_no "Install Hyprland?" + +if [ "$choice" == "Y" ] ; then + echo "Installing Hyprland" + dnf install -y hyprland wlr-randr + echo Installing initial configuration + nwg-shell-installer -w -hypr +else + echo Installing initial configuration + nwg-shell-installer -w +fi xdg-user-dirs-update diff --git a/install/fedora.sh b/install/fedora.sh index 5b87baa..205d47b 100644 --- a/install/fedora.sh +++ b/install/fedora.sh @@ -8,6 +8,16 @@ fi # Don't continue script if any error occurs. set -e +function yes_or_no { + local yn + while true; do + read -r -p "$* [y/n]: " yn + case $yn in + [Yy]*) choice="Y" ; return 0 ;; + [Nn]*) choice="n" ; return 0 ;; + esac + done +} echo "Enabling nwg-shell Copr" sudo dnf copr enable -y tofik/nwg-shell @@ -43,8 +53,19 @@ sudo dnf install -y $fm $editor $browser echo "Installing nwg-shell" sudo dnf install -y nwg-shell -echo "Installing initial configuration" -# Version in fedora does not support -w flag, so, implemented workaround -echo y | nwg-shell-installer -a +echo "Starting from v0.5.0, nwg-shell supports Hyprland Wayland compositor." + +echo +yes_or_no "Install Hyprland?" + +if [ "$choice" == "Y" ] ; then + echo "Installing Hyprland" + dnf install -y hyprland wlr-randr + echo Installing initial configuration + nwg-shell-installer -w -hypr +else + echo Installing initial configuration + nwg-shell-installer -w +fi xdg-user-dirs-update