maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   What commandline args are supported by osso-xterm? (https://talk.maemo.org/showthread.php?t=30808)

jgombos 2009-08-15 08:00

What commandline args are supported by osso-xterm?
 
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 2009-08-15 08:03

Re: What commandline args are supported by osso-xterm?
 
osso-xterm -e "tail -f /home/user/ledcolor.py"

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

(-e was actually a guess :\)

qwerty12 2009-08-15 08:45

Re: What commandline args are supported by osso-xterm?
 
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"

jgombos 2009-08-15 09:07

Re: What commandline args are supported by osso-xterm?
 
Quote:

Originally Posted by qwerty12 (Post 311922)
  • 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 )

qwerty12 2009-08-15 09:13

Re: What commandline args are supported by osso-xterm?
 
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.)

jgombos 2009-08-15 09:21

Re: What commandline args are supported by osso-xterm?
 
Quote:

Originally Posted by qwerty12 (Post 311929)
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.


All times are GMT. The time now is 02:08.

vBulletin® Version 3.8.8