summaryrefslogtreecommitdiff
path: root/qmenu/qmenu_vm/fq_keyboard
diff options
context:
space:
mode:
authorCasper <me@skylarcloud.xyz>2024-12-23 17:13:45 -0700
committerCasper <me@skylarcloud.xyz>2024-12-23 17:13:45 -0700
commit01a33ab0913d439150065ac23644c4f140ff8917 (patch)
tree9ad71bd7e6f5a5aad2c2cdbff4bb75de12565998 /qmenu/qmenu_vm/fq_keyboard
parent7b5a0e9e88f015cb68a46bb657661f4663e287af (diff)
added qmenu!
Diffstat (limited to 'qmenu/qmenu_vm/fq_keyboard')
-rw-r--r--qmenu/qmenu_vm/fq_keyboard12
1 files changed, 12 insertions, 0 deletions
diff --git a/qmenu/qmenu_vm/fq_keyboard b/qmenu/qmenu_vm/fq_keyboard
new file mode 100644
index 0000000..7a5c6e8
--- /dev/null
+++ b/qmenu/qmenu_vm/fq_keyboard
@@ -0,0 +1,12 @@
+LAYOUT=$(ls /usr/share/X11/xkb/symbols | dmenu-unlinked -l 50 -p "$qube:") &&
+
+if [ -n "$LAYOUT" ]; then
+
+ [ -d /usr/share/X11/xkb/symbols/"$LAYOUT" ] && LAYOUT="$LAYOUT/"$(ls /usr/share/X11/xkb/symbols/"$LAYOUT" | dmenu-unlinked -l 50 -p "$qube:")
+
+ $(qvm-run -q "$qube" "setxkbmap $LAYOUT" || notify-send -u normal "Error: Failed to set keyboard layout to '$LAYOUT' in $qube! Please check if the selected layout is missing inside the qube itself.")&
+
+ # 'qmenu-vm' does not get informed about the available layouts by the vm itself,
+ # so it is possible that the selected layout is missing inside the vm.
+ # However, getting the info from the vm itself would pose an unneccesary high risk.
+fi