[ubuntu-us-ma] What do you think of this script? (singleton.py)
danielhollocher at gmail.com
Wed Sep 23 02:37:31 BST 2009
There is a feature that I wanted in Ubuntu, and I managed to start a
script that makes it happen. Basically, I wanted to have keyboard
shortcuts that didn't just open programs, it would close programs too.
For example, I don't need my gmail open more than once. But, I can
lose the tab where it is open, so I can end up with 3 or 4 firefox
tabs with gmail open, which just clutters up my workspace. The way I
have it setup now, when I click the shortcut and the window of gmail
is already open, gmail is closed.
Click button once, open program. Click button again, close it.
(personally, I wish this was just a part of gnome)
To use the script, just put it in a folder where it can have write
access, and then run the script with the program you want to run as an
argument. I have it setup of course, with a keyboard shortcut.
I've tested with gcalctool and firefox. Support for firefox is very
hacky. It's really the only way, but I want to give you fair warning.
The script avoids the default profile and creates a new profile to do
its work, so your settings should be ok. The tricky thing is getting
it to run separate, and then closing it.
If you think it's cool, let me know! And maybe I will post it to a
In science and in mind, the impossible and the hasn't-happened-yet are
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3435 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/ubuntu-us-ma/attachments/20090922/8605468b/attachment-0002.py
More information about the Ubuntu-us-ma