diff --git a/README.md b/README.md new file mode 100644 index 0000000..b36b15d --- /dev/null +++ b/README.md @@ -0,0 +1,58 @@ +Fedora package documentation +=== + +Configuration profiles +--- +The Sway package in Fedora defers most of the dependencies and the config +file ownership to the `sway-config-*` subpackages. This allows us to ship +different configuration profiles with different sets of runtime dependencies. +This also allows anyone to create a package with their preferred system-wide +configuration defaults and use it instead of the default Fedora profiles. + +The profiles currently defined in the `sway` source package are the following: + + - **sway-config-upstream** - the upstream configuration. The only permitted + modifications to the config file are adjustments for dependencies currently + unavailable in Fedora. + - **sway-config-minimal** - minimal configuration with any optional + dependencies omitted. Suitable for headless servers, containers and + buildroot usage. + +The config packages are mutually exclusive, and one of these must always be +installed. The one selected by default is **sway-config-upstream**. +At any moment, you can switch the installed configuration with one of the +following commands: + +``` +dnf swap sway-config sway-config-upstream +dnf swap sway-config sway-config-minimal +# for a third-party configuration profile: +dnf swap sway-config sway-config-custom +``` + +The command will replace the default `/etc/sway/config` file and apply the new +set of dependencies. Packages unused by the new profile will be autoremoved. + +Custom profile example +--- +An example spec header for a custom configuration profile: + +``` +Name: sway-config-custom +Version: 1.0 +Release: 1%{?dist} +Summary: Custom configuration for Sway +BuildArch: noarch +Requires: sway >= 1.7 +Provides: sway-config = %{version}-%{release} +Conflicts: sway-config + +# common dependencies +# ... + +# profile dependencies +Requires: waybar + +%files +%config(noreplace) %{_sysconfdir}/sway/config +``` diff --git a/sway.spec b/sway.spec index 1a08316..a727aa2 100644 --- a/sway.spec +++ b/sway.spec @@ -12,6 +12,7 @@ Source1: %{url}/releases/download/%{tag}/%{name}-%{tag}.tar.gz.sig Source2: https://emersion.fr/.well-known/openpgpkey/hu/dj3498u4hyyarh35rkjfnghbjxug6b19#/gpgkey-0FDE7BE0E88F5E48.gpg # Minimal configuration file for headless or buildroot use Source100: config.minimal +Source101: README.md # Fixes crash when destroying layer surfaces on removed output Patch0: %{url}/pull/6820.patch#/sway-1.7-layer_shell-keep-output-non-NULL-wherever-possible.patch @@ -148,6 +149,9 @@ interface. %meson_install # Install minimal configuration file install -D -m644 -pv %{SOURCE100} %{buildroot}%{_sysconfdir}/sway/config.minimal +# install the documentation +install -D -m644 -pv README.md %{buildroot}%{_pkgdocdir}/README.md +install -D -m644 -pv %{SOURCE101} %{buildroot}%{_pkgdocdir}/README.Fedora # Create directory for extra config snippets install -d -m755 -pv %{buildroot}%{_sysconfdir}/sway/config.d @@ -160,7 +164,7 @@ install -D -m755 -pv contrib/grimshot %{buildroot}%{_bindir}/grimshot %files %license LICENSE -%doc README.md +%doc %{_pkgdocdir} %dir %{_sysconfdir}/sway %dir %{_sysconfdir}/sway/config.d %{_mandir}/man1/sway*