
Some devices doesn't need a virtual keyboard, aka Nokia N900, aka Pinephone with keyboard. This give a way to disable this feature completely. Also, we remove the sxmo_dmenu_with_kb.sh script, cause it is poorly used, and give inconsistent behavior between menus. The user can already open the keyboard very easily. For this same reason, we remove some random "sxmo_keyboards.sh open". If this isn't necessary cause of a specific usage (aka dtmf special layout. I also dropped some code in sxmo_dmenu.sh that adapt the available size depending on if the keyboard is open or not. The keyboard can be open later, so this is dumb to rely on this, and we should alway be able to open/close it, and to read all lines. I adapted the inputhandler a bit when keyboard is disabled. If you guys think about better usage of freed handler, I'm open!
37 lines
591 B
Bash
Executable File
37 lines
591 B
Bash
Executable File
#!/bin/sh
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
# Copyright 2022 Sxmo Contributors
|
|
INPUT="$(cat)"
|
|
STWIN="$(xprop -root | sed -n '/^_NET_ACTIVE_WINDOW/ s/.* //p')"
|
|
|
|
menu() {
|
|
RESULT="$(
|
|
printf %b "$(
|
|
echo "Close Menu";
|
|
echo "$INPUT" | grep -Eo '\S+' | tr -d '[:blank:]' | sort | uniq
|
|
)" | sxmo_dmenu.sh -p "$PROMPT" -i
|
|
)"
|
|
}
|
|
|
|
copy() {
|
|
PROMPT=Copy
|
|
menu
|
|
if [ "$RESULT" = "Close Menu" ]; then
|
|
exit 0
|
|
else
|
|
echo "$RESULT" | xclip -i
|
|
fi
|
|
}
|
|
|
|
type() {
|
|
PROMPT=Type
|
|
menu
|
|
if [ "$RESULT" = "Close Menu" ]; then
|
|
exit 0
|
|
else
|
|
xdotool type --window "$STWIN" "$RESULT"
|
|
fi
|
|
}
|
|
|
|
"$1"
|