From 96389afe17a009ec73b52364f5f23cde802906e0 Mon Sep 17 00:00:00 2001 From: Vaughn Kottler Date: Wed, 15 May 2024 18:24:52 -0700 Subject: [PATCH 1/2] Improvements for pi5 provisioning --- .../bookworm-on-screen-keyboard.txt | 47 +++ data/bookworm-osk/keyboard.xml | 302 ++++++++++++++++++ data/bookworm-osk/toggle-wvkbd.sh | 21 ++ data/bookworm-osk/wvkbd.desktop | 9 + scripts/sh/install_raspberrypi.sh | 5 +- 5 files changed, 383 insertions(+), 1 deletion(-) create mode 100644 data/bookworm-osk/bookworm-on-screen-keyboard.txt create mode 100755 data/bookworm-osk/keyboard.xml create mode 100755 data/bookworm-osk/toggle-wvkbd.sh create mode 100755 data/bookworm-osk/wvkbd.desktop diff --git a/data/bookworm-osk/bookworm-on-screen-keyboard.txt b/data/bookworm-osk/bookworm-on-screen-keyboard.txt new file mode 100644 index 0000000..29e5077 --- /dev/null +++ b/data/bookworm-osk/bookworm-on-screen-keyboard.txt @@ -0,0 +1,47 @@ +HOW-TO: install an on-screen Keyboard to Bookworm + +Introduction: The latest PI OS (Bookworm) uses Wayland. The distribution shipped (Oct 2023) without an on-screen keyboard. Most on-screen keyboards (like matchbox-keyboard) do not work under wayland. This process will install both matchbox-keyboard (for X11 use) and wvkbd (for use under wayland). + +Installation: +1) set the localisations in the "preferences - Raspberry pi configuration - localisation". + - this may not be necessary in the future, but the current pi-imager (1.7.5) does not set them properly. + - the bug is reported to pi-imager, i assume it will be fixed soon + +2) copy the files in. In this example, i copied then to /home/pi. The below instructions assume this is the source location for copying files to other locations. YMMV + files to be copied in: (files in the zip archive) + - keyboard.xml + - wvkbd.desktop + - toggle-wvkbd.sh + +2a) make sure "toggle-wvkbd.sh" is set to executable (right-click - properties - permissions -execute by anybody) + +3) install matchbox-keyboard: + - with "sudo apt install matchbox-keyboard" in a terminal + +3a) replace the default (terrible) matchbox keyboard ..copy the new xml file in. (use a terminal) + - "sudo cp ./keyboard.xml /usr/share/matchbox-keyboard/keyboard.xml" + - the above replaces the default matchbox-keyboard with a new keyboard layout. (in case you ever switch back to X environment.) + + +4) Install wvkbd + - "sudo apt install wvkbd" + - note: this creates "wvkbd-mobintl" executable in /usr/bin +5) copy the scripts to toggle keyboard and the desktop file in to /usr/bin: + - "sudo cp ./toggle-wvkbd.sh /usr/bin/toggle-wvkbd.sh" + - "sudo cp ./wvkbd.desktop /usr/bin/wvkbd.desktop" + +6) Add to the launcher menu + - note: this adds a new icon to the (left) launcher menu, as i could not figure out how to add it to the panel applets on the right side + - open file manager + - enable "hidden files" in the menu (view - show hidden) + - open folder ".config" + - EDIT the file "wf-panel-pi.ini" as follows: + - under "launcher_000003=lxterminal.desktop" ADD a NEW line: + "launcher_000004=/usr/bin/wvkbd.desktop" + - Save the file + - a new icon should appear to toggle the on-screen keyboard. + +final note: my "toggle-wvkbd.sh" script has set the colors and size to my liking. you can edit this bash script to set whatever options you prefer. Also, when everything is working you may delete the files from /home/pi where you copied them in (step 2 above) + +@TerribleTed Oct 2023 + diff --git a/data/bookworm-osk/keyboard.xml b/data/bookworm-osk/keyboard.xml new file mode 100755 index 0000000..83a9bb4 --- /dev/null +++ b/data/bookworm-osk/keyboard.xml @@ -0,0 +1,302 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/bookworm-osk/toggle-wvkbd.sh b/data/bookworm-osk/toggle-wvkbd.sh new file mode 100755 index 0000000..0b3ba22 --- /dev/null +++ b/data/bookworm-osk/toggle-wvkbd.sh @@ -0,0 +1,21 @@ +#!/bin/bash +#This script toggle the virtual keyboard +# +# this file is in /usr/bin/toggle-wvkbd.sh +# +PID="$(pidof wvkbd-mobintl)" +if [ "$PID" != "" ]; then + killall wvkbd-mobintl +else + wvkbd-mobintl -L 300 -fg ffffff -fg-sp ffffff --text 000000 --text-sp 000000 -fn 40 +# use wvkbd-mobintl --help for options +# my options: +# -L 300 = landscape, 300 pixels tall +# -fg ffffff = foreground color white +# -fg-sp ffffff = special keys foreground white +# -text 000000 = text color black +# -text-sp 000000 = special keys text color black +# -fn 40 = font size 40 + + +fi diff --git a/data/bookworm-osk/wvkbd.desktop b/data/bookworm-osk/wvkbd.desktop new file mode 100755 index 0000000..aec6ffd --- /dev/null +++ b/data/bookworm-osk/wvkbd.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Toggle wvkbd Keyboard +Comment=Toggle wvkbd Keyboard +Exec=/usr/bin/toggle-wvkbd.sh +Type=Application +Icon=matchbox-keyboard.png +Categories=Panel;Utility;MB +X-MB-INPUT-MECHANISM=True +Name[en_US]=Toggle wvkbd diff --git a/scripts/sh/install_raspberrypi.sh b/scripts/sh/install_raspberrypi.sh index 41d4fc6..9eab871 100644 --- a/scripts/sh/install_raspberrypi.sh +++ b/scripts/sh/install_raspberrypi.sh @@ -9,4 +9,7 @@ for repo in "${REPOS[@]}"; do clone_third_party_github raspberrypi "$repo" done -PACKAGES+=(i2c-tools) +PACKAGES+=(i2c-tools matchbox-keyboard wvkbd) + +# do on screen keyboard stuff +# sudo cp ./keyboard.xml /usr/share/matchbox-keyboard/keyboard.xml From 27f10bc0da1f4884ec24e038b5034404ca3106fb Mon Sep 17 00:00:00 2001 From: Vaughn Kottler Date: Fri, 17 May 2024 13:03:06 -0700 Subject: [PATCH 2/2] Final touches --- scripts/sh/install_raspberrypi.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/sh/install_raspberrypi.sh b/scripts/sh/install_raspberrypi.sh index 9eab871..614d30b 100644 --- a/scripts/sh/install_raspberrypi.sh +++ b/scripts/sh/install_raspberrypi.sh @@ -9,7 +9,10 @@ for repo in "${REPOS[@]}"; do clone_third_party_github raspberrypi "$repo" done -PACKAGES+=(i2c-tools matchbox-keyboard wvkbd) +# pick one of the keyboards +PACKAGES+=(i2c-tools wvkbd) -# do on screen keyboard stuff -# sudo cp ./keyboard.xml /usr/share/matchbox-keyboard/keyboard.xml +# https://forums.raspberrypi.com/viewtopic.php?t=358654 +# in file .config/wf-panel-pi.ini ADD the following: +# autohide=true +# autohide_duration=500