Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 ;)

#!/bin/sh
# Path: /usr/local/bin/gnome-terminal
if [ "x$*" != "x" ]; then
  /usr/bin/gnome-terminal "$@"
else
  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>
  else
    /usr/bin/gnome-terminal
    xdotool type <your-command-here>
  fi
fi
share|improve this answer
up vote 0 down vote accepted

I ended up using ROXTerm and --tab

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .