summaryrefslogtreecommitdiff
path: root/qmenu/qmenu_vm/fq_keyboard
blob: 7a5c6e8ec6cc49a5594f703afa2e81ebbca188b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
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