diff options
author | Anthony Wang | 2024-09-25 21:21:26 -0400 |
---|---|---|
committer | Anthony Wang | 2024-09-25 21:21:26 -0400 |
commit | 1f890f45ee33ada3838ae82117313e50b58e963a (patch) | |
tree | b76e775c33233bd7d1ca09281f2dabf95c3db810 | |
parent | 33c85ad11bd95174640b5892e14b56d7f33a88c9 (diff) |
Add switchvirtualkeyboard script to autostart
-rw-r--r-- | autostart/ssh-add.desktop | 2 | ||||
-rw-r--r-- | autostart/switchvirtualkeyboard.desktop | 4 | ||||
-rwxr-xr-x | autostart/switchvirtualkeyboard.sh | 16 |
3 files changed, 21 insertions, 1 deletions
diff --git a/autostart/ssh-add.desktop b/autostart/ssh-add.desktop index 01d2f1c..4ec7d65 100644 --- a/autostart/ssh-add.desktop +++ b/autostart/ssh-add.desktop @@ -1,4 +1,4 @@ [Desktop Entry] -Exec=ssh-add -q +Exec=ssh-add Name=ssh-add Type=Application diff --git a/autostart/switchvirtualkeyboard.desktop b/autostart/switchvirtualkeyboard.desktop new file mode 100644 index 0000000..f66d8e0 --- /dev/null +++ b/autostart/switchvirtualkeyboard.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Exec=bash ~/.config/autostart/switchvirtualkeyboard.sh +Name=switchvirtualkeyboard +Type=Application 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 |