From dbdb45bd6c798294ac6a0e31baaf3cd1fe24d231 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Sat, 8 Aug 2020 22:46:34 +0200 Subject: [PATCH] smarter configuration of default keyboard if none specified; now compatible with upstream svkbd Minor patch that correctly detects which virtual keyboard is available if none was set explicitly, supports both the new upstream svkbd, as well as the current sxmo-svkbd fork. --- scripts/core/sxmo_xinit.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/core/sxmo_xinit.sh b/scripts/core/sxmo_xinit.sh index 9becdb1..1b2675a 100755 --- a/scripts/core/sxmo_xinit.sh +++ b/scripts/core/sxmo_xinit.sh @@ -6,7 +6,7 @@ envvars() { command -v "$TERM" || export TERM=st command -v "$BROWSER" || export BROWSER=surf command -v "$EDITOR" || export EDITOR=vis - command -v "$KEYBOARD" || export KEYBOARD=svkbd-sxmo + command -v "$KEYBOARD" || defaultkeyboard [ -z "$MOZ_USE_XINPUT2" ] && export MOZ_USE_XINPUT2=1 [ -z "$XDG_CONFIG_HOME" ] && export XDG_CONFIG_HOME=~/.config [ -z "$XDG_CACHE_HOME" ] && export XDG_CACHE_HOME=~/.cache @@ -29,6 +29,16 @@ xdefaults() { synclient TapButton1=1 TapButton2=3 TapButton3=2 MinSpeed=0.25 } +defaultkeyboard() { + if command -v svkbd-mobile-intl; then + export KEYBOARD=svkbd-mobile-intl + elif command -v svkbd-mobile-plain; then + export KEYBOARD=svkbd-mobile-plain + else + export KEYBOARD=svkbd-sxmo + fi +} + daemons() { pkill conky if [ -e "$XDG_CONFIG_HOME/sxmo/conky.conf" ]; then