As a constant user of the terminal, I'm sometimes forced with opening up new windows some of the time. Because I use a window multiplexer like screen it makes it difficult to use completly new windows.
This little script will open up a terminal window if none is currently open. It will move the terminal window to your workspace and activate it if there is a terminal currently running.
It's magic starts with wmctrl, a beautiful window control program.
Code:
sudo apt-get install wmctrl
Make an executable file somewhere handy
Code:
#!/bin/bash
PID=`pidof Terminal`
if [ "$PID" = "" ]; then
Terminal --command screen --title terminal
fi
wmctrl -R "terminal"
Replace 'Terminal' with your proper terminal, it's the xfce4 one.
If you don't know about screen, I suggest you find out. It makes terminals fun.
Bookmarks