Ubuntu – Custom key for Home/End on Ubuntu Gnome 15.10

keyboardxdotool

My laptop is Thinkpad T440.
Because of Lenovo designing, Home/End key is on header, in the line with F1-F12 keys.
For my convinient, I want to make some custom shortcut key to map with Home/End key. (ex: Alt+PageUp -> Home, Alt+PageDown -> End).

I tried with xdotool, but it was not worked 🙁

   name: Homepress
   command: xdotool key --clearmodifiers Home
   shortcut key: Alt+Page Up
   --
   name: Endpress
   command: xdotool key --clearmodifiers End
   shortcut key: Alt+Page Down

What should I do ?

Noted that I don't want to print any special chracters from keyboard with custom shortcut key, I just want to replace "Home/End" key with another key/shortcut.

Best Answer

I solved this with xbindkeys.

Install it:

sudo apt-get install xbindkeys xdotool

then create a default config:

xbindkeys --defaults > ~/.xbindkeysrc

Add this to .xbindkeysrc:

"xdotool key --clearmodifiers Home"
    Release + Alt + Prior

"xdotool key --clearmodifiers End"
    Release + Alt + Next

restart xbindkeys

An alternative is using AutoKey: AutoKey screenshot

Related Question