Switch to JXL for Fedora 42 backgrounds.

This commit is contained in:
Aleksei Bavshin 2025-02-16 22:18:07 -08:00
commit 32d27f88e2
No known key found for this signature in database
GPG key ID: 4F071603387A382A
6 changed files with 27 additions and 12 deletions

View file

@ -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)

View file

@ -1,2 +0,0 @@
[General]
background=/usr/share/backgrounds/default.png

View file

@ -0,0 +1,2 @@
[General]
background=@BACKGROUND@

View file

@ -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

View file

@ -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:
#

View file

@ -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