#!/bin/bash
#############################################
#                                           #
#  Switches HOME with DEL key (and back)    #
#  Depends on: xmodmap                      #
#                                           #
#  Koentje  (remon@cobrasoft.nl)            #
#                                           #
#############################################

# "xmodmap -pk" shows all key numbers/names available.
# Uncomment below line to see all key codes.
#xmodmap -pk | less; exit


if [ "$1" = "switch" ]; then
  # Switch DEL with INS
  xmodmap -e "keycode 118 = Delete"
  xmodmap -e "keycode 119 = Insert"

elif [ "$1" = "normal" ]; then
  # Switch to normal
  xmodmap -e "keycode 118 = Insert"
  xmodmap -e "keycode 119 = Delete"

else
  echo -e "\n Usage:  swapkeys switch"
  echo -e "         swapkeys normal \n"
fi