This add a simple hook "wallpaper" that by default grab the system
wallpaper (ex: provided by postmarketos-artwork-wallpapers). If there is
none, it fallback to the sxmo one.
Of course, the hook is customizable by the user if needed.
Ref: https://gitlab.com/postmarketOS/pmaports/-/issues/2499
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
---
configs/appcfg/profile_template | 2 +-configs/default_hooks/sxmo_hook_wallpaper.sh | 23 ++++++++++++++++++++docs/sxmo.7.scd | 1 +
3 files changed, 25 insertions(+), 1 deletion(-)
create mode 100755 configs/default_hooks/sxmo_hook_wallpaper.sh
diff --git a/configs/appcfg/profile_template b/configs/appcfg/profile_template
index bed7542d..c811f304 100755
--- a/configs/appcfg/profile_template+++ b/configs/appcfg/profile_template
@@ -70,4 +70,4 @@ export SXMO_RINGNUMBER=10
export SXMO_DEFAULT_DRAFT="Enter new message here."
#Set background image
-export SXMO_BG_IMG="$(xdg_data_path sxmo/background.jpg)"+export SXMO_BG_IMG="$(sxmo_hook_wallpaper.sh)"
diff --git a/configs/default_hooks/sxmo_hook_wallpaper.sh b/configs/default_hooks/sxmo_hook_wallpaper.sh
new file mode 100755
index 00000000..82a52740
--- /dev/null+++ b/configs/default_hooks/sxmo_hook_wallpaper.sh
@@ -0,0 +1,23 @@
+#!/bin/sh -e+# SPDX-License-Identifier: AGPL-3.0-only+# Copyright 2022 Sxmo Contributors++# shellcheck source=scripts/core/sxmo_common.sh+. sxmo_common.sh++# This script is executed once, and must output the wallpaper to display++installed_wallpapers() {+ xdg_data_path wallpapers 0 "\0" | xargs -r0I{} find "{}" -name "$SXMO_OS.*"+}++sxmo_wallpaper() {+ xdg_data_path sxmo/background.jpg+}++all_wallpapers() {+ installed_wallpapers+ sxmo_wallpaper+}++all_wallpapers | head -n1
diff --git a/docs/sxmo.7.scd b/docs/sxmo.7.scd
index 898dafe4..6a30d76f 100644
--- a/docs/sxmo.7.scd+++ b/docs/sxmo.7.scd
@@ -87,6 +87,7 @@ shell scripts that glue all these tools together. All these shell scripts comply
to the pattern *sxmo_\*.sh* and most can be found in your */usr/bin/* directory.
HOOKS: _sxmo_hook_start.sh_ (what executes on startup)
+_sxmo_hook_wallpaper.sh_ (give the displayed wallpaper file path)SEE ALSO: _tinydm_(1), _superd_(1), _sxmo_daemons.sh_(1)
--
2.43.0