diff --git a/Makefile b/Makefile index 21cf3e2..ecb72d1 100644 --- a/Makefile +++ b/Makefile @@ -5,16 +5,19 @@ SYSCONFDIR ?= /etc BINDIR ?= $(PREFIX)/bin DATADIR ?= $(PREFIX)/share LIBEXECDIR ?= $(PREFIX)/libexec +BACKGROUND ?= $(DATADIR)/backgrounds/default.png .PHONY: build clean install check requires .DEFAULT: build -GENERATED := $(patsubst %.in,%,$(wildcard sway/*.in sway/*/*.in )) -VARIABLES := PREFIX SYSCONFDIR DATADIR LIBEXECDIR +TEMPLATES := sway/*.in sway/*/*.in swaylock/*.in sddm/03-sway-fedora/theme.conf.in +GENERATED := $(patsubst %.in,%,$(wildcard $(TEMPLATES))) +VARIABLES := PREFIX SYSCONFDIR DATADIR LIBEXECDIR BACKGROUND -sway/%: sway/%.in - sed "$(foreach var,$(VARIABLES),s^@$(var)@^$($(var))^i;)" $^ > $@ - sed '$(foreach var,$(VARIABLES),s^$$$(var)\b^$($(var))^i;)' $^ > $@ +%: %.in + sed -e "$(foreach var,$(VARIABLES),s^@$(var)@^$($(var))^i;)" \ + -e '$(foreach var,$(VARIABLES),s^$$$(var)\b^$($(var))^i;)' \ + $^ > $@ build: $(GENERATED) diff --git a/sddm/03-sway-fedora/theme.conf b/sddm/03-sway-fedora/theme.conf deleted file mode 100644 index 80ad085..0000000 --- a/sddm/03-sway-fedora/theme.conf +++ /dev/null @@ -1,2 +0,0 @@ -[General] -background=/usr/share/backgrounds/default.png diff --git a/sddm/03-sway-fedora/theme.conf.in b/sddm/03-sway-fedora/theme.conf.in new file mode 100644 index 0000000..757799e --- /dev/null +++ b/sddm/03-sway-fedora/theme.conf.in @@ -0,0 +1,2 @@ +[General] +background=@BACKGROUND@ diff --git a/sway-config-fedora.spec.rpkg b/sway-config-fedora.spec.rpkg index 208bbd7..35f5ce8 100644 --- a/sway-config-fedora.spec.rpkg +++ b/sway-config-fedora.spec.rpkg @@ -2,6 +2,7 @@ %bcond initialsetup %[0%{?fedora} >= 40 || 0%{?rhel} >= 10] %bcond sddm 1 %global sway_ver 1.8 +%global bg_format %[ 0%{?fedora} >= 42 ? "jxl" : "png" ] Name: {{{ git_name }}} Version: {{{ git_version }}} @@ -44,6 +45,9 @@ Requires: /usr/bin/pkill Requires: brightnessctl >= 0.5.1-11 Requires: desktop-backgrounds-compat Requires: grimshot +%if "%{bg_format}" == "jxl" +Requires: jxl-pixbuf-loader +%endif Requires: lxqt-policykit Requires: playerctl Requires: pulseaudio-utils @@ -80,6 +84,9 @@ Provides: sddm-greeter-displayserver Conflicts: sddm-greeter-displayserver Requires: desktop-backgrounds-compat +%if "%{bg_format}" == "jxl" +Requires: kf6-kimageformats +%endif Requires: sddm >= 0.20.0 Requires: sway >= %{sway_ver} @@ -94,11 +101,16 @@ to use Sway for the greeter display server. %build -%make_build +%make_build \ + PREFIX='%{_prefix}' \ + BACKGROUND='%{_datadir}/backgrounds/default.%{bg_format}' %install -%make_install PREFIX='%{_prefix}' WITH_INITIALSETUP='%[%{with initialsetup}?"yes":"no"]' WITH_SDDM='%[%{with sddm}?"yes":"no"]' +%make_install \ + PREFIX='%{_prefix}' \ + WITH_INITIALSETUP='%[%{with initialsetup}?"yes":"no"]' \ + WITH_SDDM='%[%{with sddm}?"yes":"no"]' %files diff --git a/sway/config.in b/sway/config.in index 6e57ce5..53b8844 100644 --- a/sway/config.in +++ b/sway/config.in @@ -30,8 +30,8 @@ set $menu $rofi_cmd -show combi -combi-modes drun#run -modes combi ### Output configuration # # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) -# Requires: desktop-backgrounds-compat, swaybg -output * bg /usr/share/backgrounds/default.png fill +# Requires: desktop-backgrounds-compat, swaybg, jxl-pixbuf-loader +output * bg @BACKGROUND@ fill # # Example configuration: # diff --git a/swaylock/config b/swaylock/config.in similarity index 84% rename from swaylock/config rename to swaylock/config.in index ec2afc7..607bcf2 100644 --- a/swaylock/config +++ b/swaylock/config.in @@ -3,5 +3,5 @@ # # Image path supports environment variables and shell expansions, # e.g. image=$HOME/Pictures/default.png -image=/usr/share/backgrounds/default.png +image=@BACKGROUND@ scaling=fill