Currently what happens:
I press Calculator button on my keyboard, and calculator pops up. No problem there!
Next, after my calculation, I click back to the window where I'm inputting the calculation, and when I press the calculator button again, a NEW window opens in the calculator program.
What I want to happen:
When I click the calculator button, it switches back to the calculator program if it's already open, else, open calculator program. I don't want it to open a new window every time I try to change back to my recent calculation.
It's not a big deal, obviously, just a slight annoyance to me so far. Is there a setting, or some terminal command I can run, or anything I can do to change it?
Thanks!
Best Answer
The tiny script below will do what you want. You need to install
wmctrl
for it to work:After you've installed
wmctrl
, paste the text below into a file and call it whatever you want. I called mine calc-activate.sh.After saving, the text file, make it executable either by right clicking and going to the permissions tab and checking off the Execute boxes, or do it from the terminal with the
chmod
command).Now you can set your multimedia keys:
Please note: Since
wmctrl
looks for a program titled "Calculator" the above script snippet might not work with other languages. To fix, change Calculator so it matches the window title ofgnome-calculator
.Danish example: