Debian wheezy keyboard shortcut for both opening and closing a terminal

Posted by Peter on Super User See other posts from Super User or by Peter
Published on 2012-11-24T10:39:44Z Indexed on 2012/11/24 11:13 UTC
Read the original article Hit count: 301

I recently installed tilda and I would like to open it and close with the same keyboard shortcut. I wrote little something in bash that closes tilda if it is open and opens tilda when there is no such a process in ps -ef. It looks like this:

a=ps -ef | fgrep -i tilda | cut -d' ' -f4 | head -1;if [ $a ] ; then kill $a; else tilda; fi

It seems to be working (at least partially) when I commit this in terminal, but when I assign this command to specific keyboard shortcut (for example alt+1) it does nothing. Any suggestions?

btw. is it possible to assign this shortcut for button '`' like in Quake?

© Super User or respective owner

Related posts about linux

Related posts about bash