Skip to content

Instantly share code, notes, and snippets.

@matt-allan
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matt-allan/a963af86c1605fcc655f to your computer and use it in GitHub Desktop.
Save matt-allan/a963af86c1605fcc655f to your computer and use it in GitHub Desktop.
croutonLauncher

If anyone uses this - the php server process doesn't currently kill itself when you return to the chroot.

within the chroot:

sudo apt-get install php5

cd ~/
mkdir scripts
cd scripts

nano launchChrome
#!/bin/sh
#launch the webserver to listen for connections
php -S localhost:8000 -t ~/scripts/ &
#switch to chromium
croutoncycle cros
nano index.php
<html>
<head>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<h2>Chroot Running.</h2>
<form>
<input type="hidden" name ="croutoncycle" value="true">
<button type="submit" class="btn btn-default">Return to XBMC</button>
</form>
</div>
</body>
</html>

<?php

if (!empty($_REQUEST['croutoncycle'])) {
    system('croutoncycle 1');
}

?>

Now once the chroot is running you can return to chromium by executing the launchChrome script.

Create an app launcher to return to the chroot:

chrome://flags/#enable-streamlined-hosted-apps

enable and now go to localhost:8000

chrome menu->more tools->add shortcut to this website to create a launcher.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment