maybe dirty, but it works:
$slug = $_SERVER['REQUEST_URI'];
$slug = explode("https://wordpress.stackexchange.com/", $slug);
$slug = array_filter($slug);
$slug = end($slug);
if ($slug == 'myplugin') {
include(__DIR__.'/theme/index.php');
exit;
}