How to set Qalculator as default calculator?

I came here to find an answer which doesn't include moving around executables and creating links. Then realized that the answer is actually very simple and obvious:

Go to settings and create a custom key binding for whichever calculator app you want and calc key. Let it disable the old one. And that's it :)


I solved it following the link in this comment by @Wilf to this Ubuntu Forums thread

Ubuntu 13.10 uses the calculator tool gnome-caculator. So instead of messing with the system, the easiest is to fake this shortcut with a symbolic link bound to qalculator tool.

sudo mv /usr/bin/gnome-calculator /usr/bin/gnome-calculator_original
sudo ln -sT /usr/bin/qalculate /usr/bin/gnome-calculator

The shortcut works instantly.


The best option IMHO is to redefine the keybinding of the Calculator key, just as @user58635 said.

In order to make it more programatically, for example to include in a script to be executed after a new installation, these steps may be useful for more than one:

  1. Set the current binding to none:

    gsettings set org.gnome.settings-daemon.plugins.media-keys calculator ''
    
    • Or you can set it to another keybinding, e.g. pressing Shift+Calculator:

      gsettings set org.gnome.settings-daemon.plugins.media-keys calculator '<Shift>Calculator'
      
  2. Create a new custom keybinding for the Calculator key1:

    1. If you have no other custom keybinding:

      # Create a new set of custom keybindings
      gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/']"
      
      # Set the new custom keybinding (key, command, name)
      gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ binding 'Calculator'
      gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ command 'qalculate-gtk'
      gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name 'Qalculate'
      
    2. If you already have some custom keybinding in operation, you must add this as another one. For example:

      # Create a new set of custom keybindings
      gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/']"
      
      # Set the first custom keybinding (key, command, name)
      gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ binding 'Launch5'
      gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ command 'iceweasel -ProfileManager -no-remote'
      gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name 'Iceweasel'
      
      # Set the second (new) custom keybinding (key, command, name)
      gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ binding 'Calculator'
      gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ command 'qalculate-gtk'
      gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ name 'Qalculate'
      
  3. If nothing happens at first try, just restart Gnome. In Gnome Shell it is just Alt+F2 and then press r+Enter


References:

1: Take this excellent answer as advice: https://askubuntu.com/a/597414/17564