Changing media key defaults in Gnome
Solution 1:
Open Keyboard Shortcuts (
System -> Preferences -> Keyboard Shortcuts
). By default you would see "Launch Calculator" action mapped toXF86Calculator
, click on it and press Backspace to leave it disabled.Click on
Add
button to get "Custom Shortcut" dialog. Enter name as "My Calculator Script" and command as the full path to your script. ClickOK
.You will find this new shortcut at the end of the list. Click on it (you will see shortcut entry against it will change from
Disabled
toNew Shortcut...
).Press the
XF86Calculator
key (the special calculator key on your keyboard)Press
Close
to close this dialog. This should now run your script when you press the calculator key.