Skip to content
Snippets Groups Projects
Commit 0d152ac3 authored by Neal Gompa (ニール・ゴンパ)'s avatar Neal Gompa (ニール・ゴンパ)
Browse files

Add configuration for Anaconda Initial Setup

With initial-setup-gui >= 0.3.99, it is now possible to use a Wayland
compositor to run the firstboot initial setup experience.
parent cd158ff6
No related branches found
No related tags found
1 merge request!20Add configuration for Anaconda Initial Setup
......@@ -22,6 +22,9 @@ clean:
rm -f $(GENERATED)
rm -rf test/
install-initialsetup:
install -D -m 0755 -pv -t $(DESTDIR)$(LIBEXECDIR)/initial-setup initial-setup/run-gui-backend
install-sddm:
install -D -m 0755 -pv -t $(DESTDIR)$(LIBEXECDIR) sddm/sddm-compositor-sway
install -D -m 0644 -pv -t $(DESTDIR)$(SYSCONFDIR)/sway sddm/sddm-greeter.config
......@@ -40,7 +43,11 @@ install-sway: build
install-swaylock:
install -D -m 0644 -pv -t $(DESTDIR)$(SYSCONFDIR)/swaylock swaylock/config
.PHONY: install-sddm install-sway install-swaylock
.PHONY: install-initialsetup install-sddm install-sway install-swaylock
ifeq ($(WITH_INITIALSETUP),yes)
install: install-initialsetup
endif
ifeq ($(WITH_SDDM),yes)
install: install-sddm
......
#!/bin/sh
## Runs the GUI program from $@ in Sway
CONFIG_FILE=$(mktemp --suffix="-wl-sway-firstboot-config")
RUN_SCRIPT=$(mktemp --suffix="-wl-sway-firstboot-run")
EXIT_CODE_SAVE=$(mktemp --suffix="-wl-sway-firstboot-exit")
cat > ${CONFIG_FILE} << EOF
# Sway configuration for Anaconda initial setup.
xwayland force
swaybg_command -
bindsym Mod4+shift+e exec swaynag \
-t warning \
-m 'What do you want to do?' \
-b 'Poweroff' 'systemctl poweroff' \
-b 'Reboot' 'systemctl reboot'
# Disable displays on idle
exec command -v swayidle >/dev/null && swayidle -w \
timeout 300 'swaymsg "output * power off"' \
resume 'swaymsg "output * power on"'
# Apply system keyboard configuration
exec /usr/libexec/sway-systemd/locale1-xkb-config
# Show initial-setup-gui as fullscreen
for_window [class="[Ii]nitial-setup-graphical"] fullscreen enable
exec ${RUN_SCRIPT}
EOF
cat > ${RUN_SCRIPT} << EOF
#!/bin/sh
$@
echo $? > ${EXIT_CODE_SAVE}
sway exit
EOF
chmod +x ${RUN_SCRIPT}
# Set some compatibility variables if we're in a VM
if systemd-detect-virt --quiet --vm; then
export WLR_NO_HARDWARE_CURSORS=1
export WLR_RENDERER=pixman
fi
sway --config=${CONFIG_FILE}
exit_code=$(< ${EXIT_CODE_SAVE})
rm ${CONFIG_FILE} ${RUN_SCRIPT} ${EXIT_CODE_SAVE}
exit $exit_code
# vim: ft=spec
%bcond_without sddm
%bcond initialsetup %[0%{?fedora} >= 40 || 0%{?rhel} >= 10]
%bcond sddm 1
%global sway_ver 1.8
Name: {{{ git_name }}}
......@@ -53,6 +54,22 @@ Requires: waybar
%description
%{summary}.
%if %{with initialsetup}
%package -n initial-setup-gui-wayland-sway
Summary: Sway Wayland Initial Setup GUI configuration
Provides: firstboot(gui-backend)
Conflicts: firstboot(gui-backend)
Requires: xorg-x11-server-Xwayland
Requires: initial-setup-gui >= 0.3.99
Requires: sway >= %{sway_ver}
Supplements: (initial-setup-gui and sway)
%description -n initial-setup-gui-wayland-sway
This package contains configuration and dependencies for
Anaconda Initial Setup to use Sway for the display server.
%endif
%if %{with sddm}
%package -n sddm-wayland-sway
Summary: Sway Wayland SDDM greeter configuration
......@@ -78,7 +95,7 @@ to use Sway for the greeter display server.
%install
%make_install PREFIX='%{_prefix}' WITH_SDDM='%[%{with sddm}?"yes":"no"]'
%make_install PREFIX='%{_prefix}' WITH_INITIALSETUP='%[%{with initialsetup}?"yes":"no"]' WITH_SDDM='%[%{with sddm}?"yes":"no"]'
%files
......@@ -94,6 +111,12 @@ to use Sway for the greeter display server.
%{_datadir}/wayland-sessions/sway.desktop
%{_libexecdir}/sway
%if %{with initialsetup}
%files -n initial-setup-gui-wayland-sway
%license LICENSE
%{_libexecdir}/initial-setup/run-gui-backend
%endif
%if %{with sddm}
%files -n sddm-wayland-sway
%license LICENSE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment