Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to run a command (assumedly using dbus-send) that opens a new tab in a gnome-terminal session and runs a command. Is this possible?

share|improve this question

I believe gnome-terminal doesn't have a dbus interface. Trustin Lee has a blog post about Opening a New tab/ gnome-terminal via a shell script, I added an extra line to make use of xdotool to 'fake' the key input, I suppose you can use this approach.

Please note: I haven't tried this myself as I'm supposed to be working in office ;)

# Path: /usr/local/bin/gnome-terminal
if [ "x$*" != "x" ]; then
  /usr/bin/gnome-terminal "$@"
  pgrep -u "$USER" gnome-terminal | grep -qv "$$"
  if [ "$?" == "0" ]; then
    WID=`xdotool search --class "gnome-terminal" | head -1`
    xdotool windowfocus $WID
    xdotool key ctrl+shift+t
    wmctrl -i -a $WID
    xdotool type <your-command-here>
    xdotool type <your-command-here>
share|improve this answer
up vote 0 down vote accepted

I ended up using ROXTerm and --tab

share|improve this answer

Your Answer


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.