~mil/sxmo-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH sxmo-utils v2] Add a desktop default device profile

Details
Message ID
<20230912075134.13165-2-contact@willowbarraco.fr>
DKIM signature
missing
Download raw message
Patch: +33 -32
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
---
 configs/default_hooks/pine64,pinebook         |  1 +
 configs/default_hooks/pine64,pinebook-pro     |  1 +
 configs/default_hooks/pine64,rockpro64-v2.1   |  1 +
 configs/profile.d/sxmo_init.sh                | 57 ++++++++-----------
 .../sxmo_deviceprofile_desktop.sh             |  2 +
 .../sxmo_deviceprofile_pine64,pinebook-pro.sh |  1 +
 .../sxmo_deviceprofile_pine64,pinebook.sh     |  1 +
 ...xmo_deviceprofile_pine64,rockpro64-v2.1.sh |  1 +
 8 files changed, 33 insertions(+), 32 deletions(-)
 create mode 120000 configs/default_hooks/pine64,pinebook
 create mode 120000 configs/default_hooks/pine64,pinebook-pro
 create mode 120000 configs/default_hooks/pine64,rockpro64-v2.1
 create mode 100644 scripts/deviceprofiles/sxmo_deviceprofile_desktop.sh
 create mode 120000 scripts/deviceprofiles/sxmo_deviceprofile_pine64,pinebook-pro.sh
 create mode 120000 scripts/deviceprofiles/sxmo_deviceprofile_pine64,pinebook.sh
 create mode 120000 scripts/deviceprofiles/sxmo_deviceprofile_pine64,rockpro64-v2.1.sh

diff --git a/configs/default_hooks/pine64,pinebook b/configs/default_hooks/pine64,pinebook
new file mode 120000
index 0000000..00c89fd
--- /dev/null
+++ b/configs/default_hooks/pine64,pinebook
@@ -0,0 +1 @@
desktop/
\ No newline at end of file
diff --git a/configs/default_hooks/pine64,pinebook-pro b/configs/default_hooks/pine64,pinebook-pro
new file mode 120000
index 0000000..00c89fd
--- /dev/null
+++ b/configs/default_hooks/pine64,pinebook-pro
@@ -0,0 +1 @@
desktop/
\ No newline at end of file
diff --git a/configs/default_hooks/pine64,rockpro64-v2.1 b/configs/default_hooks/pine64,rockpro64-v2.1
new file mode 120000
index 0000000..00c89fd
--- /dev/null
+++ b/configs/default_hooks/pine64,rockpro64-v2.1
@@ -0,0 +1 @@
desktop/
\ No newline at end of file
diff --git a/configs/profile.d/sxmo_init.sh b/configs/profile.d/sxmo_init.sh
index 76c4c94..5d2d59c 100644
--- a/configs/profile.d/sxmo_init.sh
+++ b/configs/profile.d/sxmo_init.sh
@@ -80,47 +80,40 @@ _sxmo_load_environments() {
	export BROWSER="${BROWSER:-firefox}"
	export SHELL="${SHELL:-/bin/sh}"

	# The user can already forced a $SXMO_DEVICE_NAME value
	if [ -z "$SXMO_DEVICE_NAME" ] && [ -e /proc/device-tree/compatible ]; then
		SXMO_DEVICE_NAME="$(tr -c '\0[:alnum:].,-' '_' < /proc/device-tree/compatible |
			tr '\0' '\n' | head -n1)"
		export SXMO_DEVICE_NAME
		deviceprofile="$(command -v "sxmo_deviceprofile_$SXMO_DEVICE_NAME.sh")"
		# shellcheck disable=SC1090
		if [ -f "$deviceprofile" ]; then
			. "$deviceprofile"
			printf "deviceprofile file %s loaded.\n" "$deviceprofile"
	# The user can already force a $SXMO_DEVICE_NAME value in ~/.profile
	if [ -z "$SXMO_DEVICE_NAME" ]; then
		if [ -e /proc/device-tree/compatible ]; then
			SXMO_DEVICE_NAME="$(tr -c '\0[:alnum:].,-' '_' < /proc/device-tree/compatible |
				tr '\0' '\n' | head -n1)"
		else
			printf "WARNING: deviceprofile file not found for %s. Most device functions will not work. Please read: https://sxmo.org/deviceprofile \n" "$SXMO_DEVICE_NAME"

			# on a new device, power button won't work
			# so make sure we don't go into screenoff
			# or suspend
			touch "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend
			touch "$XDG_CACHE_HOME"/sxmo/sxmo.noidle

			SXMO_DEVICE_NAME=unknown
			SXMO_DEVICE_NAME=desktop
		fi
		unset deviceprofile
	fi
	export SXMO_DEVICE_NAME

	if [ -n "$SXMO_DEVICE_NAME" ]; then
		_device_hooks_path="$(xdg_data_path "sxmo/default_hooks/$SXMO_DEVICE_NAME" 0 ':')"
		if [ -z "$_device_hooks_path" ]; then
			_device_hooks_path="$(xdg_data_path "sxmo/default_hooks/three_button_touchscreen" 0 ':')"
		fi
	deviceprofile="$(command -v "sxmo_deviceprofile_$SXMO_DEVICE_NAME.sh")"
	# shellcheck disable=SC1090
	if [ -f "$deviceprofile" ]; then
		. "$deviceprofile"
		printf "deviceprofile file %s loaded.\n" "$deviceprofile"
	else
		printf "WARNING: deviceprofile file not found for %s. Most device functions will not work. Please read: https://sxmo.org/deviceprofile \n" "$SXMO_DEVICE_NAME"

		# on a new device, power button won't work
		# so make sure we don't go into screenoff
		# or suspend
		touch "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend
		touch "$XDG_CACHE_HOME"/sxmo/sxmo.noidle
	fi
	unset deviceprofile

		PATH="\
	PATH="\
