You might need to use setxkbmap
in Domain0. . .
Use xev
command in dom0 to identify the exact keycodes for the keys you want to swap (AD07 and AE04). Press the keys one by one and note the keycode in the output.
In dom0, create a script (e.g., swap_keys.sh
) with the following content, replacing KEYCODE1
and KEYCODE2
with the actual keycodes you identified:
setxkbmap -layout "ur" -option "grp:win_space_toggle" -option "map:AE04=KEYCODE1,AD07=KEYCODE2"
This script sets the Urdu layout, enables the Windows key as a toggle for switching layouts (optional), and swaps the keycodes using the map
option.
Make the script executable: chmod +x swap_keys.sh
There is another way where you can create a custom X11 keyboard layout configuration file. . .
I need a few minutes to put it together, I have some old scripts that I need to condense ans maybe they work? Either way you will need to use a script.
Keyboard layout files are stored in /usr/share/X11/xkb/symbols/
Copy the existing layout file for Urdu from the system directory to a new file in the same directory.
sudo cp /usr/share/X11/xkb/symbols/pk /usr/share/X11/xkb/symbols/pk_custom
Open the copied layout file with a text editor.
sudo nano /usr/share/X11/xkb/symbols/pk_custom
Look for the section defining the keys you want to swap. It might look something like this (you will need to adapt this to match the specific layout details of your Urdu layout):
key <AD07> { [ dollar, asciicircum, dollar, asciicircum ] };
key <AE04> { [ u, U, u, U ] };
Swap the key definitions. Modify them as follows:
key <AD07> { [ u, U, u, U ] };
key <AE04> { [ dollar, asciicircum, dollar, asciicircum ] };
Modify the sudo nano /etc/X11/xorg.conf.d/00-keyboard.conf
and add :
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "pk_custom"
EndSection
Restart the X server or reboot the machine.
@shamsuddin82 This might be easier than the first comment . . . QubesOS might be based on Fedora but there are fundamental differences, this “should work” but we can’t be too much help outside of this. I don’t run QubesOS, so it’s hard to replicate. Good luck.