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] WIP: Allow custom wob args in sxmo_wob.sh

Message ID
DKIM signature
Download raw message
Patch: +7 -1
This allow theming for wob, but the patch has an issue: to get the
width of the screen we must wait until sway is started. It's not
the case when `.config/sxmo/profile` is sourced (in `sxmo_winit.sh`),
so `profile` is maybe not the best place.

3 solutions:
1. We keep this configuration into `profile`, as we did
   with BEMENU_OPTS (BTW bemenu could also need info from sway
   to fine tune its options). This is less flexible for the
   user but more simple.
2. We advise to use the start hook, as I did in the patch
3. We create a new hook that is sourced in sxmo_hook_start.sh
   before we start the daemons. This removes the need to 
   override hook_start for a bunch of env vars

 configs/default_hooks/sxmo_hook_start.sh | 4 ++++
 scripts/core/sxmo_wob.sh                 | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/configs/default_hooks/sxmo_hook_start.sh b/configs/default_hooks/sxmo_hook_start.sh
index 5270284..7b93c54 100644
--- a/configs/default_hooks/sxmo_hook_start.sh
+++ b/configs/default_hooks/sxmo_hook_start.sh
@@ -15,6 +15,10 @@ echo "unlock" > "$SXMO_STATE"

case "$SXMO_WM" in
		# This env var requires sxmo to be started, hence we can't set
		# it in profile
		# useable_width="$(swaymsg -t get_outputs -r | jq '.[] | select(.focused == true) | .rect.width')"
		# export WOB_ARGS='-W "$((useable_width - 60))" -a top -a left -a right --border-color "#DBCBA2AA" --background-color "#000000AA" --bar-color "#DBCBA2AA" -b 1 -M 10'
		sxmo_daemons.sh start desktop_notifier mako
		sxmo_daemons.sh start wob sxmo_wob.sh
		sxmo_daemons.sh start menu_mode_toggler sxmo_menumode_toggler.sh
diff --git a/scripts/core/sxmo_wob.sh b/scripts/core/sxmo_wob.sh
index ae2911f..632a873 100644
--- a/scripts/core/sxmo_wob.sh
+++ b/scripts/core/sxmo_wob.sh
@@ -9,13 +9,15 @@
. "$(which sxmo_common.sh)"

useable_width="$(swaymsg -t get_outputs -r | jq '.[] | select(.focused == true) | .rect.width')"
default_args="-W $((useable_width - 60)) -a top -a left -a right -M 10"
rm -f "$wob_sock"
mkfifo "$wob_sock"

# By opening the socket as read-write it isn't closed after the first write
# see https://unix.stackexchange.com/questions/392697
wob -W "$((useable_width - 60))" -a top -a left -a right -M 10 <> "$wob_sock" &
eval "wob $WOB_ARGS" <> "$wob_sock" &

finish() {

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

builds.sr.ht <builds@sr.ht>
Message ID
<20220329091117.507123-1-bruno.dupuis@protonmail.com> (view parent)
DKIM signature
Download raw message
sxmo-utils/patches/.build.yml: SUCCESS in 22s

[WIP: Allow custom wob args in sxmo_wob.sh][0] v2 from [Bruno Dupuis][1]

[0]: https://lists.sr.ht/~mil/sxmo-devel/patches/30648
[1]: bruno.dupuis@protonmail.com

✓ #725662 SUCCESS sxmo-utils/patches/.build.yml https://builds.sr.ht/~mil/job/725662
Message ID
<20220329091117.507123-1-bruno.dupuis@protonmail.com> (view parent)
DKIM signature
Download raw message
I would rather not merge this and wait for this wob patch to be applied
upstream :


This would allow us to use a ini config file.

We would then probably get rid of the width/height computations.
Ideally wob would allow a percent itself.
Reply to thread Export thread (mbox)