[Sugar-devel] Call website in browser activity from terminal

James Cameron quozl at laptop.org
Tue Sep 11 17:39:10 EDT 2018


G'day,

It depends on if you use Terminal or must add to an activity.

Using Terminal, at prompt or in shell script, use this command;

	sugar-launch -u 'https://google.com' org.laptop.WebActivity

Precautions;

- the command may not finish until Browse is stopped, so use "&" shell
  suffix to place in background,

- if an instance of Browse is already running, another instance is
  started, and the command may finish before Browse is stopped,

- a set of environment variables must be present in the shell; this
  normally happens in Terminal, but if you have more complicated
  process arrangements you must take care to keep environment
  variables,

- the bundle name is printed on Terminal; use shell redirection
  ">/dev/null" to discard this.


Using an activity, call the launch_bundle method
https://developer.sugarlabs.org/sugar3/sugar3.activity.activity.html#launch_bundle

Two activities have examples of using launch_bundle; Browse and Get
Books.  Browse has no need to launch itself, so look at Get Books for
some code.

https://github.com/sugarlabs/get-books-activity/blob/ae4feba6c16a2c63b7e8c4926eb297c7ca3f7cc5/GetIABooksActivity.py#L1090

Hope that helps.

On Tue, Sep 11, 2018 at 10:13:22AM -0500, Alejandro Calderón wrote:
> Hi everybody,
> 
> I'm trying to call a website in browser activity from terminal like in Firefox
> that is the following command:
> 
> firefox [1]www.google.com
> 
> Do you know a way to do the same with browser activity?
> 
> Thank you in advance. 
> 
> Regards!
> 
> References:
> 
> [1] http://www.google.com/

> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel


-- 
James Cameron
http://quozl.netrek.org/


More information about the Sugar-devel mailing list