$XDG_CONFIG_HOME/sxmo/hooks/$SXMO_DEVICE_NAME:\
$(xdg_data_path "sxmo/default_hooks/$SXMO_DEVICE_NAME" 0 ':'):\
$XDG_CONFIG_HOME/sxmo/hooks:\
$_device_hooks_path:\
$(xdg_data_path "sxmo/default_hooks" 0 ':'):\
$PATH"
		export PATH
	else
		default_hooks_path=$(xdg_data_path sxmo/default_hooks 0 ':')
		export PATH="$XDG_CONFIG_HOME/sxmo/hooks:$default_hooks_path:$PATH"
	fi
	export PATH
}

_sxmo_grab_session() {
diff --git a/scripts/deviceprofiles/sxmo_deviceprofile_desktop.sh b/scripts/deviceprofiles/sxmo_deviceprofile_desktop.sh
new file mode 100644
index 0000000..449318e
--- /dev/null
+++ b/scripts/deviceprofiles/sxmo_deviceprofile_desktop.sh
@@ -0,0 +1,2 @@
export SXMO_DISABLE_LEDS=1
export SXMO_STATUS_DATE_FORMAT="%Y-%m-%d %H:%M"
diff --git a/scripts/deviceprofiles/sxmo_deviceprofile_pine64,pinebook-pro.sh b/scripts/deviceprofiles/sxmo_deviceprofile_pine64,pinebook-pro.sh
new file mode 120000
index 0000000..bb90917
--- /dev/null
+++ b/scripts/deviceprofiles/sxmo_deviceprofile_pine64,pinebook-pro.sh
@@ -0,0 +1 @@
sxmo_deviceprofile_desktop.sh
\ No newline at end of file
diff --git a/scripts/deviceprofiles/sxmo_deviceprofile_pine64,pinebook.sh b/scripts/deviceprofiles/sxmo_deviceprofile_pine64,pinebook.sh
new file mode 120000
index 0000000..bb90917
--- /dev/null
+++ b/scripts/deviceprofiles/sxmo_deviceprofile_pine64,pinebook.sh
@@ -0,0 +1 @@
sxmo_deviceprofile_desktop.sh
\ No newline at end of file
diff --git a/scripts/deviceprofiles/sxmo_deviceprofile_pine64,rockpro64-v2.1.sh b/scripts/deviceprofiles/sxmo_deviceprofile_pine64,rockpro64-v2.1.sh
new file mode 120000
index 0000000..bb90917
--- /dev/null
+++ b/scripts/deviceprofiles/sxmo_deviceprofile_pine64,rockpro64-v2.1.sh
@@ -0,0 +1 @@
sxmo_deviceprofile_desktop.sh
\ No newline at end of file
-- 
2.42.0

[sxmo-utils/patches/test.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CVGRXY6WB2WC.0DLRTS1NRDLK@cirno2>
In-Reply-To
<20230912075134.13165-2-contact@willowbarraco.fr> (view parent)
DKIM signature
missing
Download raw message
sxmo-utils/patches/test.yml: SUCCESS in 46s

[Add a desktop default device profile][0] v2 from [Willow Barraco][1]

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

✓ #1056542 SUCCESS sxmo-utils/patches/test.yml https://builds.sr.ht/~mil/job/1056542
Details
Message ID
<CVL1S00RTY45.27D62B78DB29I@navi>
In-Reply-To
<20230912075134.13165-2-contact@willowbarraco.fr> (view parent)
DKIM signature
missing
Download raw message
Thanks!

To git@git.sr.ht:~mil/sxmo-utils
   55aac86..17e4e91  master -> master
--
w:] www.momi.ca
pgp:] https://momi.ca/publickey.txt
Reply to thread Export thread (mbox)