summaryrefslogtreecommitdiff
path: root/fish/functions/switchvirtualkeyboard.fish
diff options
context:
space:
mode:
Diffstat (limited to 'fish/functions/switchvirtualkeyboard.fish')
-rw-r--r--fish/functions/switchvirtualkeyboard.fish16
1 files changed, 16 insertions, 0 deletions
diff --git a/fish/functions/switchvirtualkeyboard.fish b/fish/functions/switchvirtualkeyboard.fish
new file mode 100644
index 0000000..5700bf7
--- /dev/null
+++ b/fish/functions/switchvirtualkeyboard.fish
@@ -0,0 +1,16 @@
+function setvirtualkeyboard
+ echo "Starting $argv[1]"
+ kwriteconfig6 --file kwinrc --group Wayland --key InputMethod "$argv[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
+end
+
+function switchvirtualkeyboard
+ busctl --user monitor --match "type='signal',interface='org.kde.KWin.TabletModeManager',member='tabletModeChanged'" | \
+ while read -l line
+ if string match -q "*true*" $line
+ setvirtualkeyboard /usr/share/applications/com.github.maliit.keyboard.desktop
+ else if string match -q "*false*" $line
+ setvirtualkeyboard /usr/share/applications/fcitx5-wayland-launcher.desktop
+ end
+ end
+end