Active Topics

 



Notices


Reply
Thread Tools
Posts: 67 | Thanked: 13 times | Joined on Feb 2008 @ U.S.A.
#1
There's no documentation on osso-xterm, so I'm looking through the source to try to find out what CLI arguments are supported.

Here's the main:
Code:
int
main(int argc, char **argv)
{
  gboolean started_from_dbus = FALSE;

  if (argc > 1)
    started_from_dbus = !strcmp(argv[1], "--started-from-dbus");

  g_debug("main: started_from_dbus = %s\n", started_from_dbus ? "TRUE" : "FALSE");

  if (dbus_setup(started_from_dbus)) {
    gtk_init(&argc, &argv);

    preamble(&argc, &argv, APPLICATION_NAME);
    gdk_rgb_find_color(gdk_colormap_get_system(), &clr_white);
    gdk_rgb_find_color(gdk_colormap_get_system(), &clr_black);

    xterm_new(argv);

    gtk_main();
  }

  return 0;
}
The arguments are passed to "gtk_init", which I'm ignoring because that wouldn't be xterm specific arguments, and they're also passed to "preamble":
Code:
void
preamble(int *p_argc, char ***p_argv, const char *base_name)
{
  int Nix;

  g_set_application_name(base_name);
  for (Nix = G_N_ELEMENTS(stock_icons) - 1 ; Nix > -1 ; Nix--)
    add_stock_icon(stock_icons[Nix].fname, stock_icons[Nix].stock_name);
}
Which seems to ignore CLI arguments. "xterm_new" also gets an argv, but the specification for xterm_new does not accept any arguments, so I'm not sure why it compiles. I must be missing something. This code is difficult reading.

My goal at the moment is to simply launch an xterm window from a script, and have it execute something (in this case, "tail -f <some log file>")

My blind guess was to try:

osso-xterm -x "tail -f /var/log/file"
osso-xterm -c "tail -f /var/log/file"
/usr/bin/maemo-summoner /usr/bin/osso-xterm.launch -x "tail -f /var/log/file"

All those attempts have failed.
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#2
osso-xterm -e "tail -f /home/user/ledcolor.py"

^^ Opens an osso-xterm and keeps the window open here.

(-e was actually a guess :\)
 

The Following 2 Users Say Thank You to qwerty12 For This Useful Post:
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#3
In reply to your question over IRC (before you got disconnected),
either:
  • source /etc/osso-af-init/af-defines.sh
    or
  • Prefix the maemo-summoner command with "run-standalone.sh"
 

The Following User Says Thank You to qwerty12 For This Useful Post:
Posts: 67 | Thanked: 13 times | Joined on Feb 2008 @ U.S.A.
#4
Originally Posted by qwerty12 View Post
  • source /etc/osso-af-init/af-defines.sh
    or
  • Prefix the maemo-summoner command with "run-standalone.sh"
The only way I've been able to launch xterm w/ a tail command is to run:
Code:
/usr/bin/maemo-summoner /usr/bin/osso-xterm.launch \
  -e "tail -f <file>"
And in that case, the two scripts you're suggesting aren't needed, and don't make an apparent difference.

I thought "run-standalone.sh" was supposed to make the maemo-invoker work, but it doesn't seem to. I have yet to see maemo-invoker work; but I'm not sure why it matters at this point, since maemo-summoner works.

[EDIT] I've discovered that "source /etc/osso-af-init/af-defines.sh" is needed in order to launch from an openvpn script for some reason. This actually fixes another issue I was having ( http://talk.maemo.org/showthread.php?t=30809 )

Last edited by jgombos; 2009-08-15 at 09:13.
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#5
Source isn't a script. It's a command that you include in the script (before maemo-summoner).

(I know source works because I've used it in scripts that run as root and run dbus-send, not even maemo-summoner.)

Last edited by qwerty12; 2009-08-15 at 09:18.
 
Posts: 67 | Thanked: 13 times | Joined on Feb 2008 @ U.S.A.
#6
Originally Posted by qwerty12 View Post
Source isn't a script. It's a command that you include in the script (before maemo-summoner).

(I know source works because I've used it in scripts that run as root and run dbus-send, not even maemo-summoner.)
I wasn't talking about the source command. Source is simply an instrument for invocation to run without subshelling. I was talking about the script (/etc/osso-af-init/af-defines.sh). That script makes no difference when running from the CLI. The maemo-summoner works with or without it.

But where it helped was when the call to maemo-summoner had to be embedded within an openvpn config file.
 
Reply


 
Forum Jump


All times are GMT. The time now is 21:51.