summaryrefslogtreecommitdiff
path: root/autostart/switchvirtualkeyboard.sh
diff options
context:
space:
mode:
Diffstat (limited to 'autostart/switchvirtualkeyboard.sh')
-rwxr-xr-xautostart/switchvirtualkeyboard.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/autostart/switchvirtualkeyboard.sh b/autostart/switchvirtualkeyboard.sh
new file mode 100755
index 0000000..56473ba
--- /dev/null
+++ b/autostart/switchvirtualkeyboard.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+switch() {
+ echo "Starting $1"
+ kwriteconfig6 --file kwinrc --group Wayland --key InputMethod "$1"
+ busctl --user emit /kwinrc org.kde.kconfig.notify ConfigChanged "a{saay}" 1 Wayland 1 11 73 110 112 117 116 77 101 116 104 111 100
+}
+
+busctl --user monitor --match "type='signal',interface='org.kde.KWin.TabletModeManager',member='tabletModeChanged'" | \
+while read -r line; do
+ if [[ $line == *"true"* ]]; then
+ switch /usr/share/applications/com.github.maliit.keyboard.desktop
+ elif [[ $line == *"false"* ]]; then
+ switch /usr/share/applications/fcitx5-wayland-launcher.desktop
+ fi
+done