Example on Ubuntu 19.10
- Open Gnome-Terminal
- Run
xev | grep keycode
- Press SCRLK key once and Pause key once
you will have the result like this
$ xev | grep keycode
state 0x10, keycode 36 (keysym 0xff0d, Return), same_screen YES,
state 0x10, keycode 78 (keysym 0xff14, Scroll_Lock), same_screen YES,
state 0x10, keycode 78 (keysym 0xff14, Scroll_Lock), same_screen YES,
state 0x10, keycode 127 (keysym 0xff13, Pause), same_screen YES,
state 0x10, keycode 127 (keysym 0xff13, Pause), same_screen YES,
$
Note down the keycode for SCRLK and Pause 78 and 127 in my case.
now run xmodmap -e "keycode 78 = XF86AudioLowerVolume"
xmodmap -e "keycode 127 = XF86AudioRaiseVolume"
sample:
$ xmodmap -e "keycode 78 = XF86AudioLowerVolume"
$ xmodmap -e "keycode 127 = XF86AudioRaiseVolume"
$
Once you logout above changes will reset to normal..
There are different ways to make xmodmap
changes permanently.. a google search will give you lot of links.. one of them is How to apply Xmodmap permanently