~mil/sxmo-devel

sxmo-utils: bluetooth: behave better with multiple devices v1 APPLIED

I use a bluetooth dongle on my pinebook pro, and had to disable one. I
figured out that some sxmo entries was not working as expected. Without
digging too much to manage better devices per-device, those changes are
enough to fix the default behaviors.

Now I'll probably work on the bluetooth menu to be able to select the
controller to connect, or to do other bluetooth stuff.
#1214375 test.yml success
sxmo-utils/patches/test.yml: SUCCESS in 23s

[bluetooth: behave better with multiple devices][0] from [Willow Barraco][1]

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

✓ #1214375 SUCCESS sxmo-utils/patches/test.yml https://builds.sr.ht/~mil/job/1214375
I've sit on this for a long time. I works well. I've applied it!
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/51658/mbox | git am -3
Learn more about email & git

[PATCH sxmo-utils 1/2] contextmenu: let access to bluetooth menu when at least one device is unblocked Export this patch

This is necessary if you have multiple devices, and one is blocked while
the other is useable.

This still not behave correctly when there is no bluetooth device at
all.

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

diff --git a/configs/default_hooks/sxmo_hook_contextmenu.sh b/configs/default_hooks/sxmo_hook_contextmenu.sh
index 26d21ef6..71187014 100755
--- a/configs/default_hooks/sxmo_hook_contextmenu.sh
+++ b/configs/default_hooks/sxmo_hook_contextmenu.sh
@@ -767,7 +767,7 @@ case "$WMCLASS" in
			$icon_msg Texts                                              ^ 0 ^ sxmo_modemtext.sh
			$icon_usr Contacts                                           ^ 0 ^ sxmo_contactmenu.sh
			$(
				rfkill list bluetooth | grep -q "yes" ||
				rfkill list bluetooth -no ID,SOFT,HARD | grep -vq " blocked" &&
				printf %b "$icon_bth Bluetooth ^ 1 ^ sxmo_bluetoothmenu.sh"
			)
			$(command -v megapixels >/dev/null && echo "$icon_cam Camera ^ 0 ^ GDK_SCALE=2 megapixels")
-- 
2.45.0

[PATCH sxmo-utils 2/2] bluetoothtoogle: behave correctly when partially blocked Export this patch

If the devices are partially blocked, the config menu should display a
ton icon, and toggeling should block all remainings.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
---
 configs/default_hooks/sxmo_hook_contextmenu.sh | 4 ++--
 scripts/core/sxmo_bluetoothtoggle.sh           | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/configs/default_hooks/sxmo_hook_contextmenu.sh b/configs/default_hooks/sxmo_hook_contextmenu.sh
index 71187014..15cfd1d3 100755
--- a/configs/default_hooks/sxmo_hook_contextmenu.sh
+++ b/configs/default_hooks/sxmo_hook_contextmenu.sh
@@ -77,8 +77,8 @@ case "$WMCLASS" in
			) ^ 1 ^ supertoggle_daemon 'sxmo_hook_lisgd' && (rm $XDG_CACHE_HOME/sxmo/sxmo.nogesture 2>/dev/null || touch $XDG_CACHE_HOME/sxmo/sxmo.nogesture)
			$icon_cfg Toggle Bar ^ 0 ^ sxmo_wm.sh togglebar
			$icon_bth Bluetooth $(
				rfkill list bluetooth | grep -q "yes" &&
				printf %b "$icon_tof" ||  printf %b "$icon_ton";
				rfkill list bluetooth -no ID,SOFT,HARD | grep -vq " blocked" &&
				printf %b "$icon_ton" ||  printf %b "$icon_tof";
				printf %b "^ 1 ^ doas sxmo_bluetoothtoggle.sh && sxmo_hook_statusbar.sh bluetooth"
			)
			$(test "$SXMO_WM" = dwm && printf %b "$icon_cfg Invert Colors ^ 1 ^ xcalib -a -invert")
diff --git a/scripts/core/sxmo_bluetoothtoggle.sh b/scripts/core/sxmo_bluetoothtoggle.sh
index 9ae19fb3..f670f611 100755
--- a/scripts/core/sxmo_bluetoothtoggle.sh
+++ b/scripts/core/sxmo_bluetoothtoggle.sh
@@ -43,9 +43,9 @@ case "$1" in
		off
		;;
	*) #toggle
		if rfkill list bluetooth | grep -q "yes"; then
			on
		else
		if rfkill list bluetooth -no ID,SOFT,HARD | grep -vq " blocked"; then
			off
		else
			on
		fi
esac
-- 
2.45.0
sxmo-utils/patches/test.yml: SUCCESS in 23s

[bluetooth: behave better with multiple devices][0] from [Willow Barraco][1]

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

✓ #1214375 SUCCESS sxmo-utils/patches/test.yml https://builds.sr.ht/~mil/job/1214375
I've sit on this for a long time. I works well. I've applied it!