0

In Ubuntu 15.04, I can set a custom shortcut for the calculator button (after disabling the built-in shortcut for opening the actual calculator).

However, I am unable to get a {modifier}+Calculator to work. When I was using Linux Mint 17, I had no issues with using a modifier.

In Ubuntu, it lets me set the combo (the preference window properly shows Shift+Calculator or Ctrl+Calculator). But if I press the combo, my action never runs. If I remove the modifiers and use only the Calculator button, the action runs correctly.

Is this a bug, or is there something else that is preventing a {modifier}+Calculator from running my script? Perhaps something else in unity is capturing the shortcut?

Edit. It is only blocking a {modifier}+Calculator combo. {modifier}+Break, for example, works to run my script. The Calculator key seems to be the only one I can find that has this problem with a modifier.

Edit 2. Clarification: the 🖩 Calculator button I am referring to is an actual button on my keyboard, just like 🔊 Vol+, ▶ Play, 🔎 Search, etc. I am not trying to load the gnome calculator at all.

  • do you know the command line equivalent to open the calculator? – mchid Jul 31 '15 at 1:03
2

If you know the command to open the calculator, you should set the keyboard shortcut in compiz.

You should probably not use the generic method offered by unity as this method is unreliable and the compiz method is very reliable.

First, install ccsm:

sudo apt-get update
sudo apt-get install compizconfig-settings-manager

Now, press ALT + F2 type ccsm and then press ENTER.

Enable the "commands" plugin and then click on the "commands" plugin to set the settings.

In the category for "command line 0" type the custom command.

Click on the "key bindings" tab and on the row for "run command 0", click where it says "disabled" to set the keys you want to use to run your custom command.

Click the box for "enabled" on the popup window that appears. Click on "grab key combination" to set the keys and then click "OK" when you are done.

  • I want to do the opposite. Since I don't use the calculator very often, I'd rather map the calculator button on my keyboard to run something else. Is there a place in compiz to set custom shortcuts? – Stephen Schrauger Jul 31 '15 at 14:32
  • @Stephen Have you tried suggested "grab key combination"? I believe the command is gnome-calculator. – VRR Jul 31 '15 at 15:24
  • @mchid It looks like your custom command suggestion worked. It grabbed the key combo (just like the unity keyboard preference did), but it actually ran my script like it was supposed to. – Stephen Schrauger Jul 31 '15 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.