doti3/bar/src/app.php
2019-01-21 16:20:04 +01:00

32 lines
627 B
PHP
Executable file

#!/usr/bin/php
<?php
require __DIR__.'/base/block.php';
$name = $argv[1] ?? null;
$app = $argv[2] ?? null;
$background = $argv[3];
$foreground = $argv[4];
$separator = (bool) ($argv[5] ?? true);
if (empty($name) && empty($app)) {
die;
}
$fullText = sprintf(' %s ', $name);
if (getenv('BLOCK_BUTTON') === '1') {
pclose(popen($app, 'r'));
}
echo block(
'app_'.$name,
[
'full_text' => span($fullText, $foreground, $background),
//'separator' => $separator,
//'separator_block_width' => $separator ? 20 : 0,
'separator' => false,
'separator_block_width' => 0,
]
);