Remapping keyboard shortcuts (copy, paste etc) to Alt key instead of Ctrl

Solution 1:

You can use XKeyCaps.

This is my .Xmodmap file, I've got an Apple keyboard.

! Swap Alt and Cmd keys.
keycode 37 =    Control_L
keycode 133 =   Alt_L Meta_L
keycode 64 =    Super_L
keycode 108 =   Super_R
keycode 134 =   ISO_Level3_Shift Multi_key
keycode 105 =   Control_R       Multi_key
clear Shift
clear Lock
clear Control
clear Mod1
clear Mod2
clear Mod3
clear Mod4
clear Mod5
add    Shift   = Shift_L Shift_R
add    Lock    = Caps_Lock
add    Control = Control_L Control_R
add    Mod1    = Alt_L 0x007D
add    Mod2    = Num_Lock
add    Mod4    = Super_L Super_R
add    Mod5    = Mode_switch ISO_Level3_Shift ISO_Level3_Shift ISO_Level3_Shift

! Configure '=' key on numpad as '='.
keycode 0x7D =  equal

Solution 2:

You should be able to use xdotool and additionalKeys from the XMonad.Util.EZConfig module for this. Just install xdotool and then in your ~/.xmonad/xmonad.hs config file you can configure additionalKeys like this:

import XMonad.Util.EZConfig

...

main = xmonad $ defaultConfig { ... }
                 `additionalKeys`
                 [ ((mod1Mask, xK_c), spawn "xdotool key alt+c")
                 , ((mod1Mask, xK_v), spawn "xdotool key alt+v")
                 , ((mod1Mask, xK_x), spawn "xdotool key alt+x")
                 ]