From 8135adde596324a009b8ff0a86c12a29515f8a43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Braga?= Date: Sat, 16 May 2026 12:09:01 +0100 Subject: [PATCH] apps: qterminal terminal-friendly keyboard + dedicated workspace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qterminal.sh: - Replace plain sway_fullscreen with a workspace-99-dedicated layout so qterminal is the sole tiled window there, letting sway fill the workspace minus wvkbd's exclusive_zone without overlap or side-by-side tile artifacts. - Spawn wvkbd-mobintl with -l full,nav,special (default `simple` layout has no Ctrl/Alt/arrows — useless in a shell). Sized at -H 380 -L 380 -fn 32 for the SM8750 landscape-via-transform=90 orientation. - Stash and restore the prior workspace + rocknix.touchscreen-keyboard setting on exit via trap, so closing qterminal doesn't strand the user on workspace 99 with the on-screen keyboard still active. rocknix-touchscreen-keyboard 004-full-layout-terminal-friendly: - Rework the `full` keyboard layout's top/bottom rows: Tab moves to top-left, Ctrl moves to the bottom row (the slot 123 vacated) so it sits under Shift for one-handed modifier holds, 123 (layer switch) moves to the top row away from the cursor keys, and the comma/period pair sit side-by-side after the spacebar. Row widths preserved (10.0 each). --- .../apps/qterminal/scripts/qterminal.sh | 31 ++++++++++++- .../004-full-layout-terminal-friendly.patch | 46 +++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 projects/ROCKNIX/packages/apps/rocknix-touchscreen-keyboard/patches/004-full-layout-terminal-friendly.patch diff --git a/projects/ROCKNIX/packages/apps/qterminal/scripts/qterminal.sh b/projects/ROCKNIX/packages/apps/qterminal/scripts/qterminal.sh index b35e393f665..cad39d2e068 100644 --- a/projects/ROCKNIX/packages/apps/qterminal/scripts/qterminal.sh +++ b/projects/ROCKNIX/packages/apps/qterminal/scripts/qterminal.sh @@ -10,7 +10,36 @@ if [ ! -d "/storage/.config/qterminal.org" ]; then cp -r "/usr/config/qterminal.org" "/storage/.config/" fi -sway_fullscreen "qterminal" & +# wvkbd default layout (`simple`) lacks Ctrl/Alt and arrows, useless in a +# terminal. We want `full,nav,special`. Also, sway fullscreen ignores layer- +# shell exclusive_zone, and plain tiled puts qterminal next to ES/foot in the +# same workspace. Solution: dedicate workspace 99 to qterminal so it's the +# sole tiled window there — sway then fills the workspace area minus wvkbd's +# exclusive_zone, giving us no overlap and no side-by-side tile. +prior_tskb=$(get_setting "rocknix.touchscreen-keyboard.enabled") +set_setting "rocknix.touchscreen-keyboard.enabled" "0" +pkill wvkbd-mobintl 2>/dev/null +sleep 0.2 + +# -H is portrait height, -L is landscape height. SM8750 boots landscape via +# sway transform=90, so -L is what matters here; without it wvkbd falls back +# to a tiny default (~120 px) and the keys end up squished. -fn 32 fits the +# 5-row `full` layout at 380 px without overflow. +/usr/bin/wvkbd-mobintl -H 380 -L 380 -fg 6b6b75 -fg-sp 6b6b75 -bg 1d1d1d \ + --text ffffff --text-sp ffffff -press 000000 --press-sp 000000 -fn 32 \ + -l full,nav,special & + +# Stash the workspace we came from, so we can return there on exit. +prior_ws=$(swaymsg -t get_workspaces | jq -r '.[] | select(.focused) | .name') +swaymsg "workspace 99:qterminal" +swaymsg 'for_window [app_id="qterminal"] move container to workspace 99:qterminal, focus' + +cleanup_osk() { + pkill wvkbd-mobintl 2>/dev/null + set_setting "rocknix.touchscreen-keyboard.enabled" "${prior_tskb:-1}" + [ -n "${prior_ws}" ] && swaymsg "workspace ${prior_ws}" 2>/dev/null +} +trap cleanup_osk EXIT INT TERM cd ~/ /usr/bin/qterminal diff --git a/projects/ROCKNIX/packages/apps/rocknix-touchscreen-keyboard/patches/004-full-layout-terminal-friendly.patch b/projects/ROCKNIX/packages/apps/rocknix-touchscreen-keyboard/patches/004-full-layout-terminal-friendly.patch new file mode 100644 index 00000000000..12fd1a8a55a --- /dev/null +++ b/projects/ROCKNIX/packages/apps/rocknix-touchscreen-keyboard/patches/004-full-layout-terminal-friendly.patch @@ -0,0 +1,46 @@ +Rework the `full` layout for terminal use: Tab and 123 swap positions in +the top row so the layer-switch key is far away from the cursor keys; Ctrl +moves from the top row to the bottom row (the slot 123 vacated) so it sits +directly under Shift for one-handed terminal modifiers; and the comma and +period are placed side-by-side after the spacebar instead of flanking it. + +Row widths are preserved (top row stays 10.0, bottom row stays 10.0). + +--- + layout.mobintl.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/layout.mobintl.h b/layout.mobintl.h +--- a/layout.mobintl.h ++++ b/layout.mobintl.h +@@ -174,7 +174,7 @@ static struct key keys_arrows[] = { + + static struct key keys_full[] = { + {"Esc", "Esc", 1.0, Code, KEY_ESC, .scheme = 1}, +- {"Ctr", "Ctr", 1.0, Mod, Ctrl, .scheme = 1}, ++ {"Tab", "Tab", 1.0, Code, KEY_TAB, .scheme = 1}, + {"↑", "↑", 1.0, Code, KEY_UP, .scheme = 1}, + {"↓", "↓", 1.0, Code, KEY_DOWN, .scheme = 1}, + {"←", "←", 1.0, Code, KEY_LEFT, .scheme = 1}, +@@ -182,7 +182,7 @@ static struct key keys_full[] = { + {"'", "\"", 1.0, Code, KEY_APOSTROPHE, &layouts[ComposeBracket] }, + {"-", "_", 1.0, Code, KEY_MINUS, &layouts[ComposeMath] }, + {"/", ">", 1.0, Code, KEY_SLASH, &layouts[ComposePunctuation] }, +- {"Tab", "Tab", 1.0, Code, KEY_TAB, .scheme = 1}, ++ {"123", "123", 1.0, NextLayer, .scheme = 1}, + {"", "", 0.0, EndRow}, + + {"1", "!", 1.0, Code, KEY_1}, +@@ -233,11 +233,11 @@ static struct key keys_full[] = { + {"Back", "Back", 1.5, Code, KEY_BACKSPACE, .scheme = 1}, + {"", "", 0.0, EndRow}, + +- {"123", "123", 1.5, NextLayer, .scheme = 1}, ++ {"Ctr", "Ctr", 1.5, Mod, Ctrl, .scheme = 1}, + {"Cmp", "Cmp", 1.0, Compose, .scheme = 1}, +- {",", "'", 1.0, Code, KEY_COMMA, &layouts[ComposeMath]}, + {"", "Tab", 4.0, Code, KEY_SPACE}, ++ {",", "'", 1.0, Code, KEY_COMMA, &layouts[ComposeMath]}, + {".", "?", 1.0, Code, KEY_DOT, &layouts[ComposePunctuation]}, + {"Enter", "Enter", 1.5, Code, KEY_ENTER, .scheme = 1}, +