~mil/sxmo-devel

sxmo-utils: Support system wallpapers v3 APPLIED

Change of the installed_wallappers implementation.
#1146363 test.yml success
sxmo-utils/patches/test.yml: SUCCESS in 10s

[Support system wallpapers][0] v3 from [Willow Barraco][1]

[0]: https://lists.sr.ht/~mil/sxmo-devel/patches/49309
[1]: mailto:contact@willowbarraco.fr

✓ #1146363 SUCCESS sxmo-utils/patches/test.yml https://builds.sr.ht/~mil/job/1146363
Thanks!

To git@git.sr.ht:~mil/sxmo-utils
   df6b3d3..c6efaf8  master -> master
 
--
w:] www.momi.ca
pgp:] https://momi.ca/publickey.txt
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~mil/sxmo-devel/patches/49309/mbox | git am -3
Learn more about email & git

[PATCH sxmo-utils v3 1/2] sxmo_common.sh: xdg_data_path handle escaped separators (\n, \0) Export this patch

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
---
 scripts/core/sxmo_common.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/core/sxmo_common.sh b/scripts/core/sxmo_common.sh
index 4eb0a1f9..1aed3152 100755
--- a/scripts/core/sxmo_common.sh
+++ b/scripts/core/sxmo_common.sh
@@ -65,7 +65,7 @@ xdg_data_path() {
				break
			fi
			if [ $instance -gt 0 ]; then
				printf '%s' "${sep}"
				printf '%b' "${sep}"
			fi
			printf '%s' "${dir}/${filepath}"
			instance=$((instance+1))
-- 
2.43.0

[PATCH sxmo-utils v3 2/2] Support system wallpapers Export this patch

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
sxmo-utils/patches/test.yml: SUCCESS in 10s

[Support system wallpapers][0] v3 from [Willow Barraco][1]

[0]: https://lists.sr.ht/~mil/sxmo-devel/patches/49309
[1]: mailto:contact@willowbarraco.fr

✓ #1146363 SUCCESS sxmo-utils/patches/test.yml https://builds.sr.ht/~mil/job/1146363
Thanks!

To git@git.sr.ht:~mil/sxmo-utils
   df6b3d3..c6efaf8  master -> master
 
--
w:] www.momi.ca
pgp:] https://momi.ca/publickey.txt