Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Under XFCE, I had option to set my keyboard media keys to run particular programs or scripts. I understand the options to adjust the Keyboard Shortcuts under Gnome, but how do I change the default programs that the keys use.

For example, I have a script I use that manages my calculator (in this case, galculator). This script not only launches an instance of galculator but makes sure that another instance is not running. So unlike the default manner under Gnome, if one instance is already running, it just brings focus to it). I am not having 15 different calculators to close out in the end.

I have tried looking under gconf and keyboard shortcuts. Any other ideas?

share|improve this question
    
When you open Keyboard Shortcuts (System -> Preferences -> Keyboard Shortcuts) do you see anything mapped to XF86Calculator ? If yes, has changing this to run your script not helped to solve this ? –  koushik Oct 15 '10 at 5:40

1 Answer 1

up vote 6 down vote accepted
  1. Open Keyboard Shortcuts (System -> Preferences -> Keyboard Shortcuts). By default you would see "Launch Calculator" action mapped to XF86Calculator, click on it and press Backspace to leave it disabled.

  2. Click on Add button to get "Custom Shortcut" dialog. Enter name as "My Calculator Script" and command as the full path to your script. Click OK.

  3. 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 to New Shortcut...).

  4. Press the XF86Calculator key (the special calculator key on your keyboard)

  5. Press Close to close this dialog. This should now run your script when you press the calculator key.

share|improve this answer
    
That works. Just have to put the full working directory of the script in (/home/user/script/script.sh not script/script.sh or ~/script/script.sh). –  Casey Keller Oct 15 '10 at 15:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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