First, install Solaar to see the battery level on the taskbar
sudo apt-get install solaar
To remap the keys, install
sudo apt-get install xbindkeys xautomation
Then, launch xev to get the keyboard or mouse event to bind
xev
# grep button
xev | grep -i button
Create the configuration file for xbindkeys
nano ~/.xbindkeysrc
Here is an example of this file that map the Back and Forward buttons to BackSpace and Return respectively
# Mouse key codes
# -------------------------
# thumb wheel up => b:6
# thumb wheel down => b:7
# backward button => b:8
# forward button => b:9
# -------------------------
# Crl Alt Down
"xdotool key 0xffe3+0xffe9+0xff54"
b:7
# Crl Alt Up
"xdotool key 0xffe3+0xffe9+0xff52"
b:6
# increase volume and unmute
"amixer -D pulse set Master 4000+ unmute"
b:9
# lower volume
"amixer -D pulse set Master 4000-"
b:8
# previous song
#"xte 'key XF86AudioPrev'"
# b:8
# next song
#"xte 'key XF86AudioNext'"
# b:8
Use xdotool
# Install
sudo apt-get install -y xdotool
See the list of xdotool key codes here
To test your binding
xbindkeys -v
To start xbindkeys
xbindkeys
To find key code
xbindkeys --key
// or
xbindkeys --multikey
If you change the key map, you have to restart xbindkeys by following command
killall xbindkeys && xbindkeys