This commit is contained in:
Simon Vieille 2017-12-14 16:49:32 +01:00
commit ced98dd1c1
No known key found for this signature in database
GPG key ID: 919533E2B946EA10
3 changed files with 51 additions and 4 deletions

View file

@ -1,6 +1,3 @@
interval=1
color=#E9F1FF
[bandwidth_eth0]
command=/home/simon/.i3/bar/src/bandwidth.php eth0
format=json
@ -68,6 +65,26 @@ format=json
interval=1
min_width=button=1
[app_Y]
command=/home/simon/.i3/bar/src/app.php Y "xdg-open https://www.youtube.com/feed/subscriptions" '#f00' 0
format=json
interval=100
[app_F]
command=/home/simon/.i3/bar/src/app.php F "xdg-open https://www.facebook.com/" '#598df3' 0
format=json
interval=100
[app_C]
command=/home/simon/.i3/bar/src/app.php C "xdg-open https://choualbox.com/new" '#eeb819' 0
format=json
interval=100
[app_R]
command=/home/simon/.i3/bar/src/app.php R "xdg-open https://redmine.like-inn-developpement.com/client" '#ff4e51'
format=json
interval=100
[volume]
command=/home/simon/.i3/bar/src/volume.php
format=json

30
bar/src/app.php Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/php
<?php
require __DIR__.'/base/block.php';
$name = $argv[1] ?? null;
$app = $argv[2] ?? null;
$color = $argv[3] ?? color('normal');
$separator = (bool) ($argv[4] ?? 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' => $fullText,
'short_text' => $shortText,
'color' => $color,
'separator' => $separator,
'separator_block_width' => $separator ? 20 : 0,
]
);

View file

@ -30,6 +30,6 @@ echo block(
'bandwidth_'.$iface,
[
'full_text' => $fullText,
'color' => color('info'),
'color' => '#ffffff',
]
);